I use something like this:
_Example()
Func _Example()
.....
.....
Local $s_CSS_Parser = _MY_CSSParser()
Local $s_JavaScript = StringRegExpReplace(StringReplace( _
" let style = document.createElement('style'); " & @CRLF & _
" style.id = 'WEBDRIVER_CSSStyles-theme" & $IDX_Frame & "'; " & @CRLF & _
" style.innerHTML = `" & $s_CSS_Parser & "`; " & @CRLF & _
" document.documentElement.insertBefore(style, document.body.nextSibling); " & @CRLF & _
"", @TAB, ''),'\R','')
Local $v_Result = _WD_ExecuteScript($sSession, $s_JavaScript)
EndFunc
Func _MY_CSSParser()
Return StringReplace( _
" * { " & @CRLF & _
" line-height: 1 !important; " & @CRLF & _
" margin-top: 3px !important; " & @CRLF & _
" margin-bottom: 3px !important; " & @CRLF & _
" background-color: white !important; " & @CRLF & _
" } " & @CRLF & _
" " & @CRLF & _
" .alert-info { " & @CRLF & _
" color: black !important; " & @CRLF & _
" } " & @CRLF & _
" " & @CRLF & _
" img[alt='Logo aplikacji'], " & @CRLF & _
" header[class='ember-view'], " & @CRLF & _
" .container > div[class='vertical-offset'], " & @CRLF & _
" svg[role='img'], " & @CRLF & _
" div[class='row ember-view'], " & @CRLF & _
" div.container button, " & @CRLF & _
" div.navbar-header, " & @CRLF & _
" nav.navbar-default, " & @CRLF & _
" #ember271, " & @CRLF & _
" #ember292, " & @CRLF & _
" #ember420, " & @CRLF & _
" #ember419, " & @CRLF & _
" #ember455, " & @CRLF & _
" #ember457, " & @CRLF & _
" #ember484, " & @CRLF & _
" #ember491 { " & @CRLF & _
" display: none; " & @CRLF & _
" } " & @CRLF & _
"", @TAB, '')
#cs
* {
line-height: 1 !important;
margin-top: 3px !important;
margin-bottom: 3px !important;
background-color: white !important;
}
.alert-info {
color: black !important;
}
img[alt='Logo aplikacji'],
header[class='ember-view'],
.container > div[class='vertical-offset'],
svg[role='img'],
div[class='row ember-view'],
div.container button,
#ember271,
#ember292,
#ember420,
#ember419,
#ember455,
#ember457,
#ember484,
#ember491 {
display: none;
}
#ce
EndFunc ;==>_MY_CSSParser