Closed Bug 838521 Opened 7 years ago Closed 2 years ago
scripts with unsupported types are requested and downloaded (spec violation)
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0 Build ID: 20130116073211 Steps to reproduce: I referenced an unsupported type of script like this: <script type="application/nop" src="requesting-this-file-is-a-spec-violation.nop"></script> Test case: http://kaioa.com/k/test/script-test-case/index.html Actual results: Firefox 18 downloaded the referenced file even though it doesn't know what to do with it. (Firefox 18 did not execute the script. This part worked fine.) Expected results: Since Firefox does not know how to handle "application/nop" scripts, it must not download them. http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element The process should stop at step 7 (way before the download starts): "If the user agent does not support the scripting language given by the script block's type for this script element, then the user agent must abort these steps at this point. The script is not executed."
Component: Untriaged → HTML: Parser
Product: Firefox → Core
Looks like Chrome (going back to at least version 37, which is the oldest I can get my hands on) and Safari do not download in this situation. I guess we might as well do the same.
Assignee: hsivonen → bzbarsky
Status: UNCONFIRMED → NEW
Component: HTML: Parser → DOM
Ever confirmed: true
I guess this only happens for script preloads, because ScriptLoader::ProcessScriptElement does bail out immediately on type mismatch.
Attachment #8950950 - Flags: review?(amarchesini)
Attachment #8950950 - Flags: review?(amarchesini) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/d60680f8627c Don't preload scripts of unknown type, just like we don't load them normally. r=baku
You need to log in before you can comment on or make changes to this bug.