Bookmarklet Maker

Bookmarklet Maker

Github Repository

Usage:

Examples:

Submit current URL to Reddit:

Submit to Reddit

var url = document.URL ;
var title = document.title ;

window.location.href = "https://www.reddit.com/r/"
                        + prompt("Subreddit: ", "")
                        + "/submit?title="
                        + title + "&url="
                        + url ;  
      

Submit current URL to Reddit in a new tab

Submit to reddit in a new tab

var defaultSub = "dummy"
var subreddit = prompt("Enter the subreddit", defaultSub)
var baseUrl =  'https://www.reddit.com/r/' + subreddit + 'submit?title=';
window.open(baseUrl + document.title + '&url=' + document.URL, '_blank') 
      

Generate org-mode hyperlink

Org-mode hyperlink

var md = "[[" + document.URL + "][" + document.title + "]]" ;
prompt("Enter Ctrl+C to copy this org-mode hyperlink. :", md);
      

Clear google search URLs to allow easy copy URLs without messing it.

Clear google URL

var $s = function (selector){
    return Array.from(document.querySelectorAll(selector));
};

$s(".rc a").forEach(e => e.onmousedown = null);
      

Inject css style sheet from a given URL into current page.

inject css

var link = document.createElement("link");
link.href = prompt("css url", "");
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("head")[0].appendChild(link);
      

Open page that doesn't exist anymore in Web Archive

open in WebArchive

var baseUrl = "https://web.archive.org/web/*/"
var urlmod  = document.URL
window.location.href = baseUrl + urlmod