Skip to content

Instantly share code, notes, and snippets.

@dvdsmpsn
Last active July 10, 2018 13:17
Show Gist options
  • Save dvdsmpsn/5934581 to your computer and use it in GitHub Desktop.
Save dvdsmpsn/5934581 to your computer and use it in GitHub Desktop.
Bookmarklets for browsers
// Opens a small Radio 6 Music window just like the "Listen Live" link here -- https://www.bbc.co.uk/6music
// To "compile", URL encode everything after "javascript:"
// using http://meyerweb.com/eric/tools/dencoder/
// Source:
javascript:(function(){
window.open('https://www.bbc.co.uk/radio/play/live:bbc_6music', 'player6music', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=380,height=685');
})();
// "Compiled" for use as your bookmarklet (copy the line below):
javascript:(function()%7B%0A%20%20window.open(%27https%3A%2F%2Fwww.bbc.co.uk%2Fradio%2Fplay%2Flive%3Abbc_6music%27%2C%20%27player6music%27%2C%20%27menubar%3Dno%2Clocation%3Dno%2Cresizable%3Dno%2Cscrollbars%3Dno%2Cstatus%3Dno%2Cwidth%3D380%2Cheight%3D685%27)%3B%20%20%20%20%20%20%20%20%20%20%20%20%0A%7D)()
// Allows you to view the contents of a password field
// To "compile", URL encode everything after "javascript:"
// using http://meyerweb.com/eric/tools/dencoder/
// Source:
javascript:(function(){
var F,j,f,i;
F = document.forms;
for(j=0; j<F.length; ++j) {
f = F[j];
for (i=0; i<f.length; ++i) {
if (f[i].type.toLowerCase() == "password") {
f[i].setAttribute("data-original-type","password");
f[i].type = 'text';
}elseif (f[i].getAttribute("data-original-type") == "password") {
f[i].type = 'password';
}
}
}
})();
// "Compiled" for use as your bookmarklet (copy the line below):
javascript:(function()%7B%0A%09var%20F%2Cj%2Cf%2Ci%3B%20%0A%09F%20%3D%20document.forms%3B%20%0A%09for(j%3D0%3B%20j%3CF.length%3B%20%2B%2Bj)%20%7B%20%0A%09%09f%20%3D%20F%5Bj%5D%3B%20%0A%09%09for%20(i%3D0%3B%20i%3Cf.length%3B%20%2B%2Bi)%20%7B%20%0A%09%09%09if%20(f%5Bi%5D.type.toLowerCase()%20%3D%3D%20%22password%22)%20%7B%0A%09%09%09%09f%5Bi%5D.setAttribute(%22data-original-type%22%2C%22password%22)%3B%0A%09%09%09%09f%5Bi%5D.type%20%3D%20%27text%27%3B%0A%09%09%09%7Delseif%20(f%5Bi%5D.getAttribute(%22data-original-type%22)%20%3D%3D%20%22password%22)%20%7B%0A%09%09%09%09f%5Bi%5D.type%20%3D%20%27password%27%3B%0A%09%09%09%7D%0A%09%09%7D%20%0A%09%7D%20%0A%7D)()%3B
// Skip YouTube adverts
// Click on this bookmark whenever an advert is playing and it will go to the end of the advert.
// Does the same if you hit it when on a video too
javascript:(function(){$('video').currentTime = $('video').duration})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment