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

Function add_css_style

seleniumbase/fixtures/js_utils.py:706–717  ·  view source on GitHub ↗
(driver, css_style)

Source from the content-addressed store, hash-verified

704
705
706def add_css_style(driver, css_style):
707 add_css_style_script = """function injectStyle(css) {
708 var head_tag=document.getElementsByTagName("head")[0];
709 var style_tag=document.createElement("style");
710 style_tag.type="text/css";
711 style_tag.appendChild(document.createTextNode(css));
712 head_tag.appendChild(style_tag);
713 }
714 injectStyle("%s");"""
715 css_style = css_style.replace("\n", "")
716 css_style = escape_quotes_if_needed(css_style)
717 execute_script(driver, add_css_style_script % css_style)
718
719
720def add_js_code_from_link(driver, js_link):

Callers 1

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…