Update methods for link/script additions
This commit is contained in:
parent
5ea6f1188f
commit
60ddc6e03a
|
@ -714,6 +714,7 @@ class BaseCase(unittest.TestCase):
|
||||||
'''link.rel = "stylesheet"; '''
|
'''link.rel = "stylesheet"; '''
|
||||||
'''link.type = "text/css"; '''
|
'''link.type = "text/css"; '''
|
||||||
'''link.href = "%s"; '''
|
'''link.href = "%s"; '''
|
||||||
|
'''link.crossorigin = "anonymous"; '''
|
||||||
'''document.getElementsByTagName("head")[0]'''
|
'''document.getElementsByTagName("head")[0]'''
|
||||||
'''.appendChild(link);''')
|
'''.appendChild(link);''')
|
||||||
self.execute_script(add_css_link_script % css_link)
|
self.execute_script(add_css_link_script % css_link)
|
||||||
|
@ -722,6 +723,8 @@ class BaseCase(unittest.TestCase):
|
||||||
script_to_add_js = (
|
script_to_add_js = (
|
||||||
'''var script = document.createElement("script"); '''
|
'''var script = document.createElement("script"); '''
|
||||||
'''script.src = "%s"; '''
|
'''script.src = "%s"; '''
|
||||||
|
'''script.defer; '''
|
||||||
|
'''script.crossorigin = "anonymous"; '''
|
||||||
'''document.getElementsByTagName("head")[0]'''
|
'''document.getElementsByTagName("head")[0]'''
|
||||||
'''.appendChild(script);''')
|
'''.appendChild(script);''')
|
||||||
self.execute_script(script_to_add_js % js_link)
|
self.execute_script(script_to_add_js % js_link)
|
||||||
|
|
Loading…
Reference in New Issue