chromiumoxide/javascript/
extract.rs1pub(crate) const OUTER_HTML: &str = r###"{let rv = ''; if(document.doctype){rv+=new XMLSerializer().serializeToString(document.doctype);} if(document.documentElement){rv+=document.documentElement.outerHTML;} rv}"###;
2pub(crate) const FULL_XML_SERIALIZER_JS: &str = "(()=>{let e=document.querySelector('#webkit-xml-viewer-source-xml');let x=e?e.innerHTML:new XMLSerializer().serializeToString(document);return x.startsWith('<?xml')?x:'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n'+x})()";
4
5pub(crate) fn generate_marker_js(x: f64, y: f64) -> String {
7 format!(
8 "(()=>{{const m=document.createElement('div');m.style='position:absolute;left:{}px;top:{}px;width:10px;height:10px;background:hsl('+Math.floor(Math.random()*360)+',100%,50%);border:2px solid white;border-radius:50%;z-index:9999;pointer-events:none';document.body.appendChild(m);}})();",
9 x - 5.0,
10 y - 5.0
11 )
12}