Update default "onload" value for JS injector

This commit is contained in:
Michael Mintz 2018-08-12 17:19:50 -04:00
parent 18688ee656
commit 92186bb494
1 changed files with 2 additions and 2 deletions

View File

@ -732,7 +732,7 @@ class BaseCase(unittest.TestCase):
script.src = "%s";
script.defer;
script.crossorigin = "anonymous";
script.onload = function() {$("html")};
script.onload = function() { null };
head.appendChild(script);
}
injectJS();""")
@ -755,7 +755,7 @@ class BaseCase(unittest.TestCase):
'''var h = document.getElementsByTagName('head').item(0);'''
'''var s = document.createElement("script");'''
'''s.type = "text/javascript";'''
'''s.onload = function() {$("html")};'''
'''s.onload = function() { null };'''
'''s.appendChild(document.createTextNode("%s"));'''
'''h.appendChild(s);''')
self.execute_script(add_js_code_script % re.escape(js_code))