Bookmarklets, user scripts, etc.

About this page

This is a page for things to modify your browser. These are mainly things that I made for my own use; maybe someone else will want them too. Generally if I have multiple of these types of things (e.g., a bookmarklet and a user script), then they're alternatives that do the same/similar things.

Note that since most of these depend on aspects of how some particular websites work, they might break at any time.

Bookmarklets [B]

Bookmarklets are small pieces of JavaScript code that you can bookmark and then run on other websites to do various things. To use these, bookmark the link (drag it to the bookmark bar, or right-click and then choose "Bookmark this Link"); then when you're on the page you want to use the bookmark on, click on the bookmark.

On iOS (iPhone/iPad/iPod) Safari, it's a bit more complicated: you need to create a bookmark to some website, then edit the bookmark's location. That is, create a bookmark to an ordinary webpage, save it, copy the code, tap the bookmarks icon, tap Edit, delete the URL and then paste the code. (source)

User scripts [G]

These work with the Greasemonkey extension in Firefox. They may also work in other extensions or other browsers; I haven't tested that yet.

User styles [S]

These work with the Stylus extension in Firefox, and possibly other extensions or other browsers. You'll need to copy and paste from the stylesheet to a new style, since I don't know how to make a user style download link.


(Click the link to go to the section; actual bookmarklet links below.)

No YT Autohide [S][B]

Before: The video controls are covering up the bottom of the video, which in this case, is a text caption that's not a closed caption.  The controls are semi-transparent, but the text under them still isn't very readable.  Caption: "What does that say?"  After: The video controls are opaque and completely outside the video.  The caption is visible; it says "In the 1970s, hovercraft were the future.  So what went wrong?"  Caption: "That's better!"

Fix the new YouTube player so that the playback bar is always visible and doesn't cover up the bottom of the video. Apply the user style (better), OR put the bookmarklet in your bookmarks bar, and click it when you have a video open (the bookmarklet will apply only to that tab). Not guaranteed to work if YouTube changes things again (not guaranteed to work in general; I hope it doesn't break anything, but it seems to work on my computer on both Firefox and Safari).

Known issues:

User style: No YT Autohide (updated 2019-03-19)

Bookmarklet: No YT Autohide (bookmark this link)



Play MIDI's [B]

Change all links to .mid or .midi files on the page so that they play the file using's script. Useful for MIDIly-challenged computers (*glares in Apple's direction*).

Known issues:

The "Stop MIDIs" bookmarklet stops MIDI files that you've played using the Play MIDIs bookmarklet.

The bookmarklet: Play MIDIs (bookmark this link)

javascript:(function(){var s=document.createElement('script'),l=document.getElementsByTagName('a'),i=0;s.src='//';document.body.appendChild(s);for(;i<l.length;i++)if(l[i].href.match(/\.midi?$/))l[i].onclick=function(){;return%20false;};})();

The other bookmarklet: Stop MIDIs (bookmark this link)



Web archive [G][B]

Display the current page, or (in the user script version) any linked page, in Web Archive. Helpful for if you're browsing an old webpage and come across a bunch of broken links. (Also it offers to save the page if it's not there but available online.)

This is available as a bookmarklet and as a user script. The bookmarklet finds older versions of the current page. The user script adds an item to the context menu to find older versions of the current page or of any link (which is useful if the page now redirects somewhere unhelpful).

The bookmarklet: Web Archive (bookmark this link)


The user script: Web Archive context menu

Enable TVTropes display options [G]

Update: This script seems to no longer be necessary since their latest redesign.

Current forum game scores (xkcd forums) [B]

(for example, with the Thread Necromancy Mexican Standoff thread open, clicking this bookmarklet takes you to the Thread Necromancy Mexican Standoff scores)

Go directly to the scores for the forum game you're currently viewing. If not available, go to the list of forum game scorekeepers. This is similar to clicking the link in my signature, except it works even if I haven't posted in the thread recently, and is more reliable when viewing new posts.

The bookmarklet: Forum game scores (bookmark this link)

javascript:if(!function(){var h2=document.getElementsByTagName('h2');if(h2.length==0)return;var a=h2[0].getElementsByTagName('a');if(a.length==0)return;var r=a[0].href.match(/^https?:\/\/(?:www\.)?(?:(?:forums3?|fora)\.xkcd\.com|echochamber\.me)\/viewtopic\.php\?([^#]+)/);if(!r)return;r=('&'+r[1]+'&').match(/&t=(\d+)&/);if(!r)return;return location=''+r[1];}())void(location='');


Disable mobile viewport [B]

Tells mobile browsers to use the default (wide) width and allow zooming, like they do for sites that aren't made for mobile devices. On some websites, this will switch them into desktop layout, rather than mobile layout.

The bookmarklet: Disable mobile viewport (bookmark this link)

javascript:+function(){var m=document.getElementsByTagName("meta");for(var i in m)if(m[i].name=="viewport"){m[i].content="";break}}()



Eval Javascript [B]: For browsers that don't allow directly entering javascript: URL's in the address bar and don't have a JavaScript console.

Translate [B]: Translates the current page to English using Google Translate.

Fix Bitbucket scrolling [S]: Bitbucket for no apparent reason has the main content scrolling separately from the window, which makes scrolling work weirdly (scrolling diagonally doesn't work). User style: Fix Bitbucket scrolling