MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / add_js_link

Function add_js_link

seleniumbase/fixtures/js_utils.py:690–703  ·  view source on GitHub ↗
(driver, js_link)

Source from the content-addressed store, hash-verified

688
689
690def add_js_link(driver, js_link):
691 script_to_add_js = """function injectJS(link) {
692 var body_tag=document.getElementsByTagName("body")[0];
693 var script_tag=document.createElement("script");
694 script_tag.src=link;
695 script_tag.type="text/javascript";
696 script_tag.crossorigin="anonymous";
697 script_tag.defer;
698 script_tag.onload=function() { null };
699 body_tag.appendChild(script_tag);
700 }
701 injectJS("%s");"""
702 js_link = escape_quotes_if_needed(js_link)
703 execute_script(driver, script_to_add_js % js_link)
704
705
706def add_css_style(driver, css_style):

Callers 4

activate_jqueryFunction · 0.85
activate_jquery_confirmFunction · 0.85
activate_html_inspectorFunction · 0.85
activate_messengerFunction · 0.85

Calls 2

escape_quotes_if_neededFunction · 0.85
execute_scriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…