Skip to content

Commit

Permalink
Bug 1737956 [wpt PR 31394] - Support <script type="webbundle"> in pre…
Browse files Browse the repository at this point in the history
…load scanner, a=testonly

Automatic update from web-platform-tests
Support <script type="webbundle"> in preload scanner

This makes PreloadScanner update its ExclusionInfo when it encounters
<script type="webbundle">, so that resources listed in it will not be
preloaded.

Bug: 1263777
Change-Id: Ifec5616cb27b382408023a249a274b5a0ef35da4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244924
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935308}

--

wpt-commits: fe8ea311c44cbf8f6ca585bbd12bc87ceafe1c46
wpt-pr: 31394
  • Loading branch information
irori authored and moz-wptsync-bot committed Oct 29, 2021
1 parent 6b70ddc commit 82ddf18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ function createWebBundleElement(url, resources, options) {
const script = document.createElement("script");
script.type = "webbundle";
const json_rule = {"source": url, "resources": resources};
if (options && options.scopes) {
json_rule.scopes = options.scopes;
}
if (options && options.credentials) {
json_rule.credentials = options.credentials;
}
script.textContent = JSON.stringify(json_rule);
// TODO(crbug.com/1245166): Support |options.scopes|.
return script;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<script type="webbundle">
{
"source": "dynamic1.wbn"
"source": "dynamic1.wbn",
"scopes": ["dynamic/resource"]
}
</script>
Expand Down

0 comments on commit 82ddf18

Please sign in to comment.