Advertisement
ssdnet

Untitled

Oct 17th, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. js := 'iframe = document.getElementById("idLoginIframe");';
  2. js := js + 'if (iframe === null)';
  3. js := js + '{';
  4. js := js + 'document.addEventListener("click",function(e) {';
  5. js := js + 'e = e || window.event;';
  6. js := js + 'var target = e.target || e.srcElement;';
  7. js := js + 'window.chrome.webview.postMessage(';
  8. js := js + 'encodeURI(';
  9. js := js + '"EVENT=CLICK|"+';
  10. js := js + '"HREF="+document.activeElement.getAttribute("href")+"|"+';
  11. js := js + '"TEXT="+document.activeElement.text+"|"+';
  12. js := js + '"TITLE="+document.activeElement.getAttribute("title")+"|"+';
  13. js := js + '"TAG="+target.tagName+"|"+';
  14. js := js + '"TAG1="+document.activeElement.tagName+"|"+';
  15. js := js + '"TYPE="+target.getAttribute("type")+"|"+';
  16. js := js + '"TYPE1="+document.activeElement.getAttribute("type")+"|"+';
  17. js := js + '"ID="+target.getAttribute("id")+"|"+';
  18. js := js + '"ID1="+document.activeElement.getAttribute("id")+"|"+';
  19. js := js + '"NAME="+target.getAttribute("name")+"|"+';
  20. js := js + '"NAME1="+document.activeElement.getAttribute("name")+"|"+';
  21. js := js + '"CLASS="+target.getAttribute("class")+"|"+';
  22. js := js + '"CLASS1="+document.activeElement.getAttribute("class")+"|"+';
  23. js := js + '"SRC="+target.getAttribute("src")+"|"+';
  24. js := js + '"ALT="+target.getAttribute("alt")+"|"+';
  25. js := js + '"OPTION="+e.target.value+"|"+';
  26. js := js + '"INNERTEXT="+target.innerText+"|"+';
  27. js := js + '"HTML="+target.outerHTML';
  28. js := js + ')';
  29. js := js + ');';
  30. js := js + '}, false);';
  31. js := js + '}';
  32. js := js + 'else';
  33. js := js + '{';
  34. js := js + 'iframe.contentWindow.addEventListener("click", () => {';
  35. js := js + 'window.chrome.webview.postMessage(';
  36. js := js + 'encodeURI(';
  37. js := js + '"EVENT=CLICK|"+';
  38. js := js + '"IFRAME=true|"+';
  39. js := js + '"HREF="+iframe.contentDocument.activeElement.getAttribute("href")+"|"+';
  40. js := js + '"TEXT="+iframe.contentDocument.activeElement.text+"|"+';
  41. js := js + '"TITLE="+iframe.contentDocument.activeElement.getAttribute("title")+"|"+';
  42. js := js + '"TAG="+iframe.contentDocument.activeElement.tagName+"|"+';
  43. js := js + '"TYPE="+iframe.contentDocument.activeElement.getAttribute("type")+"|"+';
  44. js := js + '"ID="+iframe.contentDocument.activeElement.getAttribute("id")+"|"+';
  45. js := js + '"NAME="+iframe.contentDocument.activeElement.getAttribute("name")+"|"+';
  46. js := js + '"CLASS="+iframe.contentDocument.activeElement.getAttribute("class")+"|"+';
  47. js := js + '"SRC="+iframe.contentDocument.activeElement.getAttribute("src")+"|"+';
  48. js := js + '"ALT="+iframe.contentDocument.activeElement.getAttribute("alt")+"|"+';
  49. js := js + '"OPTION="+iframe.contentDocument.activeElement.value+"|"+';
  50. js := js + '"INNERTEXT="+iframe.contentDocument.activeElement.innerText+"|"+';
  51. js := js + '"HTML="+iframe.contentDocument.activeElement.outerHTML';
  52. js := js + ')';
  53. js := js + ');';
  54. js := js + '}, false);';
  55. js := js + '}';
  56. browser.ExecuteScript(js);
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement