Skip to content

Commit e4b635a

Browse files
committed
feat(script): added testing external script injection
1 parent f56eef6 commit e4b635a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test-script-injection.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
and executing new inline scripts (script-injection attacks)
44
See https://github.com/bahmutov/disable-inline-javascript-tutorial
55
*/
6-
(function testScriptInjection() {
6+
(function testInlineScriptInjection() {
77
var el = document.createElement('script');
88
el.innerText = 'alert("hi there")';
99
document.body.appendChild(el); // runs the code by default
1010
}());
11+
12+
(function testExternalScriptInjection() {
13+
var el = document.createElement('script');
14+
el.src = 'https://rawgit.com/hakimel/reveal.js/tree/master/js';
15+
document.body.appendChild(el);
16+
}());

0 commit comments

Comments
 (0)