Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ifpass 1.7.1 by Golden. Paste into a bookmark to use. Have fun! I am not liable for any consequences of you misusing this code. You are allowed to modify this code as long as I am credited as the original creator. */
- var version = "ifpass 1.7.1 by Golden";
- var scriptString = `
- var homePage = "https://web.archive.org";
- var version = "` + version + `";
- var news = "NEW:\\n - Bookmarks!\\n - Type javascript:ifpass(\\"https://web.archive.org\\"); into a bookmark\\n and click it while ifpass is loaded!\\n - You can now use Enter to submit URLs!";
- var features = "Features:\\n - Doesn't save to search history.\\n - Works in Firefox and Chrome.\\n - Includes fully functional home button.\\n - Reload to reset page.";
- var todo = "TODO:\\n - A way to save the home URL.\\n - Display errors when websites don't support iframes.";
- var help = ()=> {
- alert(version + "\\n" + news + "\\n" + features + "\\n" + todo);
- };
- var getHomepage = () => {
- return homePage;
- };
- var setHomepage = ()=> {
- homePage = prompt("Homepage?\\n(Cancel to reset to default.)", homePage);
- if (!homePage) {
- homePage = "https://web.archive.org";
- }
- };
- var goto = (page) => {
- loadedPage.src = page;
- };
- var ifpass = goto;`;
- document.body.innerHTML = ``;
- var style = document.createElement("style");
- style.innerHTML = `
- element {
- border: 0;
- margin: 0;
- font-size:100%;
- line-height:1;
- font-family: "tahoma"
- }
- body {
- border: 0;
- margin: 0;
- }
- `;
- document.body.appendChild(style);
- var script = document.createElement("script");
- script.innerHTML = scriptString;
- document.body.appendChild(script);
- document.body.innerHTML += `
- <div align="center">
- <button onclick="help();" >?</button>
- | <button onclick="setHomepage();" >Change</button>
- <button onclick="loadedPage.src = homePage;" >⌂</button>
- | <input type="text" id="textBox" style="width: 40%" value="https://web.archive.org" ></input>
- <button onclick="goto(textBox.value);" >Go!</button>
- | <button onclick="loadedPage.src += '';" >↻</button>
- </div>
- <iframe id="loadedPage" onload="textBox.value = loadedPage.src" frameBorder="0" ` +
- `sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-same-origin allow-scripts" ` +
- `src="https://web.archive.org" width=100% height=96.5%>Your browser does not support ifpass, which uses IFrames. Please upgrade your browser.</iframe>
- <noscript>Your browser does not support ifpass, which uses Javascript scripts. Please enable scripts.</noscript>
- `;
- var node = document.getElementsByTagName("input")[0];
- node.addEventListener("keyup", function(event) {
- if (event.key === "Enter") {
- goto(textBox.value);
- }
- });
- console.log(version + ". Pastebin: https://pastebin.com/ayGirY13");
Add Comment
Please, Sign In to add comment