<!doctype html>
<html>
<head>
<style>
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
color: red;
opacity: 1; /* Firefox */
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: red;
}

::-ms-input-placeholder { /* Microsoft Edge */
color: red;
}
</style>
<script type='text/javascript'>

var eles;
var selectoris="";
var selectorplusis="";
var scriptplusis="";
var froms=[];
var tos=[];
var wasino=null;
var absval="";
var urltosend="";
var ccnt=0;
var zhr=null;
var wasplaceholder="";
var thejs=location.search.split("thescript=")[1] ? decodeURIComponent(location.search.split("thescript=")[1].split('&')[0]).replace(/\;\ /g, '; ' + String.fromCharCode(10)) : "";
var documentURL="" + document.URL.split("#")[0];

function showStuff(evt) {
if (zhr.readyState == 4) {
if (zhr.status == 200) {
absval=zhr.responseText;
//alert(absval);
}
}
}

function ajaxit() {
zhr = new XMLHttpRequest();
var form=new FormData();
form.append('inurl', urltosend);
form.append('tdinto', 'divinv');
if (document.URL.indexOf('localhost:8888') != -1) {
zhr.open('post', 'http://localhost:8888/fgc/?rand=' + Math.floor(Math.random() * 198765432), true);
} else {
zhr.open('post', '//www.rjmprogramming.com.au/PHP/fgc/?rand=' + Math.floor(Math.random() * 198765432), true);
}
zhr.onreadystatechange = showStuff;
zhr.send(form);
preshowBelow();
}

function ourdecodeURIComponent(xin) {
return xin;
}

function preshowBelow() {
if (absval != '') {
wasino.value=wasino.placeholder;
wasino.placeholder=wasplaceholder;
showBelow(wasino);
wasino=null;
absval='';
} else {
setTimeout(preshowBelow, 2000);
}
}

function showBelow(ino) {
var his='', bahis='', things=[];
var firstdelim='#';
var delim='#';
if (ourdecodeURIComponent('' + ino.value).indexOf('`') != -1) {
firstdelim='`';
if (ourdecodeURIComponent('' + ino.value).indexOf(String.fromCharCode(10)) != -1) {
if (eval(ourdecodeURIComponent('' + ino.value).indexOf(String.fromCharCode(10))) < eval(ourdecodeURIComponent('' + ino.value).indexOf('`'))) {
firstdelim=String.fromCharCode(10);
things=ourdecodeURIComponent('' + ino.value).split(String.fromCharCode(10));
if ((things[1].trim() + ' ').substring(0,1) != '`') {
ino.value=ino.value.replace(String.fromCharCode(10), '`');
firstdelim='`';
}
}
}
delim='`';
} else if (ourdecodeURIComponent('' + ino.value).indexOf(String.fromCharCode(10)) != -1) {
firstdelim=String.fromCharCode(10);
delim=String.fromCharCode(10);
if (ourdecodeURIComponent('' + ino.value).indexOf('#') != -1) {
delim='#';
things=ourdecodeURIComponent('' + ino.value).split(String.fromCharCode(10));
if ((things[1].trim() + ' ').substring(0,1) != '#') {
ino.value=ino.value.replace(String.fromCharCode(10), '#');
firstdelim='#';
}
}
}
if (wasplaceholder == '') {
wasplaceholder=ino.placeholder;
}
if (('' + ino.value).toLowerCase().indexOf('//') == 0) {
ino.value=document.URL.split(':')[0].toLowerCase() + ':' + ino.value;
} else if (('' + ino.value).toLowerCase().indexOf('www.') == 0) {
ino.value=document.URL.split(':')[0].toLowerCase() + '://' + ino.value;
}
if (ino.value.indexOf(delim) != -1) {
if (ourdecodeURIComponent(ino.value).split(delim).length > 2) {
scriptplusis=ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf(delim))).split(delim)[1].replace(/NO\%WAY/g, 'NO%25WAY')).replace(/\;\ /g, '; ' + String.fromCharCode(10)).replace(/\"\;/g, '"').replace(/\&apost\;/g, "'");
}
if (ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf(delim))).replace(/NO\%WAY/g, 'NO%25WAY')).indexOf('{') != -1) {
selectorplusis=ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf(delim))).split(delim)[0].replace(/NO\%WAY/g, 'NO%25WAY')).replace(/\;\ /g, '; ' + String.fromCharCode(10)).replace(/\"\;/g, '"').replace(/\&apost\;/g, "'");
}
selectoris=ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf(delim))).split(delim)[0].replace(/NO\%WAY/g, 'NO%25WAY')).split('{')[0].trim().replace(/\"\;/g, '"').replace(/\&apost\;/g, "'");
if (('' + ino.value).replace(/\ \;/g, ' ').indexOf(('' + ino.value).replace(/\ \;/g, ' ').trim() + ' ') != -1 || ('' + ino.value).replace(/\ \;/g, ' ').indexOf(' ' + delim) != -1) {
if (documentURL.indexOf('?') != -1) {
documentURL=documentURL.replace('?', '?window=popup&');
} else {
documentURL+='?window=popup';
}
} else if (('' + ino.value).replace(/\ \;/g, ' ').indexOf(('' + ino.value).replace(/\ \;/g, ' ').trim() + ' ') != -1 || ('' + ino.value).replace(/\ \;/g, ' ').indexOf(' ' + delim) != -1) {
if (documentURL.indexOf('?') != -1) {
documentURL=documentURL.replace('?', '?window=y&');
} else {
documentURL+='?window=y';
}
} else if (('' + ino.value).replace(/\ \;/g, ' ').indexOf(('' + ino.value).replace(/\ \;/g, ' ').trim() + ' ') != -1 || ('' + ino.value).replace(/\ \;/g, ' ').indexOf(' ' + delim) != -1) {
if (documentURL.indexOf('?') != -1) {
documentURL=documentURL.replace('?', '?refresh=y&');
} else {
documentURL+='?refresh=y';
}
}
}
if (('' + ino.value).toLowerCase().indexOf('http') == 0) {
if (absval == '') {
urltosend=ino.value.split(firstdelim)[0];
ino.placeholder=ino.value;
ino.value=''; //ino.value.replace(urlis,'');
wasino=ino;
ajaxit();
return;
}
}
if (ino.value.trim() != '') {
if (absval != '') {
bahis='data:text/html;base64,' + absval;
//alert(bahis);
absval='';
document.getElementById('ifgoeshere').innerHTML="<iframe id=ifsd onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' srcdoc=\"\"></iframe><iframe id=xifsd onload='checkif(this);' style='display:none;' src=\"" + bahis + "\"></iframe>";
} else if (ino.value.split(delim)[0].trim() == '' && 1 == 2) {
document.getElementById('myh1').style.opacity='0.01';
document.getElementById('myh3').style.opacity='0.01';
document.getElementById('myinput').style.opacity='0.01';
document.getElementById('ifgoeshere').innerHTML="<iframe onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' src='" + document.URL + "'></iframe>";
} else if (ino.value.split(delim)[0].trim() == '') {
his='<html>' + document.head.outerHTML + document.body.outerHTML + '</html>';
bahis='data:text/html;base64,' + btoa(his);
document.getElementById('ifgoeshere').innerHTML="<iframe id=ifsd onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' srcdoc=\"\"></iframe><iframe id=xifsd onload='checkif(this);' style='display:none;' src=\"" + bahis + "\"></iframe>";
} else {
document.getElementById('myh1').style.opacity='0.01';
document.getElementById('myh3').style.opacity='0.01';
document.getElementById('myinput').style.opacity='0.01';
document.getElementById('ifgoeshere').innerHTML="<iframe onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' src='" + ino.value.split(delim)[0].trim() + "'></iframe>";
}
}
}

