When opening any AMP page in opera mini, you are confronted on page load with an alert - javascript alert: 1
Go to any AMP page (I tried news publishers) in opera mini (opera mini proper, not opera turbo) and load any AMP page. The JS alert box seems to appear immediately and doesn't provide any context to the user.
Tested on opera mini on iOS
I can repro on some AMP pages on Oepra Mini iOS after switching Turbo off. (Note Opera Touch and Android Opera is fine. Also note Opera Mino is not available on Apple US store, have to switch country to download)
Not sure what it is, dos not happen on pages from cache or viewer, only when hit directly. Some AMP First sites like ampproject.org and ampbyexample.com are fine but tasty.co isn't.
no sure where this falls, /cc @choumx
I suspect this in amp-bind-0.1.max.js
if (DOMPurify.isSupported) {
(function () {
try {
var doc = _initDocument('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">');
if (doc.querySelector('svg img')) {
useDOMParser = true;
}
} catch (err) {}
})();
@jpettitt nice find. I can confirm ampbyexample page for amp-bind throws the alert
@aghassemi all I did was grep for alert(1) in the dist files :-)
DOMpurify is a 3P, maybe we need to upgrade or patch it. @choumx we patch web-animations 3P in build files with regex hacks, same may work here too
I can file this upstream with DOMPurify. Thanks for the investigation.
This issue doesn't have a category which makes it harder for us to keep track of it. @choumx Please add an appropriate category.
Tracked in DOMPurify: https://github.com/cure53/DOMPurify/issues/312
Just need to upgrade past the patch to fix it AMP.
@choumx Great news: DomPurify seem to have done their bit!
Most helpful comment
I suspect this in amp-bind-0.1.max.js