Puts an iframe with Eclipse Emulator on your current page in a small corner with a close button
Code:
javascript:
((function()%7Bvar a,b,c;
c="https://eclipseemu.me/play",
b=document.createElement("iframe"),
b.setAttribute("src",c),
b.setAttribute("id","eclipse"),
b.setAttribute("style","width: 30%; height: 30%; right:0px; bottom:0px; border:none; position:fixed;z-index:20; overflow:hidden;"),
b.setAttribute("mozallowfullscreen","true"),
b.setAttribute("allow","autoplay,autoplay; fullscreen *; geolocation; microphone; camera; midi; monetization; xr-spatial-tracking; gamepad; gyroscope; accelerometer; xr"),
b.setAttribute("frameborder","0"),
b.setAttribute("msallowfullscreen","true"),
b.setAttribute("scrolling","yes"),
b.setAttribute("allowfullscreen","true"),
b.setAttribute("webkitallowfullscreen","true"),
b.setAttribute("allowtransparency","true"),
a=document.getElementsByTagName("body")%5B0%5D,
a.appendChild(b)%7D)).call(this);
var btn=document.createElement("button");
document.body.appendChild(btn);
btn.innerHTML="Close";
btn.setAttribute("style","position:absolute;right:0px;bottom:200px;");
btn.onclick=function()
{
document.getElementById("eclipse").parentNode.removeChild(document.getElementById("eclipse"));
btn.setAttribute("id","btn1");
document.getElementById("btn1").parentNode.removeChild(document.getElementById("btn1"));
};
document.onkeydown=function(evt)
{
evt=evt||window.event;
var closekey=false;
if("key" in evt)
{
closekey=(evt.key === "Escape"||evt.key==="Esc");
}
else
{
closekey=(evt.keycode === 27);
}
if(closekey)
{
document.getElementById("eclipse").parentNode.removeChild(document.getElementById("eclipse"));
btn.setAttribute("id","btn1");
document.getElementById("btn1").parentNode.removeChild(document.getElementById("btn1"));
}
};
Bookmarklet:
javascript:((function()%7Bvar a,b,c;c="https://eclipseemu.me/play",b=document.createElement("iframe"),b.setAttribute("src",c),b.setAttribute("id","eclipse"),b.setAttribute("style","width: 30%; height: 30%; right:0px; bottom:0px; border:none; position:fixed;z-index:20; overflow:hidden;"),b.setAttribute("mozallowfullscreen","true"),b.setAttribute("allow","autoplay,autoplay; fullscreen *; geolocation; microphone; camera; midi; monetization; xr-spatial-tracking; gamepad; gyroscope; accelerometer; xr"),b.setAttribute("frameborder","0"),b.setAttribute("msallowfullscreen","true"),b.setAttribute("scrolling","yes"),b.setAttribute("allowfullscreen","true"),b.setAttribute("webkitallowfullscreen","true"),b.setAttribute("allowtransparency","true"),a=document.getElementsByTagName("body")%5B0%5D,a.appendChild(b)%7D)).call(this);var btn=document.createElement("button");document.body.appendChild(btn);btn.innerHTML="Close";btn.setAttribute("style","position:absolute;right:0px;bottom:200px;");btn.onclick=function(){document.getElementById("eclipse").parentNode.removeChild(document.getElementById("eclipse"));btn.setAttribute("id","btn1");document.getElementById("btn1").parentNode.removeChild(document.getElementById("btn1"));};document.onkeydown=function(evt){evt=evt||window.event;var closekey=false;if("key" in evt){closekey=(evt.key === "Escape"||evt.key==="Esc");} else { closekey=(evt.keycode === 27);} if(closekey) {document.getElementById("eclipse").parentNode.removeChild(document.getElementById("eclipse"));btn.setAttribute("id","btn1");document.getElementById("btn1").parentNode.removeChild(document.getElementById("btn1"));}};
to press escape to close you have to click out of it first idk why