function checkif(iois) {
var ij, wois=null, morescr='';
if (iois != null) {
console.log('' + iois.src);
if (('' + iois.src).indexOf('data:') == 0 && ('' + iois.src).indexOf(';base64,') != -1) { // src=data:text/html;base64,[base64HTMLContent] comes here
var ioissrc=('' + iois.src);
//alert(ioissrc);
iois.src='';
if (selectorplusis.indexOf(' BORDER') != -1) {
eles=document.querySelectorAll(selectoris);
for (ij=eval(-1 + eles.length); ij>=0; ij--) {
froms.push(eles[ij].outerHTML);
tos.push('<a onclick="alert(this.innerHTML);" style="cursor:pointer;text-decoration:none;" title="Border clickable">' + eles[ij].outerHTML + '</a>');
}
for (ij=0; ij<froms.length; ij++) {
ioissrc=ioissrc.replace(froms[ij], tos[ij]);
}
if ((1 == 1 || absval != '') && (('' + documentURL).indexOf('window=') != -1 || ('' + documentURL).indexOf('refresh=') != -1)) {
morescr=String.fromCharCode(10) + ' var dbih=document.body.innerHTML, tos=[], froms=[], eles=document.querySelectorAll("' + selectoris + '"); ' + String.fromCharCode(10);
morescr+=String.fromCharCode(10) + ' for (var ij=eval(-1 + eles.length); ij>=0; ij--) { froms.push(eles[ij].outerHTML); tos.push(' + "'" + '<a onclick="alert(this.innerHTML);" style="cursor:pointer;text-decoration:none;" title="Border clickable">' + "'" + ' + eles[ij].outerHTML + ' + "'" + '</a>' + "'" + '); } ' + String.fromCharCode(10);
morescr+=String.fromCharCode(10) + ' for (ij=0; ij<froms.length; ij++) { dbih=dbih.replace(froms[ij], tos[ij]); } ' + String.fromCharCode(10);
morescr+=String.fromCharCode(10) + ' document.body.innerHTML=dbih; ' + String.fromCharCode(10);
}
}
var xbodyt=atob(('' + ioissrc).split(';base64,')[1]).replace('</bo' + 'dy>', ' <style> ' + selectorplusis + '</style> <scr' + "ipt type='text/javascript'> " + scriptplusis + morescr + '</scr' + 'ipt> </bo' + 'dy>');
var bodyt=xbodyt.split('<bo' + 'dy')[1];
if (('' + documentURL).indexOf('window=') != -1) {
if (('' + documentURL).indexOf('popup') != -1) {
wois=window.open('', '_blank', 'top=0, left=0, width=600, height=600');
} else {
wois=window.open('', '_blank');
}
wois.document.write(atob(('' + ioissrc).split(';base64,')[1]).replace('</bo' + 'dy>', ' <style> ' + selectorplusis + '</style> <scr' + "ipt type='text/javascript'> " + scriptplusis + morescr + '</scr' + 'ipt> </bo' + 'dy>'));
} else if (('' + documentURL).indexOf('refresh=') != -1) {
document.body.innerHTML=bodyt.substring(eval(1 + bodyt.indexOf('>'))).split('</bo' + 'dy>')[0];
} else {
document.getElementById('myh1').style.opacity='0.01';
document.getElementById('myh3').style.opacity='0.01';
document.getElementById('myinput').style.opacity='0.01';
document.getElementById('ifsd').srcdoc=atob(('' + ioissrc).split(';base64,')[1]).replace('</bo' + 'dy>', ' <style> ' + selectorplusis + '</style> <scr' + "ipt type='text/javascript'> " + scriptplusis + morescr + '</scr' + 'ipt> </bo' + 'dy>');
}
} else { // relative URL src comes here, as well as srcdoc (we have discovered today 23/1/2021)
console.log(1);
var aconto = (iois.contentWindow || iois.contentDocument);
console.log(2);
if (aconto != null) {
console.log(3);
//console.log(aconto);
console.log(4);
if (aconto.document) { aconto = aconto.document; }
console.log(5);
if (selectoris != '') {
console.log(6);
if (selectorplusis != '') {
console.log(7);
aconto.body.innerHTML+=' <style> ' + selectorplusis + '</style> <scr' + "ipt type='text/javascript'> " + scriptplusis + '</scr' + 'ipt> ';
console.log(8);
if (selectorplusis.indexOf(' BORDER') != -1) {
console.log(9);
eles=aconto.querySelectorAll(selectoris);
for (ij=eval(-1 + eles.length); ij>=0; ij--) {
froms.push(eles[ij].outerHTML);
tos.push('<a onclick="alert(this.innerHTML);" style="cursor:pointer;text-decoration:none;" title="Border clickable">' + eles[ij].outerHTML + '</a>');
}
for (ij=0; ij<froms.length; ij++) {
aconto.body.innerHTML=aconto.body.innerHTML.replace(froms[ij], tos[ij]);
}
}
} else {
console.log('a');
eles=aconto.querySelectorAll(selectoris);
console.log('b');
for (ij=0; ij<eles.length; ij++) {
eles[ij].style.border='1px dashed red';
}
}
}
}
}
}
}

