Reg: Pdf rendering in iframe is blocked in chrome

212 views
Skip to first unread message

Dora Samy

unread,
Sep 20, 2023, 12:56:12 AM9/20/23
to Google Apps Script Community
I have a webapp which renders pdf for users in an  iframe.
It is getting blocked by chrome/edge but can be seen in firefox.
I am using pdf-lib for the same.
Any thoughts why it is getting blocked? and anyone had the same issue at any point of time?

cwl...@gmail.com

unread,
Sep 21, 2023, 5:52:41 AM9/21/23
to Google Apps Script Community
Be sure that if you are rendering the iframe using HTMLService that you explicitly set the XFrameOptionsMode to 
"ALLOWALL

See if that helps at all.

Dora Samy

unread,
Sep 21, 2023, 9:34:28 AM9/21/23
to Google Apps Script Community
Hi Crawford,
I am directly using
   <iframe id="embpdf" style="width: 90%; height: 90%;"></iframe>
  const pdfDataUri = await doc.saveAsBase64({ dataUri: true });
     document.getElementById('embpdf').src = pdfDataUri;
this is perfectly working in firefox. but getting blocked in others. But there is no error as such in console?
and the same iframe working perfectly in normal local. Only if it is deployed as google webapp. this issue crops up.
Reply all
Reply to author
Forward
0 new messages