Will Chrome stop some javascript code due to its extensions?
I have a little code on my page with
<script type="text/javascript"> function doPost() { document.forms["form"].submit(); } function Func1Delay() { setTimeout("doPost()", 0); }
....
<body onload="Func1Delay()">
I have this error in the console saying
Uncaught TypeError: unable to call "create" method from undefined
and to the right, this is due to the MeasureIt chrome extension. When I turn it off, my script works. Is there any workaround?
Thanks.
The short answer is YES. But the complete answer is NO, this is not Chrome, but some kind of extension that interferes with your code. For instance:
1) The content of the script can add a listener and use stopPropagation. In this case, your code will not receive this event. I can imagine a more specific scenario when the contents of the script fails and therefore hinders the execution of other listeners.
2) The contents of the script may mess with your page elements. He can remove some and add it. What happens if the extension adds a script element with var or a function named exactly the same as yours?
We cannot be sure how well the extension code is written.
By the way, there are many Chrome extensions that interfere with pages. A few months ago, the Skype for Chrome extension was found guilty of violating and destabilizing web pages and playing videos in this browser.