Issue metadata
Sign in to add a comment
|
Remove preloading scripts with invalid type/language attributes |
||||||||||||||||||||||||||||||||||||||||||||
Issue descriptionChange description: Stop preloading scripts that wouldn't have been loaded anyways due to type/language attributes. Changes to API surface: None Support in other browsers: Internet Explorer: Unsure Firefox: Scripts are preloaded regardless of type/language Safari: Scripts are preloaded regardless of type/language, as long as the preload scanner is run (parser blocked on script).
,
Aug 1 2016
See discussion in blink-dev: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/eu57SCNltls
,
Aug 1 2016
,
Oct 10 2016
,
Nov 3 2016
M56 branch point is in 2 weeks and this has a removal warning in Deprecation.cpp. Checking in to see if we are still on track for removal in M56?
,
Nov 3 2016
,
Nov 3 2016
Yes we are on track for removal. cfredric is working on the CL right now.
,
Nov 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c commit f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c Author: cfredric <cfredric@chromium.org> Date: Thu Nov 10 17:01:57 2016 Stop preloading scripts that have invalid type/language attributes This patch removes prefetching of scripts that have invalid type/language attributes, and removes the deprecation warning. This also adds/edits tests accordingly. BUG= 626321 Review-Url: https://codereview.chromium.org/2479703003 Cr-Commit-Position: refs/heads/master@{#431277} [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/dont-load-unknown-type-expected.txt [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/dont-load-unknown-type.html [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/frame/Deprecation.cpp [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/frame/UseCounter.h [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp [modify] https://crrev.com/f76c6bc7e8fa6e1ca60101ab3dfc35ba7a40594c/third_party/WebKit/Source/core/html/parser/PreloadRequest.h
,
Nov 14 2016
,
Nov 29 2016
Issue 623109 has been merged into this issue.
,
Nov 29 2016
Issue 329531 has been merged into this issue.
,
Dec 7 2016
I am developer and ... dev tools tell me your broke my browser w/ this. Ex: https://cekvenich.site44.com/home/home/ and open developer tools. I get warning: Fetching scripts with an invalid type/language attributes is deprecated and will be removed in M56, around January 2017. See https://www.chromestatus.com/features/5760718284521472 for more details. 1: And it says you plan to plan to stop some scripts work next month. 2: Also: it won't say what scripts. Or what line. (maybe some lib I'm using even.) 3: If you view source - all my scripts do have a type. That 3rd point is important. What is the issue here at all? Google search won't help. You are removing something, fine. But in English, are your removing? So how can I fix my sites? Or help w/ 1, 2, and 3, please.
,
Dec 7 2016
1. We will only stop preloading the scripts. Usually this will not break scripts with custom types because libraries which do this often do their own fetching using things like XMLHttpRequest or fetch(). 2. You have scripts with type="riot/tag" in your markup, which is not a valid type for <script> I'm not sure what they are used for, but at least we will stop *preloading* e.g. /_compHost/home-card.tag. In fact, for your app this improves performance, because you load these with XHR, but the browser (before this change) makes a *second* fetch for the resource expecting it to be Javascript. This wastes bytes. 3. To load the script, you must have a *valid* type (e.g. "javascript"). You can look at [1] to see valid types. You can also set it blank. [1] https://html.spec.whatwg.org/multipage/scripting.html#javascript-mime-type Please let me know if you have any questions. I agree the deprecation message could be a bit clearer. Sorry about that :/
,
Dec 7 2016
In short, you don't have to worry. The warnings are from <script type="riot/tag">s which are non-standard. While we stop speculative prefetching of those files, they are still fetched with XHRs issued from riot.js and should work just fine.
,
Dec 7 2016
I filed https://github.com/riot/riot/issues/2140 "Do not use <script type="riot/tag" src="...">"
,
Dec 7 2016
Thanks zcorpan!
,
Dec 13 2016
What will happen if the MIME type of the script is not set at all? All examples and discussion seem to be about decent MIME types but not about missing MIME type. Thank you for your help!
,
Dec 13 2016
@17 If the type attribute is missing, it will default to "text/javascript"
,
Dec 13 2016
acmesquares@ is exactly right, see #6 of the "prepare a script" algorithm: https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script
,
Dec 13 2016
With riot 3.0.3, web developers can use data-src instead of src to avoid this issue in current Chrome (and other browsers). https://github.com/riot/riot/commit/83043f1afa331aa2c6240b895fb277fe24f8ab23
,
Dec 14 2016
I meant 3.0.4
,
Dec 14 2016
acmesquares and csharrison: Thank you for your precise and helpful answers.
,
Dec 18 2016
I'm using `text/babel` with `<script type="text/javascript" src="http://www.jimsproch.com/react/babel-browser.js"></script>`. Will it still work?
,
Dec 18 2016
This change should not break babel-browser.js, which uses standard XHR to fetch scripts with type='text/babel'.
,
Jan 16 2017
,
Jan 16 2017
Issue 679914 has been merged into this issue. |
|||||||||||||||||||||||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||||||||||||||||||||||
Comment 1 by csharrison@chromium.org
, Aug 1 2016