Google has temporarily reversed Chrome’s removal of browser alert windows and other prompts created via cross-origin iframes after a rocky rollout over the past two weeks broke web apps and alarmed developers.
An iframe, or Inline Frame, is a portion of a web page embedded in another web page. When it includes resources from a different origin or domain, it’s a cross-origin iframe.
Since March, 2020, the team behind Chromium, the open-source engine of Chrome, has been planning to limit the capabilities of cross-origin iframes because they’re a security liability. Specifically, they allow an embedded resource like an ad to present a prompt as if it were the host domain.
“The current user experience is confusing, and has previously led to spoofs where sites pretend the message comes from Chrome or a different website,” a Google engineer explained in the company’s initial Intent to Remove notice last year.
“Removing support for cross origin iframes’ ability to trigger the UI will not only prevent this kind of spoofing, but will also unblock further efforts to make the dialog more recognizable as part of the website rather than the browser.”
By doing so, Google has broken more than a few web apps. And eventually, Google plans to remove these prompt mechanisms completely (from same-origin contexts as well as cross-origin ones), again to prevent potential abuse.
The deprecation of
window.confirm from cross-origin iframes took effect with the release of Chrome 92.0.4515.107 on July 20. Since then, applications like social dev environment Codepen and Microsoft’s Azure Cosmos DB have encountered problems because they present users with alerts, notifications, and confirmation windows via cross-origin iframes.
In the Chromium issue where the removal is being tracked, developers have been chiming in to express their dismay at the way this change has been forced upon the web community.
window.parent.postMessage workaround because chunks of our web app are now broken for our tens of thousands of users.”
“I’m an engineer for a large ERP company and work on a product where hundreds of large customers (hundreds of thousands of users) are no longer able to use the product due to the removal of cross origin dialogs,” wrote another developer.
“These customers generally choose to host the product themselves, which means signing up for the origin would fall on each of them individually. That isn’t feasible for us or their IT departments. We internally are not even able to get it to work. We are also getting pushback on asking them to push out registry settings.”
My team is working around the clock and weekends trying to rewrite our product around this change
“My team is working around the clock and weekends trying to rewrite our product around this change and simply need more time. This type of change should have been documented and warned about ahead of time in my opinion.”
The outcry has proven voluble enough that Microsoft Edge last week reverted the changes in its upstream Chromium code to restore dialogs in cross-origin iframes. Shortly thereafter, a Google engineer said Chrome has disabled its deprecation until August 15 to provide developers with more time to rewrite their apps.
Google has even implemented a four-month opt-in “reverse origin trial” that temporarily revives cross-origin prompts for Chrome users and gives developers retrofitting large web apps more time to find replacements for the exiled API methods.
“This is peak Chrome; what seems to be a reasonably good idea that’s hampered because it was pushed out thoughtlessly without putting any serious effort into notifying the people affected or making sure that nothing else breaks, or making sure that it thoroughly solves the problem,” wrote developer Daniel Shumway in a post to Hacker News.
“The product owners at Chrome are smart, but they’re careless and constantly break the web because they don’t seem to have enough of a sense of gravitas or caution about what they’re doing.” ®