-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for script amp-onerror #1146
Comments
Thanks! When will this be available in the validator? |
At the latest in two weeks. See cl/359398014. |
We should probably wait for b/163852894 before adding it further. |
Fixed on March 5th. |
I'm currently trying to implement this in the Node.JS and PHP versions of the Optimizer, but I'm having trouble producing the exact output the validator requires, as the DOM abstractions tend to introduce whitespace which is enough to invalidate the script. |
Unfortunately, we cannot have whitespace here without the SHA hash being changed: https://elfin-saber-afternoon.glitch.me/ |
I turns out it was not the DOM, but rather a beautify script that was running after the fact on the test files. This seems to be resolved for now: #1195 (comment) |
See ampproject/amphtml#22543 (comment).
Support adding
<script amp-onerror>document.querySelector("script[src*='/v0.js']").onerror=function(){document.querySelector('style[amp-boilerplate]').textContent=''}</script>
to the<head>
in AMP Optimizer.The text was updated successfully, but these errors were encountered: