From 3a0a13b6e7f17323c764924a0dcaeb725f8ecc2d Mon Sep 17 00:00:00 2001 From: Neealdon3 <138321129+neealdon3@users.noreply.github.com> Date: Sun, 8 Oct 2023 15:54:10 -0700 Subject: [PATCH] Create cloak.js --- public/js/cloak.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 public/js/cloak.js diff --git a/public/js/cloak.js b/public/js/cloak.js new file mode 100644 index 0000000..67c7511 --- /dev/null +++ b/public/js/cloak.js @@ -0,0 +1,35 @@ + const select = document.querySelector('select'); + select.addEventListener('change', event => { + const option = event.target.value; + + if (option === 'blob') { + let htmll=document.querySelector("html"),html=htmll.innerHTML; + html+="",html=" "+html; + let htmlA=Array(html); + const blob=new Blob(htmlA,{type:"text/html"}); + let blobUrl=URL.createObjectURL(blob); + open(blobUrl),URL.revokeObjectURL(blobUrl); + } else if (option === 'popup') { + var url = window.location.href; + var myWindow1 = window.open('about:blank',height='300',width='500'); + myWindow1.document.write(''); + window.location.replace('https://google.com/'); + } else if (option === 'ab') { + var url = window.location.href; + var urlObj = new window.URL(window.location.href); + win = window.open(); + win.document.body.style.margin = "0"; + win.document.body.style.height = "100vh"; + var iframe = win.document.createElement("iframe"); + iframe.style.border = "none"; + iframe.style.width = "100%"; + iframe.style.height = "100%"; + iframe.style.margin = "0"; + iframe.referrerpolicy = "no-referrer"; + iframe.allow = "fullscreen"; + iframe.src = url.toString(); + win.document.body.appendChild(iframe); + window.location.replace("https://google.com/"); + } + select.option = "Open in..."; + });