So, I've created a chrome extension which works like tampermonkey except it uses cookies to store the scripts.
Now, to input code for the cookie, I use a keycombo which opens a prompt, via prompt()
. I would like to instead use a custom element to be displayed over a blurred view of the current webpage. I don't want to move any other elements around to do it either.
This is my code so far:
a = String(decodeURIComponent(document.cookie.split("@=")[1].split(";")[0]));
b = new Date().getFullYear(); b = new Date().toGMTString().replace(b, ++b);
c = document.createElement("script"); d = document.head;
a[0] == "@" ? c.src = a.substr(1) : c.innerText = a;
d.insertBefore(c, d.firstChild);
addEventListener("keypress", function (i)
{
if (i.which == 81 && i.shiftKey == true)
{
e = encodeURIComponent(prompt("Usage: Link - @[URL] | Script - [Raw JS]"));
document.cookie = "@=" + e + "; expires=" + b; location.reload();
};
});
Any Ideas?