Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit ba1e231

Browse files
committed
Fix CSP test in old browsers that do not support postMessage
1 parent dae9a77 commit ba1e231

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

assets/csp.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
passed = true;
1313
}
1414

15-
window.top.postMessage('csp10:' + (passed ? 'passed' : 'failed'), '*');
15+
if (window.top.postMessage) {
16+
window.top.postMessage('csp10:' + (passed ? 'passed' : 'failed'), '*');
17+
}
1618

1719
</script>
1820
</body>

0 commit comments

Comments
 (0)