Skip to content
← Back to Community
BOOKMARKLETS!
Profile icon
PYer

What is a bookmarklet?

A bookmarklet is similar to an extension, but is used by clicking a bookmark. According to wikipedia:

A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser. Bookmarklets are unobtrusive JavaScripts stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are usually JavaScript programs. Regardless of whether bookmarklet utilities are stored as bookmarks or hyperlinks, they add one-click functions to a browser or web page. When clicked, a bookmarklet performs one of a wide variety of operations, such as running a search query or extracting data from a table. For example, clicking on a bookmarklet after selecting text on a webpage could run an Internet search on the selected text and display a search engine results page.

Create a bookmarklet

Creating a bookmarklet is easy. (If you do know how to create a bookmark. If not read Creating A Bookmark )

Let's create a simple example:

First, create a bookmark. As for the title of the bookmark, name it “Hello World”. Instead of keeping the url of the page as the bookmark type javascript:alert(‘Hello World!’). There! Click save or whatever it is in your search engine. And click the bookmark. You should have an alert message saying “Hello World!” appear!

To run js in a bookmark, you need to have the javascript: prefix before it. You can only type one line so make sure to use your semicolons! In addition, you can not use double quotes. The search engine saves the bookmark in code that looks something like this:

<a href="javascript:alert(‘Hello World!’)">Hello World</a>

If you use double quotes it looks like:

<a href="javascript:alert(“Hello World!”)”>Hello World</a>

And causes an error. If you have multiple lines, create an anonymous function:
javascript:(function(){ var x=prompt(‘Hi say something:’); alert(‘You said: ’ + x); })()

Notice there are NO double quotes.

Let's go over some examples:

Google Search:
javascript:(function(){window.open('https://www.google.com/search?q='+prompt('Google Search:', '').split(' ').join('+'), '', 'width=800,height=500,left=10,top=10,scrollbar=yes');})();

The above example opens up a new window with a search query of your input! Feel free to copy any of these or the ones listed below.

Calculator:
javascript:(function(){var evl,expr=prompt('Formula...','');with(Math)try{evl=parseFloat(eval(expr));if(isNaN(evl)){throw Error('Not a number!');}prompt('Result of '+expr+':',evl)}catch(evl){alert(evl);}})();

@JSer ‘s Rolling Sky: (Thanks for creating such an awesome game!)
javascript:window.open('https://Rolling-Sky--jser.repl.co', '', 'top=15,left=15,scrollbar=yes,width=500,height=600')

Community Creations

@Zavexeon Faces Generator

uhm... it works.... and is also useless...

javascript: const faces = ['OwO ', 'UwU', 'TwT', '>w<', '^w^']; let face = faces[Math.floor(Math.random()*faces.length)]; document.write('<body style=\'background-color: black;\'></body><title>' + face + '</title><p style=\'text-align: center; font-size: 500px; font-family: Arial; color: white;\'>' + face + '</p>');

@AdCharity Offline Editor

It's kind of a spinoff of my original project, an offline editor that saves with local storage.

javascript:(function() {document.body.innerHTML+='<iframe style=\"width: 25%;border: 3px solid black; z-index: 100000000000; position: fixed; bottom: 0; right: 0; height: 50%;\" src=\"https://offline-editor--adcharity.repl.co/optimized.html\">';})();

@DREWNOLT

Here's one that opens a Google Search for whatever you highlight; If you highlight "google" and click it, it will open the search results for "google"

javascript:function getSelectionText() {var text = '';if (window.getSelection) {text = window.getSelection().toString();} else if (document.selection &&document.selection.type != 'Control') {text = document.selection.createRange().text;}return text;}window.open('//google.com/search?q=' + encodeURIComponent(getSelectionText()))

@techgeek680

Here's a bookmarklet I made

javascript:(function(n,g,q,c,f)%7Bvar s=document,l=s.onclick,h="ws_cmbm-"+f,b=s.getElementById(h),d="ws_cmbms-"+f,p=s.getElementById(d),e=null,o,a=%7Btl:%7Bleft:"10px",top:"10px"%7D,tr:%7Bright:"10px",top:"10px"%7D,bl:%7Bleft:"10px",bottom:"10px"%7D,br:%7Bright:"10px",bottom:"10px"%7D%7D,k,m=".ws_cmbmc%7Bposition:fixed;z-index:10123456;width:200px;display:block;visibility:hidden;border:1px solid #b0b0b0;background:#fff;padding:3px 0 3px 3px;text-align:left;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:2px 2px 3px #777;-moz-box-shadow:2px 2px 3px #777;-webkit-box-shadow:2px 2px 3px #777;%7D.ws_cmbmc a%7Bdisplay:block;float:left;margin:0;width:191px;border:none;padding:8px 0 8px 6px;background:#fff;color:black;text-decoration:none;font:normal normal normal 12px/100%25 Verdana,sans-serif;letter-spacing:normal;word-spacing:normal;%7D.ws_cmbmc a:hover%7Bbackground:#a0a0a0;color:white;border:none;text-decoration:none;font:normal normal normal 12px/100%25 Verdana,sans-serif;letter-spacing:normal;word-spacing:normal;%7D";function r()%7Bb.style.visibility="hidden"%7Dfunction j()%7Bb.style.visibility="visible"%7Dif(b)%7Bif(b.style.visibility=="visible")%7Br()%7Delse%7Bj()%7Dreturn%7Dif(!p)%7Bm=m.replace(/.ws_cmbmc/g,"#"+h);p=s.createElement("style");p.type="text/css";p.id=d;p.appendChild(s.createTextNode(m));s.getElementsByTagName("head")%5B0%5D.appendChild(p)%7Db=s.createElement("div");b.setAttribute("id",h);b.className="ws_cmbmc";for(o=0;o<n.length;o++)%7Be=s.createElement("a");e.appendChild(s.createTextNode(n%5Bo%5D.title));e.setAttribute("href",n%5Bo%5D.url);e.onclick=(function(i)%7Bif(q)%7Br()%7D%7D);b.appendChild(e)%7Ds.getElementsByTagName("body")%5B0%5D.appendChild(b);if(a.hasOwnProperty(g))%7Bfor(k in a%5Bg%5D)%7Bb.style%5Bk%5D=a%5Bg%5D%5Bk%5D%7D%7Delse%7Bif(g=="c")%7Bb.style.left=Math.round((window.innerWidth-b.offsetWidth)/2)+"px";b.style.top=Math.round((window.innerHeight-b.offsetHeight)/2)+"px"%7D%7Dif(c)%7Bs.onclick=(function()%7Br();if(typeof l=="function")%7Bl()%7D%7D);b.onclick=(function(i)%7Bi.stopPropagation()%7D)%7Dj()%7D)(%5B%7Btitle:"Clippable",url:"javascript:(function()%7Bx=document.createElement(%5Cx27SCRIPT%5Cx27);x.type=%5Cx27text/javascript%5Cx27;x.src=%5Cx27http://brettterpstra.com/share/readability.js?x=%5Cx27+(Math.random());document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(x);y=document.createElement(%5Cx27LINK%5Cx27);y.rel=%5Cx27stylesheet%5Cx27;y.href=%5Cx27http://brettterpstra.com/share/readability.css?x=%5Cx27+(Math.random());y.type=%5Cx27text/css%5Cx27;y.media=%5Cx27screen%5Cx27;document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(y);%7D)();"%7D,%7Btitle:"Gmail This",url:"javascript:(function()%7Bpopw=%5Cx27%5Cx27;Q=%5Cx27%5Cx27;d=document;w=window;if(d.selection)%7BQ=d.selection.createRange().text;%7Delse if(w.getSelection)%7BQ=w.getSelection();%7Delse if(d.getSelection)%7BQ=d.getSelection();%7Dpopw=w.open(%5Cx27http://mail.google.com/mail/s?view=cm&fs=1&tf=1&to=&su=%5Cx27+encodeURIComponent(d.title)+%5Cx27&body=%5Cx27+encodeURIComponent(Q)+escape(%5Cx27%255Cn%255Cn%5Cx27)+encodeURIComponent(d.location)+%5Cx27&zx=RANDOMCRAP&shva=1&disablechatbrowsercheck=1&ui=1%5Cx27,%5Cx27gmailForm%5Cx27,%5Cx27scrollbars=yes,width=680,height=575,top=175,left=75,status=no,resizable=yes%5Cx27);if(!d.all)setTimeout(function()%7Bpopw.focus();%7D,50);%7D)();"%7D,%7Btitle:"PageZipper",url:"javascript:(function()%7Bif(window%5B%5Cx27pgzp%5Cx27%5D)%7B_pgzpToggleBookmarklet();%7Delse%7Bwindow._page_zipper_is_bookmarklet=true;window._page_zipper=document.createElement(%5Cx27script%5Cx27);window._page_zipper.type=%5Cx27text/javascript%5Cx27;window._page_zipper.src=%5Cx27//www.printwhatyoulike.com/static/pagezipper/pagezipper_10.js%5Cx27;document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(window._page_zipper);%7D%7D)();"%7D,%7Btitle:"Save pw",url:"javascript:(function()%7Bvar ac,c,f,fa,fe,fea,x,y,z;ac=%5Cx22autocomplete%5Cx22;c=0;f=document.forms;for(x=0;x<f.length;x++)%7Bfa=f%5Bx%5D.attributes;for(y=0;y<fa.length;y++)%7Bif(fa%5By%5D.name.toLowerCase()==ac)%7Bfa%5By%5D.value=%5Cx22on%5Cx22;c++;%7D%7Dfe=f%5Bx%5D.elements;for(y=0;y<fe.length;y++)%7Bfea=fe%5By%5D.attributes;for(z=0;z<fea.length;z++)%7Bif(fea%5Bz%5D.name.toLowerCase()==ac)%7Bfea%5Bz%5D.value=%5Cx22on%5Cx22;c++;%7D%7D%7D%7Dalert(%5Cx22Enabled %5Cx27%5Cx22+ac+%5Cx22%5Cx27 on %5Cx22+c+%5Cx22 objects.%5Cx22);%7D)();"%7D,%7Btitle:"Writing",url:"javascript:(function() %7Bdocument.body.innerHTML+=%5Cx27<iframe style=%5C%5C%5Cx22width: 25%25;border: 3px solid black; z-index: 100000000000; position: fixed; bottom: 0; right: 0; height: 50%25;%5C%5C%5Cx22 src=%5C%5C%5Cx22https://offline-editor--adcharity.repl.co/optimized.html%5C%5C%5Cx22>%5Cx27;%7D)();"%7D,%7Btitle:"techgeek680",url:"javascript:window.open(%5Cx27https://techgeek680.techgeek680.repl.co%5Cx27, %5Cx27%5Cx27, %5Cx27top=15,left=15,scrollbar=yes,width=500,height=600%5Cx27)"%7D,%7Btitle:"Edit",url:"http://w-shadow.com/bookmarklet-combiner/?bookmarklet=40388"%7D%5D,"tl",true,true,1591719183687)

** Thank you for reading! Please upvote and comment your own bookmarklets, to be added to the community creations section! I hope I get a content creator tag for this 😀 **

Voters
Profile icon
GalenKoenig-Hir
Profile icon
NoahNinja100Noa
Profile icon
Crowst
Profile icon
frostedbutton75
Profile icon
CorranTheIronMi
Profile icon
DREWNOLT
Profile icon
EpicGamer007
Profile icon
DrewCarrillo
Profile icon
CoolJames1610
Profile icon
DamienKilduff
Comments
hotnewtop
Profile icon
ebest

Can you add pictures? I can't figure it out.

Also, how do you get a content creator tag?

Profile icon
PYer

@ebest I can add pictures! You get the content creator tag by posting a good tutorial.

Profile icon
ebest

@PYer Oh.
I have some other questions: https://repl.it/talk/ask/A-lot-of-things/14456
Can you help answer?

Profile icon
PYer

@ebest k. I cant figure out how to add screenshots can you help me?

Profile icon
ebest

@PYer What's your're computer type? Take a screenshot then go to your files and drag and drop. I can't help you any more then that without knowing the type of computer you're using.
This file cannot be displayed: https://storage.googleapis.com/replit/images/1557361984244_38c19070539a931d5b844c2ef05d8f10.pn

HAHA There. Evidence it's possible

Profile icon
PYer

@ebest ill do it tommorrow when i have more time

Profile icon
PYer

@ebest do you know how to create a bookmark?

Profile icon
ebest

@PYer yes.

Profile icon
PYer

@ebest create one

Profile icon
ebest

@PYer done

Profile icon
PYer

@ebest edit it and copy paste javascript:alert('Hello World') as the url

Profile icon
ebest

@PYer OHHHHHH. Thanks!!

Profile icon
PYer

@ebest no problem!

Profile icon
mat1

Lol I actually made a custom thing like that a while ago https://bookmarks.matdoes.dev/

Profile icon
PYer

@mat1 did you share it with anybody?

Profile icon
katyadee

@PYer It's not about being first. It's about being best. 😛

Profile icon
PYer

@katyadee i dont want him to get angry for copying though

Profile icon
katyadee

@PYer The market can decide which one's the best!

Profile icon
mat1

@PYer Nah man it's fine it's not an original idea and lots of people have done it before me. Also, I only ever shared it with friends.

Profile icon
PYer
Profile icon
Pythonier

Cool! I didn't know you could do that!

Profile icon
PYer

@Pythonier thanks

Profile icon
MoonFaygo

Here Is One That Will Open A Script Prompt When Clicked On

javascript:function JSexe(){ if(valJS!='null' && valJS!='undefined')strJS=valJS; strJS=prompt('Hello Irwin What Command Would You Like To Run Today?%27,strJS); if(strJS!=null && strJS!=%27%27 && strJS!=%27undefined%27){ setTimeout(%27valJS=%27%27+eval(strJS);JSexe()%27,10); } else{valJS=%27%27;strJS=%27%27;}}valJS=%27%27;strJS=%27%27;JSexe();

Profile icon
NigelIsCoding

This is THE BEST javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//mrdoob.github.io/stats.js/build/stats.min.js';document.head.appendChild(script);})()

Profile icon
NigelIsCoding

R U like JSer but PYer

Profile icon
DREWNOLT

THE BEST THING EVER: AN AD BLOCKER

javascript:var browser = document.getElementsByTagName('iframe'); var src = document.getElementsByTagName('img'); var obj = document.getElementsByTagName('object'); if(browser.length > obj.length){var length = browser.length}else if(obj.length > src.length){var length = obj.length}else{var length = src.length} var i = 0; while(i<length){browser[i].remove();obj[i].remove(); src[i].remove(); i++;}
Profile icon
DREWNOLT

Here's one that opens a Google Search for whatever you highlight; If you highlight "google" and click it, it will open the search results for "google".

javascript:function getSelectionText() {var text = '';if (window.getSelection) {text = window.getSelection().toString();} else if (document.selection &&document.selection.type != 'Control') {text = document.selection.createRange().text;}return text;}window.open('//google.com/search?q=' + encodeURIComponent(getSelectionText()))
Profile icon
PYer

cool i added it to the list! really handy! @DREWNOLT

Profile icon
DREWNOLT

Thanks! :D @PYer

Profile icon
DREWNOLT

DON'T BOOKMARK THIS: javascript:(function(){while(true){window.open("https://about:blank");}});

Profile icon
PYer
Profile icon
techgeek680

Hiya! Here's a bookmarklet I made: javascript:(function(n,g,q,c,f)%7Bvar s=document,l=s.onclick,h="ws_cmbm-"+f,b=s.getElementById(h),d="ws_cmbms-"+f,p=s.getElementById(d),e=null,o,a=%7Btl:%7Bleft:"10px",top:"10px"%7D,tr:%7Bright:"10px",top:"10px"%7D,bl:%7Bleft:"10px",bottom:"10px"%7D,br:%7Bright:"10px",bottom:"10px"%7D%7D,k,m=".ws_cmbmc%7Bposition:fixed;z-index:10123456;width:200px;display:block;visibility:hidden;border:1px solid #b0b0b0;background:#fff;padding:3px 0 3px 3px;text-align:left;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:2px 2px 3px #777;-moz-box-shadow:2px 2px 3px #777;-webkit-box-shadow:2px 2px 3px #777;%7D.ws_cmbmc a%7Bdisplay:block;float:left;margin:0;width:191px;border:none;padding:8px 0 8px 6px;background:#fff;color:black;text-decoration:none;font:normal normal normal 12px/100%25 Verdana,sans-serif;letter-spacing:normal;word-spacing:normal;%7D.ws_cmbmc a:hover%7Bbackground:#a0a0a0;color:white;border:none;text-decoration:none;font:normal normal normal 12px/100%25 Verdana,sans-serif;letter-spacing:normal;word-spacing:normal;%7D";function r()%7Bb.style.visibility="hidden"%7Dfunction j()%7Bb.style.visibility="visible"%7Dif(b)%7Bif(b.style.visibility=="visible")%7Br()%7Delse%7Bj()%7Dreturn%7Dif(!p)%7Bm=m.replace(/.ws_cmbmc/g,"#"+h);p=s.createElement("style");p.type="text/css";p.id=d;p.appendChild(s.createTextNode(m));s.getElementsByTagName("head")%5B0%5D.appendChild(p)%7Db=s.createElement("div");b.setAttribute("id",h);b.className="ws_cmbmc";for(o=0;o<n.length;o++)%7Be=s.createElement("a");e.appendChild(s.createTextNode(n%5Bo%5D.title));e.setAttribute("href",n%5Bo%5D.url);e.onclick=(function(i)%7Bif(q)%7Br()%7D%7D);b.appendChild(e)%7Ds.getElementsByTagName("body")%5B0%5D.appendChild(b);if(a.hasOwnProperty(g))%7Bfor(k in a%5Bg%5D)%7Bb.style%5Bk%5D=a%5Bg%5D%5Bk%5D%7D%7Delse%7Bif(g=="c")%7Bb.style.left=Math.round((window.innerWidth-b.offsetWidth)/2)+"px";b.style.top=Math.round((window.innerHeight-b.offsetHeight)/2)+"px"%7D%7Dif(c)%7Bs.onclick=(function()%7Br();if(typeof l=="function")%7Bl()%7D%7D);b.onclick=(function(i)%7Bi.stopPropagation()%7D)%7Dj()%7D)(%5B%7Btitle:"Clippable",url:"javascript:(function()%7Bx=document.createElement(%5Cx27SCRIPT%5Cx27);x.type=%5Cx27text/javascript%5Cx27;x.src=%5Cx27http://brettterpstra.com/share/readability.js?x=%5Cx27+(Math.random());document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(x);y=document.createElement(%5Cx27LINK%5Cx27);y.rel=%5Cx27stylesheet%5Cx27;y.href=%5Cx27http://brettterpstra.com/share/readability.css?x=%5Cx27+(Math.random());y.type=%5Cx27text/css%5Cx27;y.media=%5Cx27screen%5Cx27;document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(y);%7D)();"%7D,%7Btitle:"Gmail This",url:"javascript:(function()%7Bpopw=%5Cx27%5Cx27;Q=%5Cx27%5Cx27;d=document;w=window;if(d.selection)%7BQ=d.selection.createRange().text;%7Delse if(w.getSelection)%7BQ=w.getSelection();%7Delse if(d.getSelection)%7BQ=d.getSelection();%7Dpopw=w.open(%5Cx27http://mail.google.com/mail/s?view=cm&fs=1&tf=1&to=&su=%5Cx27+encodeURIComponent(d.title)+%5Cx27&body=%5Cx27+encodeURIComponent(Q)+escape(%5Cx27%255Cn%255Cn%5Cx27)+encodeURIComponent(d.location)+%5Cx27&zx=RANDOMCRAP&shva=1&disablechatbrowsercheck=1&ui=1%5Cx27,%5Cx27gmailForm%5Cx27,%5Cx27scrollbars=yes,width=680,height=575,top=175,left=75,status=no,resizable=yes%5Cx27);if(!d.all)setTimeout(function()%7Bpopw.focus();%7D,50);%7D)();"%7D,%7Btitle:"PageZipper",url:"javascript:(function()%7Bif(window%5B%5Cx27pgzp%5Cx27%5D)%7B_pgzpToggleBookmarklet();%7Delse%7Bwindow._page_zipper_is_bookmarklet=true;window._page_zipper=document.createElement(%5Cx27script%5Cx27);window._page_zipper.type=%5Cx27text/javascript%5Cx27;window._page_zipper.src=%5Cx27//www.printwhatyoulike.com/static/pagezipper/pagezipper_10.js%5Cx27;document.getElementsByTagName(%5Cx27head%5Cx27)%5B0%5D.appendChild(window._page_zipper);%7D%7D)();"%7D,%7Btitle:"Save pw",url:"javascript:(function()%7Bvar ac,c,f,fa,fe,fea,x,y,z;ac=%5Cx22autocomplete%5Cx22;c=0;f=document.forms;for(x=0;x<f.length;x++)%7Bfa=f%5Bx%5D.attributes;for(y=0;y<fa.length;y++)%7Bif(fa%5By%5D.name.toLowerCase()==ac)%7Bfa%5By%5D.value=%5Cx22on%5Cx22;c++;%7D%7Dfe=f%5Bx%5D.elements;for(y=0;y<fe.length;y++)%7Bfea=fe%5By%5D.attributes;for(z=0;z<fea.length;z++)%7Bif(fea%5Bz%5D.name.toLowerCase()==ac)%7Bfea%5Bz%5D.value=%5Cx22on%5Cx22;c++;%7D%7D%7D%7Dalert(%5Cx22Enabled %5Cx27%5Cx22+ac+%5Cx22%5Cx27 on %5Cx22+c+%5Cx22 objects.%5Cx22);%7D)();"%7D,%7Btitle:"Writing",url:"javascript:(function() %7Bdocument.body.innerHTML+=%5Cx27<iframe style=%5C%5C%5Cx22width: 25%25;border: 3px solid black; z-index: 100000000000; position: fixed; bottom: 0; right: 0; height: 50%25;%5C%5C%5Cx22 src=%5C%5C%5Cx22https://offline-editor--adcharity.repl.co/optimized.html%5C%5C%5Cx22>%5Cx27;%7D)();"%7D,%7Btitle:"techgeek680",url:"javascript:window.open(%5Cx27https://techgeek680.techgeek680.repl.co%5Cx27, %5Cx27%5Cx27, %5Cx27top=15,left=15,scrollbar=yes,width=500,height=600%5Cx27)"%7D,%7Btitle:"Edit",url:"http://w-shadow.com/bookmarklet-combiner/?bookmarklet=40388"%7D%5D,"tl",true,true,1591719183687)

Profile icon
PYer

Wow! Very nice! I'm adding it do the tutorial! @techgeek680

Profile icon
techgeek680

thanks! @PYer

Profile icon
PYer
Profile icon
techgeek680

it is so long XD @PYer

Profile icon
PYer

Yeah, but it's a good one. @techgeek680

Profile icon
techgeek680

thank you! @PYer

Profile icon
techgeek680

does this NOT work for Chrome OS?

Profile icon
techgeek680

does this NOT work for Chrome OS?

Profile icon
PYer

Really? I'm on a Chrome OS rn. @techgeek680 Any specific error?

Profile icon
techgeek680

They don't work when I click them. @PYer

Profile icon
PYer

hmmmm... can you give me the text stored in the URL for the bookmark? @techgeek680

Profile icon
techgeek680

I was using the Faces Generator @PYer

Profile icon
PYer

hmmm... that was made by somebody else, so I don't know if it works. I'll check it right now. @techgeek680

Profile icon
PYer

OK. The bookmarklet should work. Where did you past the code for it? @techgeek680

Profile icon
techgeek680

thanks. I googled bookmarklets and found a working 'Gmail This' bookmarklet and another. they both worked. @PYer

Profile icon
techgeek680

in bookmarks @PYer

Profile icon
PYer

that's great! @techgeek680

Profile icon
techgeek680

:) should i try again? @PYer
what does it do?

Profile icon
PYer

The Faces generator essentially replaces the page with a face made of characters, ex UwU. Make sure to paste the code into the URL field and not the title of the bookmarklet. @techgeek680

Profile icon
techgeek680

okay. wait- now it works!!! Thanks PYer! @PYer

Profile icon
PYer
Profile icon
techgeek680
Profile icon
AmazingMech2418

Nice! Though, you don't need an anonymous function. Also, in some cases, you'll need to embed a script tag since not all functions will run as a bookmarklet natively (for example, DOM is extremely limited in bookmarklets).

Profile icon
PYer

hmmm... interesting. I like the anonymous function because it keeps it clean. I hadn't thought about the script tag though. thanks for the feedback. @AmazingMech2418

Profile icon
AmazingMech2418

@PYer You're welcome! I've been working with bookmarklets for a while and the script tag, while not always necessary, is sometimes needed.

Profile icon
AdCharity

I like the tutorial! Here's one of my creations:
javascript:(function() {document.body.innerHTML+='<iframe style="width: 25%;border: 3px solid black; z-index: 100000000000; position: fixed; bottom: 0; right: 0; height: 50%;" src="https://offline-editor--adcharity.repl.co/optimized.html\">';})();
Unfortunately, since it adds an iframe to the page, it can interfere with overall page interaction, so I also made one that just opens up a small window.
It's kind of a spinoff of my original project, an offline editor that saves with local storage.

Profile icon
Zavexeon

Lol I made a bookmarklit... uhm... it works.... and is also useless...

javascript: const faces = ['OwO ', 'UwU', 'TwT', '>w<', '^w^']; let face = faces[Math.floor(Math.random()*faces.length)]; document.write('<body style=\'background-color: black;\'></body><title>' + face + '</title><p style=\'text-align: center; font-size: 500px; font-family: Arial; color: white;\'>' + face + '</p>');
Profile icon
PYer
Profile icon
PYer

@Zavexeon I added a community creations one and put yours on.

Profile icon
mkhoi

Cool! But i dont use js that well

Profile icon
PYer

@mkhoi you only need to know a few functions. the most common being window.open()