Skip to content

Commit

Permalink
Support <script type="webbundle"> in preload scanner
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
irori authored and Gabisampaio committed Nov 18, 2021
1 parent 252dbcb commit 690ae81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web-bundle/resources/test-helpers.js
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 690ae81

Please sign in to comment.