11 ms·
Wait, what's a bookmarklet?
- olejorgenb 3y agoVery quick and dirty bookmarklet to highlight the author name in a HN discussion: https://bookmarkl.ink/olejorgenb/ca230bdeb87bb5bc69a8bae3e7d604b5 https://bookmarkl.ink/olejorgenb/ca230bdeb87bb5bc69a8bae3e7d...
- davchana 3y agoAhh Bookmarklets.. my first love.. Long time ago in about era of 2004-2010 I only knew about html & php. In about 2011 I found the javascript. Next year I found the bookmarklets. My first Bookmarklet: When is my next payday? My job used to pay salary monthly, on second last working day of month (Sun to Thu was working week). I eagerly used to count the days remaining for next payday. I realized that Javascript can do this for me. PayDay was born. I still have the code at https://gitlab.com/davchana/payday/-/blob/beta/payday_v1_01_readable.js https://gitlab.com/davchana/payday/-/blob/beta/payday_v1_01_... Coincidently this was my first project on Gitlab. Then, Google Chrome used to remember passwords, but there was no password manager inbuilt to view passwords. I found this View Passwords code at https://ostermiller.org/bookmarklets/viewpass.js https://ostermiller.org/bookmarklets/viewpass.js & minified it & have been using it since last 12 years, in a mobile with ViewPasswords name. The only change I did was making the div containing found passwords contenteditable to make it easy to copy. I have been using it since 2012. Somewhere in between these years I lost the original code but I came across it again in 2023. I also made my own version of fancy view passwords, code at https://gitlab.com/davch/bookmarklets/-/blob/master/viewPasswords.md https://gitlab.com/davch/bookmarklets/-/blob/master/viewPass... but I tend to use the original one more often. One of the proudest bookmarklet is CAJobAppsGSV2 (California Job Apps Google Apps Script v2). CA has a standard way of applying for government jobs, where you create templates per position title & then apply it by going through 5 or 6 pages. This BM looks at the address, a switch fires up the function, that function choses the correct dropdown values & clicks appropriate buttons & also saves some data in SessionStorage. After the confirmation it adds a div to the box, which on clicked upon closes itself. The BM prepares data from storage & page, & fires up a POST request to Google Apps Web Script, which saves it as a line item to a sheet. While doing this, it logs the statuses to the div. I use BMs for fixing up the print layout of TripCase Tickets, to fetch & get data on clipborad about my paystub, quickshortcuts to data at who.is & xe.com.
- lloydatkinson 3y agoI wonder if people use them very often today. Anyway, https://github.com/marcobiedermann/awesome-bookmarklets https://github.com/marcobiedermann/awesome-bookmarklets
- gxs 3y agoNothing fancy, or special, but I use them so that I don’t have go to a site first and then search. Over the years I’ve built one up that recognizes various record ID formats or other record numbers and automatically takes you to that record or forwards you to the site if you paste the entire url. It has a few other keyword shortcuts to save on monotonous clicks. Nowadays with slack and people being a bit web savvier in general it’s not as useful as it once was, but you’d be surprised how annoying it is to enter jira ticket ids over and over.
- deleted 3y ago[deleted]
- teddyh 3y agoMissing: • http://kathack.com/ http://kathack.com/ • https://kay-is.github.io/undefined-gooselet/ https://kay-is.github.io/undefined-gooselet/
- gregsadetsky 3y agoah, kathack is amazing but doesn't work on https sites since it loads a script from an http server. and is broken by CSP too... a real shame. it's really beautiful!
- karaterobot 3y agoAt a previous company, we got to the point where we were considering making a Chrome extension to support an out-of-band workflow for our app. I, being in my 40s, suggested the prototype could just be a bookmarklet. All the younger devs were like "what's a bookmockler?" and I felt very old. Almost as old as when I started singing The Wreck of the Edmund Fitzgerald when asked if I could name all the Great Lakes.
- deleted 3y ago[deleted]
- ics 3y agoThey're so simple that it's hard to believe they just work. I'm almost surprised that browser vendors haven't pushed the functionality out of existence just because, in favor of ever more complicated solutions. Similarly, while prototyping an internal company wiki I made bookmarklets to fix some Sharepoint shenanigans and add features that otherwise would've required mucking about with extensions (tough when half the company was forced to use IE) or even worse, Sharepoint apps. The entire IT staff had a major WTF moment after explaining just how simple the whole thing was.
- fiddlerwoaroof 3y agoThe annoying thing to me is that browsers often enforce CSP on bookmarklets and so they have started being less reliable. Firefox fixed this in a limited way: https://bugzilla.mozilla.org/show_bug.cgi?id=1478037 https://bugzilla.mozilla.org/show_bug.cgi?id=1478037 but other browsers don’t care or won’t
- yawaramin 3y agoI'm told Opera doesn't support bookmarklets. I made one to collapse all comments in a BitBucket PR page (just find each comment and nest it inside a <details> tag, with a <summary> containing the first line of the comment). It's widely used in PRs that deal with Atlantis/Terraform, because Atlantis leaves huge comments on PRs.
- alexpotato 3y ago
- dvh 3y agoIt would be great if snippets could be used in bookmarklets. Instead of: javascript:some_code You would write: snippet:name Snippets are much easier to write because snippets are edited in normal multiline editor with console and stuff.
- digging 3y ago> Snippets are much easier to write because snippets are edited in normal multiline editor with console and stuff. Most of my bookmarklets are specific to work projects and I save them in the repo itself in a top-level bookmarklets.js file so I can use VSCode to edit them. (Then I just copy and paste them into the browser bookmark.)
- SushiHippie 3y agohttps://bugzilla.mozilla.org/show_bug.cgi?id=1315549 https://bugzilla.mozilla.org/show_bug.cgi?id=1315549 Mhm, snippets seem to be chrome only
- gabrielsroka 3y agoI use snippets all the time. When I'm ready to make a bookmarklet, I just add javascript: to the front and then drag them to my toolbar.
- uoaei 3y agoThe only bookmarklet I use regularly is SciHubIfy: javascript:location.href="https://sci-hub.se/"+location.href;
- laughy 3y agoThe one I use is slightly more advanced, can't copy it for some strange reason, but I use a service that checks for a valid domain first
- egorpv 3y agoSame, but my version uses a different approach. It takes the selected (or entered via prompt) text, strip spaces and opens the sci-hub in a separate tab. javascript: Qr = window.getSelection ? window.getSelection().toString() : document.selection.createRange().text; if (Qr) { void(window.open('https://sci-hub.se/' + String(Qr).replace(/^\s+|\s+$/g, ''))); } else { void(Qr = prompt('Enter URL/DOI to sci-hub it', '')); location.href = 'https://sci-hub.se/' + String(Qr).replace(/^\s+|\s+$/g, ''); }
- a_c 3y agoMy favourites Speed up video/audio on youtube javascript:(function() { (document.querySelector('video') || document.querySelector('audio')).playbackRate = (+prompt('How many times normal speed?') || 1); })(); Bypass paywall javascript:location.href='https://archive.is/?run=1&url=%27+encodeURIComponent(document.location.href)
- Yujf 3y agoI use an extension that lets me quickly jump to bookmarks and have a bunch of yt speed bookmarklets (named 1.25x, 1x, 2x etc) and it is so nice to quickly change playback speed with the keyboard
- swyx 3y agojust use video speed controller https://chrome.google.com/webstore/detail/video-speed-controller/nffaoalbilbmmfgbnbgppjihopabppdk https://chrome.google.com/webstore/detail/video-speed-contro...
- baal80spam 3y agoI've used this extension for several years now. I honestly can't imagine browsing without it.
- celadin 3y agoIf it ever goes away and the same functionality isn't easily reproducible... a dark, terrible day.
- darekkay 3y agoMy most used bookmarklet is one to call "debugger" after a short timeout to debug dynamic elements that would otherwise disappear as soon as I try to inspect them. https://darekkay.com/blog/debugging-dynamic-content/ https://darekkay.com/blog/debugging-dynamic-content/
- Khoth 3y agoI use one to get rid of fixed headers on a page javascript:(function()%20{%20var%20s,e,i,ee=document.getElementsByTagName('*');%20for(i=0;%20e=ee[i];%20i++)%20{%20s=getComputedStyle(e);%20if%20(s%20&&%20s.position%20==%20'fixed')%20e.style.position='static';%20}%20})();
- williamdclt 3y agoI use that all the time (to get rid of any fixed element, incl footers and floating sidebars)
- colinprince 3y agoya, same, I don't know where I got this one but I modified it to include sticky javascript:var ni%3Ddocument.createNodeIterator(document.documentElement,NodeFilter.SHOW_ELEMENT,function(node)%7Breturn document.defaultView.getComputedStyle(node,null).getPropertyValue("position").match(/sticky|fixed/) %3F NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT%3B%7D)%3Bwhile(currentNode%3Dni.nextNode())%7Bconsole.log(currentNode.remove())%3B%7D
- dmlerner 3y agoCan't live without this. The 10% of the time it doesn't work makes me sad. Super useful from cVim/Vimmium etc, I keep it mapped to 'gh'
- Brajeshwar 3y agoThe Mouseover DOM Inspector from the early 00s was an awesome dev tool. http://slayeroffice.com/?c=/content/tools/modi.html http://slayeroffice.com/?c=/content/tools/modi.html
- alexcaza 3y agoI haven't used them heavily, but when I was doing user-research for a small startup, I needed to get timestamped links from Google Drive videos to add to interview notes. It was a huge pain in the ass. So I wrote a little bookmarklet to copy the URL with timestamp to clipboard.
- rav 3y agoThree bookmarklets I made for my bookmarks toolbar: "Don't mess with paste" - for when signup forms expect you to hand-type your email address twice. javascript:void ["contextmenu","copy","paste","selectstart"].map(e=>document.addEventListener(e,e=>e.stopPropagation(),true)) "Nebula no-alt-#" - Nebula's video viewer annoying captures e.g. alt-3 to do the same as plain 3 (seek to 3/10 of the video currently playing), but I expect it to switch to the 3rd browser tab instead. YouTube doesn't do this. Luckily I can just activate this bookmarklet: javascript:void document.addEventListener("keydown",(e)=>void(e.altKey&&!isNaN(+e.key)&&e.stopPropagation())) "canvas DL" - when playing skribbl.io and someone has made a nice drawing, this lets you download the current drawing as a PNG. javascript:var w=window.wdq||(window.wdq=document.createElement("a"));var p=/The word was '([^']*)'/g,pp=/<span>([^<>]+) is drawing now!/g,tt=document.body.innerHTML;var mm,nn,xx;while(mm=p.exec(tt))nn=mm;while(mm=pp.exec(tt))xx=mm;w.download=location.host+"_"+(nn?nn[1]+"_":"")+(xx?xx[1]+"_":"")+new Date().toISOString().replace(/:/g,"_");w.href=document.querySelector("canvas").toDataURL();w.click();
- tonetheman 3y agoOh that first one... that is sweet.
- rtkwe 3y agoFor things you need to always run Grease Monkey seems like a prime choice. You could have your script run automatically for every visit to a nebula page.
- sbierwagen 3y agoBy default Greasemonkey can access all data on all pages. With extensions being routinely compromised to steal crypto that’s starting to look like a bad deal. (If you limit it to a single domain in Chrome it will nag you to unlock it on Chrome startup forever)
- wodenokoto 3y agoI am weirdly more afraid of installing chrome extensions than executables on my machine
- o11c 3y agoOne of the first bookmarklets I made was a simple one that just went up one directory. It worked gloriously for a year or two, and then the internet decided to stop using structure and broke everything.
- kevlened 3y agoBookmarklets are great in mobile browsers. This is handy if you want to avoid writing an extension for a simple script. I often use a bookmarklet I wrote to remove the extra content from online recipes: https://github.com/kevlened/foodmarklet https://github.com/kevlened/foodmarklet It’s based on https://github.com/poundifdef/plainoldrecipe https://github.com/poundifdef/plainoldrecipe, but it works entirely in the client.
- jtbayly 3y agoAgreed. I have one I use on my iPhone that shows page source. Comes in handy sometimes. javascript:(function()%7Bvar%20a=window.open('about:blank').document;a.write('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20'+location.href+'%3C/title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20/%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E');a.close();var%20b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode(document.documentElement.innerHTML))%7D)();
- lgats 3y agothis is awesome! I've added the page title to the source: javascript:!function(){var e=window.open("","_blank");e.document.write("<!DOCTYPE html><html><head><title>Source of "+location.href+"</title><meta name='viewport' content='width=device-width, initial-scale=1.0'></head><body><pre></pre></body></html>"),e.document.body.querySelector("pre").textContent=document.documentElement.outerHTML,e.document.close()}();
- raspo 3y agoRecipe websites are some of the worst things on the web these days, with autoplaying videos, ads, newsletter box, cookie notice, while the actual recipe is buried down after a bunch of useless preamble... I tested this foodmarklet in a few places and so far it seems to work amazingly. Thank you for sharing!
- bloopernova 3y agoKagi.com, a $10/month search engine, has "lenses" that "focus" your search. One of the lenses is "recipe sites that are high quality and don't have loads of useless crap"
- shmerl 3y agoHere is one of the few I use: Rotate images 90° clockwise: javascript:(()=>{var imgs = document.getElementsByTagName("img");for (var img of imgs){img.setAttribute("style","transform:rotate(90deg);");}})();
- gabrielsroka 3y agoThis one is a little shorter. javascript:document.querySelectorAll('img').forEach(img => img.setAttribute('style','transform:rotate(90deg);'))
- williamdclt 3y agoMake webpage fullscreen: `javascript:(()=>{b=document.createElement("button");b.onclick=()=>{document.documentElement.requestFullscreen();b.remove()};b.style="all:reset;position:fixed;z-index:9999;left:0%;top:0%;width:100%;height:100%;background-color:lightpink";b.innerText="Full Screen";document.body.appendChild(b)})()` It pops up a giant red button, as user interaction is required for fullscreen
- gwern 3y ago> As those browsers rose in market share, extensions began to overtake bookmarklets in popularity. The Bookmarks bar faded to the background more. Bookmarklets are still in use, and still quite useful, but they are …. Is this article not finished?
- CamperBob2 3y agoNo, it's not finished, but ChatGPT was.
- idonotknowwhy 3y agoWeirdly, I learned about bookmarklets last week when ChatGPT was giving me a solution to put the old slack ui back
- kccqzy 3y agoTwo of my most used bookmarklets are to reset the viewport or force a desktop viewport. Annoyances like websites not allowing you to zoom in using the viewport meta element `user-scalable=no` can be mitigated by deleting that element. Sometimes I've found it also useful to force a desktop viewport because the mobile view hides too many controls.
- slater 3y agoAlways good to have some of these in your bookmarks toolbar: https://www.squarefree.com/bookmarklets/zap.html https://www.squarefree.com/bookmarklets/zap.html
- LeonB 3y agoSquare free … there’s a name I haven’t heard in a long time. They had a simple wysiwyg in the browser html editor, in the pre-Ajax era.
- colinprince 3y agoI use this one on my phone to boost text size when my eyes are tired javascript:var%20p=document.getElementsByTagName('*');for(i=0;i%3Cp.length;i++)%7Bif(p%5Bi%5D.style.fontSize)%7Bvar%20s=parseInt(p%5Bi%5D.style.fontSize.replace(%22px%22,%22%22));%7Delse%7Bvar%20s=12;%7Ds+=8;p%5Bi%5D.style.fontSize=s+%22px%22%7D
- sbierwagen 3y agoiOS Safari has this in the aA menu inside the address bar.
- marban 3y agoQuick plug for my HN bm: https://thomas.me/hnb/ https://thomas.me/hnb/
- joshu 3y agothe idea of using a bookmarklet to snap the current page was the entire basis of the prototype i built before del.icio.us
- ralphc 3y agopinboard carries on this tradition
- grumblehound 3y agoI made a little bookmarklet a while back that allows you to spawn a little man that walks along the top of elements: https://divwalker.arbitrarydata.co.uk/ https://divwalker.arbitrarydata.co.uk/ I'm still not bored of it.
- wolverine876 3y agoAwesome!
- twic 3y agoThis is giving me flashbacks to Lode Runner on the Mac.
- idonotknowwhy 3y agolmao make me want to play lemmings
- tpmx 3y agoWasn't there some fundamental web/javascript security policy change a decade or so ago that broke many bookmarklets?
- tpmx 3y agoThis is probably the post I'm thinking of: https://medium.com/making-instapaper/bookmarklets-are-dead-d470d4bbb626 https://medium.com/making-instapaper/bookmarklets-are-dead-d... https://archive.ph/hDumY https://archive.ph/hDumY
- ris 3y agoThat's what I was thinking - most bookmarklets I ever wrote one by one stopped working and I got tired of fixing them.
- TheRealPomax 3y agoThe advent of CSP really ruined the bookmarklet party, because the browser would obey the CSP headers, rather than the user whose computer the browser was running on, preventing a slew of bookmarklets from working due to script loading being "forbidden" by the server whose pages you were trying to run your bookmarklet on. By the time browser makers finally tried to address that, the damage was already done.
- deleted 3y ago[deleted]
- dirtyid 3y ago[dead]
- zipzup 3y agoFor watching chess I use one on chess24 and lichess that displays the current score and first four characters of the players’ names in the title bar.
- poxrud 3y agoI made one that uses openai api to summarize the current page that I’m on.
- Beijinger 3y agoCould you post it?
- dirtyid 3y agoWish there was easier way to customize/set favicon for bookmarklet. Right now you can export bookmark, edit in <A ICON> data, and import. If you have multiple chrome sessions you need to import on all devices within short period or icon will reset to default globe.
- suvadivian 3y agoBase 64 decode. This is the only one I use frequently. javascript:function%20c(){}c.prototype.get=function(){var%20a="";window.getSelection?a=window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&(a=document.selection.createRange().text);return%20a};c.prototype.set=function(a){if(window.getSelection){var%20b=window.getSelection();b.rangeCount&&(b=b.getRangeAt(0),b.deleteContents(),b.insertNode(document.createTextNode(a)))}else%20document.selection&&document.selection.createRange&&(b=document.selection.createRange(),b.text=a)};try{var%20d=new%20c,e=atob(d.get());d.set(e)}catch(a){alert(a.message)};
- TeMPOraL 3y agoAt work my team uses a bookmarklet I wrote the other day, to be able to add descriptions of Gerrit patchsets (iterations on a changeset for review). This was in response to Gerrit devs deciding, in their infinite wisdom, to just drop ability to set those descriptions from the UI.
- maxglute 3y agoProtip is named bookmarklets can be triggered on Android Chrome if you search the name and tap it on the omnibar. Very useful for setting playback speed on mobile. I have desktop bookmarklets that increment / decrements playback speed, and mobile bookmarklets with fixed playback speed. Wish there was easier way to customize/set favicon for bookmarklet. Right now you can export bookmark, edit in <A ICON> data, and import. If you have multiple chrome sessions you need to import on all devices within short period or icon will reset to default globe.
- deleted 3y ago[deleted]
- thirdplace_ 3y agowayback machine for current url: javascript:window.location='https://web.archive.org/web/*/'+document.location https://web.archive.org/web/*/'+document.location
- deleted 3y ago[deleted]
- Lammy 3y agoI used the "Readability" bookmarklet a lot back in The Day before that functionality was built-in https://web.archive.org/web/20090303150113/http://lab.arc90.com//experiments//readability// https://web.archive.org/web/20090303150113/http://lab.arc90....
- jessekv 3y agoIs there a good bookmarklet for a HN dark theme? Edit: I made one. Its based on: https://github.com/UserStyles/hacker-news-zenburn-dark https://github.com/UserStyles/hacker-news-zenburn-dark javascript:(()=>{var s=document.createElement('style');s.innerText=`*{color:#dcdccc!important;background-color:#404040!important}body%3Ecenter%3Etable%3Etbody%3Etr:first-child{background-color:#505050!important}body%3Ecenter%3Etable%3Etbody%3Etr:first-childa:hover{background:#404040!important}code,pre,input,textarea{background:#505050!important}a{color:#7F9F7F!important}.subtext%20a{color:#dcdccc!important}a:visited,a:visited%20span{color:#CC9393!important}a:hover,a:hover%20span{background:#505050!important}%60;document.head.appendChild(s)})(); Edit 2: It works on several other sites too. Cool!
- leoff 3y agoThis is just a small crocheting website, they don't have expertise to make such a fancy feature natively
- bloopernova 3y agoyou can also use ublock origin to filter html to create a dark mode: https://gist.github.com/aclarknexient/c39c83f2f97c3c6b1c307c19e516ed6e https://gist.github.com/aclarknexient/c39c83f2f97c3c6b1c307c...
- flobosg 3y agoA few ones I use often: * Get Markdown link of the current page as [Title](url): javascript:void function(){function e(){var e="";if(window.getSelection)e=window.getSelection().toString();else if(document.getSelection)e=document.getSelection().toString();else{if(!document.selection)return null;e=document.selection.createRange().text}return e}var t=e(),n=window.document.title,o=window.location.href,i=[];if(t){i.push("["+t+"]")}else{i.push("["+n+"]"),i.push("("+o+")")}window.prompt("created link",i.join(""))}(); * See current page on the Wayback Machine: javascript:void(window.open('https://web.archive.org/web/*/'+location.href.replace(/\/$/, ''))); * Twitter to Nitter: javascript:h=['nitter.it','nitter.snopyta.org','nitter.net']; location.href=location.href.replace(window.location.host,h[Math.floor(Math.random()*h.length)]);
- ashtonmeuser 3y agoI took the liberty of making your bookmarklets easier to edit/share with my tool bookmarkl.ink [1]. Markdown Link: https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd//md-link.js https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de... Wayback Machine: https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd//wayback.js https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de... Nitter: https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd//nitter.js https://bookmarkl.ink/ashtonmeuser/6e3869d8e468e016f22a4b4de... [1] https://bookmarkl.ink/ https://bookmarkl.ink/
- swyx 3y agofantastic service. thank you
- account42 3y agoWouldn't it be more in the spirit of bookmarklets to share tham as data: URLs containing a link with the bookmarklet?
- olejorgenb 3y agoThe one they shared is backed by gist which is much better if you want to understand the code. The gist also allow people to comment on the bookmarklet. Of course - now they have a way of injecting arbitrary javascript code into the browser of the people using the service to bookmark the bookmarklet. Lack of trust sucks. And (due to lack of trust) most applications make it hard to share javscripts links - so you need to instead instruct people to create a new bookmark and past the content into instead of right-clicking a link and clicking "bookmark".
- ulrischa 3y agoSadly bookmarklets do not work in mobile Browsers. Would be great.
- maxglute 3y agoSome do for chrome on android. They have to be named, you can search for the same in omnibar and tap. Works for things like changing playback speed.
- _iven_ 3y agoBookmarklets can work in mobile browsers. For mobile Chrome: - Create a new bookmark - Replace the bookmarked link with the bookmarklet javaScript code, e.g., javascript:alert('hello world') - To use the bookmarklet, start typing the bookmark name in the address bar until the auto-complete displays the bookmark, and then click on it. For mobile Safari, - Create a new bookmark and replace the URL with your javaScript code - To use the bookmarklet, tap on the bookmarklet name from the bookmarks menu (The edit was to better format my comment)
- ulrischa 3y agoHey this is too cool. Thank you
- deleted 3y ago[deleted]
- 01100011 3y agoI use a bookmarklet along with a keyword in Firefox to allow querying a bug number in our internal bugzill db. So I can type 'b <bug #>' in the URL bar and it takes me right to the bug. Firefox doesn't directly support bookmarklets, IIRC, so instead I use a custom search engine with a bookmarklet for the URL to accomplish the same thing.
- ashtonmeuser 3y agoI created a tool [1] to easily convert GitHub gists into bookmarklets and share them. Includes versioning, multi-file gists, etc. Some of my favourite examples hide images until mouseover [2] and play a procedural Brian Eno tune [3]. [1] https://bookmarkl.ink/ https://bookmarkl.ink/ [2] https://bookmarkl.ink/ashtonmeuser/21427841853c9f2292c8f7d7af0079ea//focus.js https://bookmarkl.ink/ashtonmeuser/21427841853c9f2292c8f7d7a... [3] https://bookmarkl.ink/ashtonmeuser/5e696524d986ba6c25af0df89bdbdccc https://bookmarkl.ink/ashtonmeuser/5e696524d986ba6c25af0df89...
- SushiHippie 3y agoThanks, would be cool to have a quick copy button, as these "bookmark me" buttons never work on mobile. With a simple copy button I could create a new bookmark easily on mobile.
- ashtonmeuser 3y agoI believe I had this at one point but ditched it as browser support was spotty (looking at you, iOS Safari). Looks like support for async clipboard API [1] is getting there so I'll look at adding this functionality back. [1] https://caniuse.com/async-clipboard https://caniuse.com/async-clipboard
- epivosism 3y agoForce narrow page - this one just shrinks body width, useful for handling pages which simultaneously don't allow zooming and also want to be 100% width on a giant monitor javascript:(function(){var newSS, styles='body { width: 25em !important; overflow: wrap; margin-left: auto; margin-right: auto; }'; if(document.createStyleSheet) { document.createStyleSheet("javascript:'"+styles+"'"); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName("head")[0].appendChild(newSS); } })(); Kill sticky: javascript:(function()%7B(function%20()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bif%20(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed')%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()
- louisbuchbinder 3y agoclick those skip ads buttons on you tube javascript:eval(atob('c2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgdmFyIGVsZW0gPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCd5dHAtYWQtc2tpcC1idXR0b24geXRwLWJ1dHRvbicpWzBdOwogICAgaWYgKGVsZW0pIHsKICAgICAgICBlbGVtLmNsaWNrKCk7CiAgICB9Cn0sIDEwMDApOw=='))
- hnrodey 3y agosetInterval(function () { var elem = document.getElementsByClassName('ytp-ad-skip-button ytp-button')[0]; if (elem) { elem.click(); } }, 1000);
- bambax 3y ago> As those browsers rose in market share, extensions began to overtake bookmarklets in popularity Halfway between bookmarklets and browser extensions sit user scripts: arbitrary long scripts that are run by a specialized extension (usually, today, TamperMonkey). They are incredibly powerful and can customize pretty much any webpage, with none of the limitations of bookmarklets, and very little of the hassle of creating a proper extension. They're quite addictive.
- yubiox 3y agoI wrote userscripts to speed up annoying MS and okta logins, like the ones where you have to click to send a 2FA text or click a stupid checkbox to stay logged in. I also wrote one to show what I call "spending cash available" (cash minus credit card balances) on personalcapital. Plus I found one that turns youtube shorts into normal videos. Fun stuff.
- rrrrrrrrrrrryan 3y agoI'm old enough to remember when Opera supported userscripts by default. I thought they were the future, but today it seems most would-be userscripts are just turned into extensions instead. Now that browsers have more granular permissions control, from a user perspective, I suppose it doesn't matter much whether it's called an extension or a userscript. But from a developer perspective it makes it's a little more tough to build a simple thing and throw it out into the world.
- bambax 3y agoIt's much easier to write a userscript than an extension -- the problem is distribution: almost no one know what they are or how to install them, etc. But I have been making them at work to bypass and improve some quirks of Atlassian products for instance (JIRA and Confluence), and there they spread like wildfire.
- PaulHoule 3y agoIt's like browser extensions but not toxic, malware-infected, browser performance destroying, compatibility with websites breaking, killing your web browser with "pluginitis", ...
- rendleflag 3y agoI use a "Go To Root" bookmarklet for both going to the root url of the current URL; or going to the subreddit if I'm in a reddit story. It's far from perfect, but I use it daily: ```javascript:var url = new String(location.href); var re = new RegExp('(https?:\/\/)([a-zA-Z0-9.]+)((\/r\/.\/)(comments.))?'); var res = url.match(re); // go to the root URL root_url = res[1] + res[2]; // If we are in a subreddit, go to the subreddit re = new RegExp('.*reddit.com'); if( res[2].match(re)) { if (typeof res[3] !== 'undefined' && typeof res[4] != 'undefined') { root_url = root_url + res[4]; } } location.href=root_url;```
- desertlounger 3y agoFWIW, javascript:// bookmarklets don't work on the standard Chrome home / new tab page, but data URL bookmarklets work everywhere. Here's my bookmarklet for Day Of Year... data:text/html,<script>now=new Date();alert(`Today is DOY ${1+Math.floor((now.getTime()-new Date(now.getFullYear(),0,1).getTime())/8.64E7)}`);</script>
- undebuggable 3y agoThe pinnacle of bookmarklets was Firebug Lite.
- invalidator 3y agoI use a kinda hacky bit of JS to do a number of actions based on the current URL. I create bookmarks like this, and set a keyword (this one is 'gt', for Google Translate): javascript:location="https://translate.google.com/translate?hl=&sl=auto&tl=en&u="+location On any page, I can type ctrl-L (select address bar), gs, enter, and I get the page translated to English. A couple more: Wayback machine: javascript:location="https://archive.md/submit/?url="+location 12 foot ladder: javascript:location="https://12ft.io/proxy?q="+location
- k__ 3y agoFew years ago, I created the undefined gooselet. https://kay-is.github.io/undefined-gooselet/ https://kay-is.github.io/undefined-gooselet/
- arkush 3y agoArchive current page with Internet Archive's The Wayback Machine: javascript:void(open("https://web.archive.org/save/" + document.location)) Archive current page with archive.today: javascript:void(open("https://archive.ph/?run=1&url=" + encodeURIComponent(document.location))) Search Google Cache for current page: javascript:void(open("https://webcache.googleusercontent.com/search?q=cache:" + document.location)) Open current Reddit post in Reveddit: javascript:void(open("https://www.reveddit.com/" + document.location.pathname))
- madacol 3y agoedit any text on the page: javascript: (function() { document.body.contentEditable = true; document.body.spellcheck = false; })(); --- Longer bookmarklets: https://github.com/madacol/web-automation/tree/master/bookmarklets https://github.com/madacol/web-automation/tree/master/bookma... - Highlight selected text - chatgpt to markdown - Convert images to base64 DataURL markdown embedding
- threeio 3y agoI feel very old right now.
- sieste 3y agoI'd like to have a shortcut that appends currently highlighted text, current url and timestamp to a text file on my disk. Can this be done with a bookmarklet?
- davchana 3y agoCannot append. Can do everything else you ask. Either will download that one text content as text file, or can put it in the clipboard, and you manually have to open it & paste it.
- LeonB 3y agoPerhaps if the bookmarklet opened a new url containing the text as a query parameter, and the url had a weird protocol instead of https:// https:// — say it was snippy:// … and then you created a protocol handler on your machine for the “snippy” protocol …. And it saved the relevant query param to a file. I can’t remember if I’ve done this before. It seems like something I’ve done.
- jabbequbs 3y agoI've done that too. I ended up just using a local webserver with some Python cgi scripts instead though. I found it more flexible and easier to remember how things worked that way.
- davchana 3y agoYes, the other easy way I have used multiple times is, bookmarklet simply sends the text via a POST request to Google Apps Script, which simply appends it to a sheet or doc.
- jabbequbs 3y agoI've found it really handy to just have a local Python webserver running on my workstation. Then my bookmarklets can just hit eg http://localhost:8000/cgi-bin/script.py http://localhost:8000/cgi-bin/script.py to modify a local file or open up my notes for a certain Jira ticket or whatever else I can think of. There are security considerations with that approach though, since any random site you load can start sending requests to your local webserver.
- gabrielsroka 3y agoFun fact, I found, mostly by accident, that adding a comment to the beginning of a bookmarklet Chrome will set it to the name. I'd love to see the source code in Chrome that does this. Eg javascript:/* name: /awesome# */alert(2+2)
- deleted 3y ago[deleted]
- davchana 3y agoDoes it have to be two lines? Going to try this from home.
- gabrielsroka 3y ago2 lines?
- davchana 3y agoEdit: my bad, it was my mobile layout. I mean does it need a line break as it is seen in your code?
- gabrielsroka 3y agoI don't see a line break. Are you on mobile? Turn it sideways.
- cxr 3y agoWhat does "adding a comment to the beginning of a bookmarklet Chrome will set it to the name" mean, exactly?
- gabrielsroka 3y agoThis is a comment in JavaScript: /* comment */ Bookmarklets, like bookmarks, also have names. I didn't phrase it very well but I figured people would just drag and drop it in Chrome and see it for themselves.
- starshadowx2 3y agoI'm a bit confused, does this article just end like this or is there something I'm missing? "The Bookmarks bar faded to the background more. Bookmarklets are still in use, and still quite useful, but they are …." They are what?
- p1mrx 3y agoThis is texed, the plainest text editor: data:text/html,<title>texed</title><body style=margin:0><textarea autofocus spellcheck=false style=width:100vw;height:100vh;resize:none;border:0;padding:6pt;font-family:monospace;font-size:large;background-color:rgb(22,22,22);color:lightyellow>
- QuantumGood 3y agoI frequently share Google Doc links, and I prefer the toolbar collapsed, which hides the share button (which takes a bit to load anyway). I triple click and Ctrl-C the link that pops up from this bookmarklet: javascript:(function(){alert(window.location.href.replace(/\/edit.*$/, '/edit?usp=sharing%27));})()
- indus 3y agoReading comments makes me feel that we need a monthly.. "Show HN: All the new bookmarklets." :-)
- mastazi 3y agoI still regularly use the "Post to HN" bookmarklet. I seem to remember (if memory serves me right) that this used to be in the footer of the actual HN website many years ago. Is anyone else still using it? EDIT: it can still be accessed from here https://news.ycombinator.com/bookmarklet.html https://news.ycombinator.com/bookmarklet.html EDIT 2: the bookmarklet is also linked from HN's "submit" page, just below the form. javascript:window.location=%22http://news.ycombinator.com/submitlink?u=%22+encodeURIComponent(document.location)+%22&t=%22+encodeURIComponent(document.title)
- jstrieb 3y agoA while ago, I came up with a way to use bookmarklets to make bookmarks that open to different pages depending on the order in which you click them. https://jstrieb.github.io/projects/hidden-bookmarks/ https://jstrieb.github.io/projects/hidden-bookmarks/ Every clicked bookmarklet concatenates a character to a passphrase used for AES decryption. The encrypted text and current passphrase are stored as intermediate state in the URL hash. When it decrypts, it redirects. If it doesn't decrypt, it goes to a fallback page as if it was a regular bookmark. It was mostly a fun proof-of-concept, but I am hopeful that the technique has actually been useful to someone.
- ceritium 3y agoI think it's appropriate to share a small tool I did for creating and sharing bookmarklets https://bookmarklet.jose.gr https://bookmarklet.jose.gr Everything is stored in the URL, actually I am just thinking I should add offline first support.
- 6d65 3y agoSince everyone is sharing, I'm using bookmarklets daily, the main ones being 3x and 2x, which find the video element in the current page and speed it up. I also made some overlay grid helpers, like 8h and 8v which create some overlay pass through elements and render red grid lines(8px spacing) using css. This is like an alignment tool for every page. The bad thing is that Chrome and Edge don't highlight bookmarks by default when searching and makes one to type the top arrow key. Firefox used to be better in this regard, with the bookmarklet highlighted and ready to hit. The workaround for Chrome and Edge is to make the bookmarklet a search engine, that makes the bookmarklet selected by default. Bookmarklets and custom search engines (for various online documentation sites, or plain jira, or aws) can be a productivity booster. I wouldn't be able to navigate aws ssm without my trusty ssm search engine. Same for the others: EC2, CF, S3. I should be using bookmarklets more though.
- olejorgenb 3y agoAnnoyingly Slack refuse to create a link with a bookmarklet as content. They do it on purpose - it's not part of a URL validation. I guess it IS a security concern to run arbitrary javascript inside the slack app of another user. But makes sharing bookmarklets that way harder.