Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

128
Views
JavaScript dialogs alert(), confirm() and prompt() in cross origin iframe does not work any longer

Apps script web app works in <iframe>. It seems Chrome is no longer supporting alert(), confirm(), Promote these functions on the web app.

Any workaround to this?

  • Chrome Version 92.0.4515.107 (Official Build) (64-bit) -- does not work
  • Edge Version 91.0.864.71 (Official build) (64-bit) -- works

Tried replacing alert() with window.alert(), but still does not work.

exec:1 A different origin subframe tried to create a JavaScript dialog. This is no longer allowed and was blocked. See https://www.chromestatus.com/feature/5148698084376576 for more details.

11 months ago · Santiago Trujillo
2 answers
Answer question

0

So far, the only 'solution' for this is to add the following to your Chrome/Edge browser shortcut:

--disable-features="SuppressDifferentOriginSubframeJSDialogs"

Or downgrade your browser. Obviously neither of these are ideal. Google trying really hard to save us from ourselves here.

11 months ago · Santiago Trujillo Report

0

File a feature request:

Consider filing a feature request using this Issue Tracker template.

I'd either request that an exception is made for Apps Script web apps, or that built-in methods for alert and confirm are added, similar to the existing alert and prompt dialogs, which currently work on Google editors.

Bug filed:

By the way, this behavior has been reported in Issue Tracker (as a bug):

  • Javascript in html files doesn't work

I'd consider starring it in order to keep track of it.

Workaround:

In the meanwhile, as others said, consider downgrading or changing the browser, or executing it with the following command line flag:

--disable-features="SuppressDifferentOriginSubframeJSDialogs"

Related question:

  • Chrome SuppressDifferentOriginSubframeJSDialogs setting override using JS?
11 months ago · Santiago Trujillo Report
Answer question
Find remote jobs