summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/script-src/support/change-scripthash-before-execute.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/web-platform/tests/content-security-policy/script-src/support/change-scripthash-before-execute.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-security-policy/script-src/support/change-scripthash-before-execute.js b/testing/web-platform/tests/content-security-policy/script-src/support/change-scripthash-before-execute.js
new file mode 100644
index 0000000000..a04e8575b2
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/support/change-scripthash-before-execute.js
@@ -0,0 +1,10 @@
+// This script is executed after |scr1| and |scr2| are inserted into DOM
+// before their execution (if not blocked by CSP).
+if (document.getElementById("scr1")) {
+ document.getElementById("scr1").innerText =
+ "log1 += 'scr1 at #execute-the-script-block';";
+}
+if (document.getElementById("scr2")) {
+ document.getElementById("scr2").innerText =
+ "log2 += 'scr2 at #execute-the-script-block';";
+}