How to use these

Most of the following JS codes use bookmarklets, which use bookmarks to run the JS code. To use these, follow the instructions below.
Step 1. Make a bookmark. I hope I don't need to tell you how to do this.
Step 2: Edit URL. This is pretty simple. Right click on the bookmark and press "Edit...".
Step 3: Insert Javascript Code. Delete everything in the URL segment, put in " javascript: ", (DON'T FORGET THE COLON) and after that, paste your code.
Now, when you click the button, it should run the JS code.



Website say something

These were originally made at github by bluehalooo.

Make a website say anything

var websitesaysomethingprompt = prompt("What do you want the website to say?");alert(websitesaysomethingprompt);

Make a website say 'hell'

alert("hell");

Make a website ask for your credit card number (this will not be saved anywhere)
var thisdoesn = prompt("Give me your credit card number");

Fun Hacks

Make all images fly around
R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.tan(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.sin(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);

Edit any page
document.body.contentEditable = 'true'; document.designMode='on'; void 0

Web X-ray (better inspect)
javascript:(function () {var script=document.createElement('script');script.src='https://x-ray-goggles.mouse.org/webxray.js';script.className='webxray';script.setAttribute('data-lang','en-US');script.setAttribute('data-baseuri','https://x-ray-goggles.mouse.org');document.body.appendChild(script);}())

Break Your Screen to fix press powerbutton restart.
for (let i = 0; i < 1; i) {location.reload();}

Make the screen flash rainbow because why not?
var rainbow=document.createElement("div");rainbow.style.position="absolute",rainbow.style.top="0",rainbow.style.left="0",rainbow.style.width="100%",rainbow.style.height="100%",rainbow.style.zIndex="9999",rainbow.style.pointerEvents="none",rainbow.style.opacity="0.5",document.body.appendChild(rainbow);var colors=["red","orange","yellow","green","blue","indigo","violet"],i=0;setInterval((function(){rainbow.style.backgroundColor=colors[i],i=(i+1)%colors.length}),100);

Open a tab without history
var site = prompt("What site do you want to go to"); window.open(site, "_blank");

Takes the link you are on, and opens it on an about:blank (locally). Note that most of the time, it will take you to a 404 page.
let self = window; var x = window.open(""); var hello = prompt("Paste the link"); self.close(); x.document.write(" <iframe src= style='position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;'> </iframe>"); //whoah.


Lets any page be in dark mode (function() { var css = 'html {-webkit-filter: invert(100%);' + '-moz-filter: invert(100%);' + '-o-filter: invert(100%);' + '-ms-filter: invert(100%); }', head = document.getElementsByTagName('head')[0], style = document.createElement('style'); if (!window.counter) { window.counter = 1; } else { window.counter++; if (window.counter % 2 == 0) { var css = 'html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }' } } style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); })();