function onl(injs) {
if (document.getElementById('myinput')) {
if (document.getElementById('myinput').outerHTML.indexOf('<textarea') != -1) {
var egis=String.fromCharCode(10) + String.fromCharCode(10) + " Example (2xClick) of Einstein Wikipedia Webpage with rounded magenta images and lightblue heading ... " + String.fromCharCode(10) + String.fromCharCode(10) + "http://www.wikipedia.org/wiki/Einstein" + String.fromCharCode(10) + "` img { " + String.fromCharCode(10) + " BORDER-radius:20%; " + String.fromCharCode(10) + " border: 1px dotted magenta; " + String.fromCharCode(10) + " } `" + String.fromCharCode(10) + " function fhlb() {" + String.fromCharCode(10) + " document.getElementById(" + '"' + "firstHeading" + '"' + ").style.backgroundColor=" + '"' + "lightblue" + '"' + "; " + String.fromCharCode(10) + " } " + String.fromCharCode(10) + " setTimeout(fhlb, 2000); " + String.fromCharCode(10);
document.getElementById('myinput').placeholder=document.getElementById('myinput').placeholder.replace(/\|\ /g, String.fromCharCode(10)).replace(' # or ` separate', ' # or ` or first line feed separate').replace(' # or ` and', ' # or ` or first line feed and') + egis;
document.getElementById('myinput').ondblclick = function(event){ ccnt=0; if (event.target.placeholder.indexOf('http') != -1) { event.target.value='http' + event.target.placeholder.split('http')[1]; } };
document.getElementById('myinput').onclick = function(event){ ccnt++; if (ccnt >= 2) { ccnt=0; if (event.target.placeholder.indexOf('http') != -1) { event.target.value='http' + event.target.placeholder.split('http')[1]; } } };
} else {
document.getElementById('myinput').placeholder=document.getElementById('myinput').placeholder.replace(/\|\ /g, '');
}
}
if (injs.trim() != '') {
var tag = document.createElement('script');
tag.type='text/javascript';
tag.src='data:text/javascript;base64,' + btoa(injs);
document.head.appendChild(tag);
}
}
</script>
</head>
<body onload="var okis=true; if (window.parent) { if (!parent.document.getElementById('myinput')) { okis=false; } } if (okis) { document.getElementById('myinput').focus(); } onl(thejs);">
<h1 id=myh1>Testing out document.querySelectorAll</h1>
<h3 id=myh3>RJM Programming - January, 2021</h3>
<textarea rows=20 id=myinput style='width:99%;' title='For URLs suffixes of two blanks refresh and those with four blanks open new window and those with eight blanks opens new popup window. Where your CSS styling or Javascript scripting involves # please use ` as the preferred delimiter.' placeholder="Enter URL | where # or ` separates a CSS selector (or more) | ( eg. About_Us.html#div { BORDER-radius: 50%; } ) | (uppercase border makes it clickable) | that defaults a red dashed border (if just selector) applied to it, | then # or ` and any Javascripting" data-type='text' value='' onblur='showBelow(this);'></textarea>
<div id=ifgoeshere></div>
<input type=text style='position:absolute;left:-200px;top:-200px;' value=''></input>
<div id=divinv style='display:none;'></div>
</body>
</html>