Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- js := 'iframe = document.getElementById("idLoginIframe");';
- js := js + 'if (iframe === null)';
- js := js + '{';
- js := js + 'document.addEventListener("click",function(e) {';
- js := js + 'e = e || window.event;';
- js := js + 'var target = e.target || e.srcElement;';
- js := js + 'window.chrome.webview.postMessage(';
- js := js + 'encodeURI(';
- js := js + '"EVENT=CLICK|"+';
- js := js + '"HREF="+document.activeElement.getAttribute("href")+"|"+';
- js := js + '"TEXT="+document.activeElement.text+"|"+';
- js := js + '"TITLE="+document.activeElement.getAttribute("title")+"|"+';
- js := js + '"TAG="+target.tagName+"|"+';
- js := js + '"TAG1="+document.activeElement.tagName+"|"+';
- js := js + '"TYPE="+target.getAttribute("type")+"|"+';
- js := js + '"TYPE1="+document.activeElement.getAttribute("type")+"|"+';
- js := js + '"ID="+target.getAttribute("id")+"|"+';
- js := js + '"ID1="+document.activeElement.getAttribute("id")+"|"+';
- js := js + '"NAME="+target.getAttribute("name")+"|"+';
- js := js + '"NAME1="+document.activeElement.getAttribute("name")+"|"+';
- js := js + '"CLASS="+target.getAttribute("class")+"|"+';
- js := js + '"CLASS1="+document.activeElement.getAttribute("class")+"|"+';
- js := js + '"SRC="+target.getAttribute("src")+"|"+';
- js := js + '"ALT="+target.getAttribute("alt")+"|"+';
- js := js + '"OPTION="+e.target.value+"|"+';
- js := js + '"INNERTEXT="+target.innerText+"|"+';
- js := js + '"HTML="+target.outerHTML';
- js := js + ')';
- js := js + ');';
- js := js + '}, false);';
- js := js + '}';
- js := js + 'else';
- js := js + '{';
- js := js + 'iframe.contentWindow.addEventListener("click", () => {';
- js := js + 'window.chrome.webview.postMessage(';
- js := js + 'encodeURI(';
- js := js + '"EVENT=CLICK|"+';
- js := js + '"IFRAME=true|"+';
- js := js + '"HREF="+iframe.contentDocument.activeElement.getAttribute("href")+"|"+';
- js := js + '"TEXT="+iframe.contentDocument.activeElement.text+"|"+';
- js := js + '"TITLE="+iframe.contentDocument.activeElement.getAttribute("title")+"|"+';
- js := js + '"TAG="+iframe.contentDocument.activeElement.tagName+"|"+';
- js := js + '"TYPE="+iframe.contentDocument.activeElement.getAttribute("type")+"|"+';
- js := js + '"ID="+iframe.contentDocument.activeElement.getAttribute("id")+"|"+';
- js := js + '"NAME="+iframe.contentDocument.activeElement.getAttribute("name")+"|"+';
- js := js + '"CLASS="+iframe.contentDocument.activeElement.getAttribute("class")+"|"+';
- js := js + '"SRC="+iframe.contentDocument.activeElement.getAttribute("src")+"|"+';
- js := js + '"ALT="+iframe.contentDocument.activeElement.getAttribute("alt")+"|"+';
- js := js + '"OPTION="+iframe.contentDocument.activeElement.value+"|"+';
- js := js + '"INNERTEXT="+iframe.contentDocument.activeElement.innerText+"|"+';
- js := js + '"HTML="+iframe.contentDocument.activeElement.outerHTML';
- js := js + ')';
- js := js + ');';
- js := js + '}, false);';
- js := js + '}';
- browser.ExecuteScript(js);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement