Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Create cloak.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding4Hours authored Oct 8, 2023
1 parent 06d9867 commit 3a0a13b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions public/js/cloak.js
Original file line number Diff line number Diff line change
@@ -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="<!doctype 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('<iframe src=${url}></iframe>');
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...";
});

0 comments on commit 3a0a13b

Please sign in to comment.