You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to only be occurring on the domain https://hindi-news18-com.cdn.ampproject.org, (example page) so far, or at least that's the bulk of the reports. The publisher has code like the following:
functioncheckCookie(){varuser=accessCookie("testCookie");if(user!="")alert("Welcome Back "+user+"!!!");else{user=prompt("Please enter your name");num=prompt("How many days you want to store your name on your computer?");if(user!=""&&user!=null){createCookie("testCookie",user,num);}}}createCookie("JioPlayer","1",1);checkCookie();//# sourceURL=amp-script%5Bsrc=%22https://hindi.news18.com/amp-customjs.js?v=1%22%5D.js
This is within an amp-script[src=...] script. A few takeaways:
According to the compatibility table, the Window.prompt API is not enabled in the worker DOM. Would it be feasible to stub blocked APIs in some way to alert publishers that they will fail?
Errors occurring in an amp-script throw stacktraces outside of our code. Example:
Uncaught ReferenceError: prompt is not defined
at checkCookie (amp-script[src="http鈥mjs.js?v=1"].js:28)
at amp-script[src="http鈥mjs.js?v=1"].js:37
The amp-script stacktrace bit could be ignored on the error-reporting backend, but the runtime error handling should be able to handle these errors separately and report them as user errors.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Details
Error report: link
First seen: Apr 15, 2020
Frequency: ~ 48689/day
Stacktrace
The text was updated successfully, but these errors were encountered: