Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Script tags not reported -- error thrown in content script #158

Closed
gorhill opened this issue Jan 17, 2014 · 3 comments
Closed

Script tags not reported -- error thrown in content script #158

gorhill opened this issue Jan 17, 2014 · 3 comments

Comments

@gorhill
Copy link
Owner

gorhill commented Jan 17, 2014

I found a page which had five script tags in the source, but none of these were reported in the matrix: http://eligrey.com/demos/FileSaver.js/?.

Cursiously, there was no document.scripts property, which caused an error to be thrown when trying to access the document.scripts.length property. I say "curiously" because as per https://developer.mozilla.org/en-US/docs/Web/API/document.scripts, my understanding was that the document.scripts property was always present -- though maybe empty.

Well not in the DOM of this web page.

Fix will be to use document.querySelectorAll, and be prepared to receive null.

The particularity of the script tags on this page is that their type is application/ecmascript.

@gorhill
Copy link
Owner Author

gorhill commented Jan 17, 2014

Fixed locally.

However, this is interesting. webRequest.onBeforeRequest is not called for these script tags present in the source:

<script type="application/ecmascript" async="" src="Blob.js"/>
<script type="application/ecmascript" async="" src="canvas-toBlob.js"/>
<script type="application/ecmascript" async="" src="FileSaver.js"/>
<script type="application/ecmascript" async="" src="//www.google-analytics.com/ga.js"/>
<script type="application/ecmascript" async="" src="demo.js"/>

Looks like a bug in chromium. Will report.

@gorhill
Copy link
Owner Author

gorhill commented Jan 17, 2014

@my-password-is-password
Copy link
Contributor

I'm stupid. Forgot to allow script in the matrix. doh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants