A parser-blocking cross-origin script...
Chrome running in Electron is causing my app to fail. Trying to figure out how to work around it. Help much appreciated.
by Dave Winer Saturday, April 1, 2017

Update: I worked around the problem. See below

Sometime in the last few weeks Chrome started giving an error message in the JavaScript console, in various apps, of this form: "A Parser-blocking, cross-origin script, <url>, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See <page> for more details."

Until the last couple of days it's been for unimportant stuff that probably is never getting called in the apps it was showing up in, but then it showed up in a test version of an app inside Electron, running on Ubuntu, and it was a deal-stopper, it prevented the app from working. The same app running in the Mac Electron environment runs without problem. This only happens on Ubuntu. (Ubuntu is running inside VMware Fusion.)

The docs on the Chrome site say that the error has to do with bad performance on mobile devices with a slow connection. They say that it only happens if a certain set of conditions prevail. We're on a hard connection, running on a desktop computer. According to speedtest.net, I have 45 megabit connection down. Fast enough to load a few small JavaScript files without delay.

Note: They say it's enabled only on mobile platforms, but I'm getting the error in Chrome/Mac as well as in Electron. Something isn't adding up here. ;-)

I'm trying to figure out how to work around this. No matter what it's going to require serious surgery on the app, and significant potential for breakage. I'd like to know what's really going on before embarking on a lot of development work. Maybe it's not necessary?

Any help much appreciated. :balloon: