Skip to content

Commit

Permalink
Verify the trusted type "sink" value for WorkerGlobalScope.importScri…
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-wang authored Jan 9, 2025
1 parent 6420968 commit 8fa3e31
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ test(t => {

// Test default policy application:
trustedTypes.createPolicy("default", {
createScriptURL: url => url.replace("play", "work")
createScriptURL: (url, _, sink) => {
assert_equals(sink, "Worker importScripts");
return url.replace("play", "work");
}
}, true);
test(t => {
self.result = "Fail";
Expand Down

0 comments on commit 8fa3e31

Please sign in to comment.