-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Proposal: sync-script #2
Comments
Should we block dynamically-inserted inline scripts? |
Do dynamically inserted scripts behave like async exactly? |
dynamically-inserted inline scripts are executed immediately (unless there are pending style sheets). dynamically-inserted external scripts behave like async exactly (unless async/defer/etc. are added/modified). |
(in the case of classic scripts) |
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojan@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#576652}
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojan@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#576652}
Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojan@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#576652}
…an experimental feature policy), a=testonly Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy) Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojan@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#576652} -- wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775 wpt-pr: 10827
…an experimental feature policy), a=testonly Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy) Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojan@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#576652} -- wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775 wpt-pr: 10827
Would love to see this added as a mechanism to ban blocking script downloads. This way it's a mechanism to enforce a web performance budget in terms of 'zero synchronous script downloads'. If this could be extended to stylesheets too, that would be even better. A feature policy like:
would mean we allow our own 1st party stylesheet(s), but prevent people putting SPOFs like Google Font stylesheet |
…an experimental feature policy), a=testonly Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy) Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojanchromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Reviewed-by: Ian Clelland <iclellandchromium.org> Commit-Queue: Nate Chapin <japhetchromium.org> Cr-Commit-Position: refs/heads/master{#576652} -- wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775 wpt-pr: 10827 UltraBlame original commit: a1f1e78ef7757951af1102a8d93d649812c9c8ae
…an experimental feature policy), a=testonly Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy) Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojanchromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Reviewed-by: Ian Clelland <iclellandchromium.org> Commit-Queue: Nate Chapin <japhetchromium.org> Cr-Commit-Position: refs/heads/master{#576652} -- wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775 wpt-pr: 10827 UltraBlame original commit: a1f1e78ef7757951af1102a8d93d649812c9c8ae
…an experimental feature policy), a=testonly Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy) Spec discussion: https://github.com/WICG/feature-policy/issues/135 Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo Bug: 862422 Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8 Reviewed-on: https://chromium-review.googlesource.com/894137 Reviewed-by: Ojan Vafai <ojanchromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Reviewed-by: Ian Clelland <iclellandchromium.org> Commit-Queue: Nate Chapin <japhetchromium.org> Cr-Commit-Position: refs/heads/master{#576652} -- wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775 wpt-pr: 10827 UltraBlame original commit: a1f1e78ef7757951af1102a8d93d649812c9c8ae
Parser-blocking script can greatly delay the appearance of meaningful content. The proposal is to add a new feature, sync-script, which is enabled by default (default allowlist is *).
When disabled, a script that would block parsing until its completion would not be run. The decision on whether a script will block parsing is made in step 24 of preparing a script in the HTML spec. This feature, when disabled, would prevent execution for the second and fifth clauses (where the element becomes the "pending parser-blocking script"), and the sixth clause when the element is flagged as parser-inserted.
This could be specified as a new step somewhere before step 24 (around step 11 perhaps):
If the element's node document is not allowed to use the sync-script feature, and the element does not have a defer attribute, and the element has been flagged as "parser-inserted", and the element does not have an async attribute, then return. The script is not executed.
The text was updated successfully, but these errors were encountered: