pdf from google drive dont show on iframe, before upgrade to 4.5.1 it works

pdf from google drive dont show on iframe, before upgrade to 4.5.1 it works

by Lewi S. Kristianto (visiniaga) -
Number of replies: 1

Moodle 4.5.1
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
PHP 8.1.2-1ubuntu2.20 (cli) (built: Dec  3 2024 20:14:35) (NTS)

show error Blocked script execution in 'https://drive.google.com/file/d/ID/preview' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.


raw iframe it showing:

image.png

try to change from 
<p><iframe
    src="https://drive.google.com/file/d/[ID]/preview"
    width="640" height="480" sandbox="" allow="autoplay"></iframe></p>

to

<p><iframe
    src="https://drive.google.com/file/d/[ID]/preview"
    width="640" height="480" sandbox="allow-scripts" allow="autoplay"></iframe></p>

it always saves or reverts without sandbox="allow-scripts." Do you have any thoughts on how to solve this?

troubleshooting step so far:
1. enable role trustedcontent, and assign role to users, but everytime save, content still save to sandbox="", I dunno if sandbox="allow-scripts" will solve this problem, still just guessing

image%20%281%29.png

image%20%282%29.png

Average of ratings: -