It seems that functions in validator.js are escaping into the global namespace.
#development=1 appended to the URL.wp.wp is not definedwp is a function:茠 wp(a){rp.call(this);this.name=a;this.value=[];this.b=!1;this.o=34}
It looks like this script leaks functions into the global namespace:
https://cdn.ampproject.org/v0/validator.js
There are other functions leaked, like aa.
Maybe that script is intended for development only, as it seems that it's not requested if #development=1 isn't appended. But it would really help us with this issue on the AMP WordPress plugin:
https://github.com/Automattic/amp-wp/issues/843
We're working on validating AMP in the WordPress editor.
Chrome 63.0.3239.132
Thanks a lot for your help 馃槃
/cc @amedina, @Gregable, @pbakaus
I think we can get a fix out for this fairly quickly. @powdercloud has a prototype, but we need to get it through a release. Thanks for the report.
Thanks a lot, @Gregable! That would really help.
This is a high priority issue but it hasn't been updated in awhile. @Gregable Do you have any updates?
Yeah this is done. I just confirmed by looking at https://cdn.ampproject.org/v0/validator.js and verifying that the whole thing is wrapped into a javascript scope with the usual pattern. Please reopen / complain if you see further issues.
Thank You
Hi @powdercloud and @Gregable,
Thanks a lot for fixing this. As you mentioned, validator.js is wrapped in a function, and functions like wp aren't leaked.
Most helpful comment
I think we can get a fix out for this fairly quickly. @powdercloud has a prototype, but we need to get it through a release. Thanks for the report.