
Useful Bookmarklets
Markdown Link
A bookmarklet that that creates a link in Markdown format for the current page.
if(window.location.href.indexOf('https') !== -1) {
navigator.clipboard.writeText('['+document.title+']('+window.location.href+')');
} else {
prompt('Markdown in for this page:','['+document.title+']('+window.location.href+')');
}
To download it, drag this link into your bookmarks toolbar.
Markdown Quote
A bookmarklet that creates a markdown quote with attribution of the selected text for the current page.
const title = document.title;
const url = document.location;
const host = location.hostname;
const quote = window.getSelection().toString();
const mdfile = `>${quote}\n\nsource: [${title}](${url})`;
if(window.location.href.indexOf('https') !== -1) {
navigator.clipboard.writeText(mdfile);
} else {
prompt('Markdown for this page:', mdfile);
}
To download it, drag this link into your bookmarks toolbar.
Prepend to Bear Note
A bookmarklet that that creates a link in Markdown format for the current page and Prepends it to a Bear note.
(function(){
const text = `[${document.title}](${window.location.href})`;
window.location = `bear://x-callback-url/add-text?id=5050AFEF-2DB4-409B-8C6F-7F7F72CB7D2A-2901-0000011D81741CF9&mode=prepend&text=${text}`
})()
To download it, drag this link into your bookmarks toolbar.
Get RSS Feed
A bookmarklet that locates and copies the feed url from the current page:
d=document;
el=d.getElementsByTagName('link');
g=false;
for(i=0;i<el.length;i++) {
if(el[i].getAttribute('rel').indexOf('alternate')!=-1){
ty=el[i].getAttribute('type');
if(ty.indexOf('application/rss+xml') != -1 || ty.indexOf('text/xml') != -1 || ty.indexOf('application/atom+xml') != -1){
g=true;
h=el[i].getAttribute('href');
if(window.location.href.indexOf('https') !== -1) {
navigator.clipboard.writeText(h);
} else {
prompt('Feed url:', h);
}
}
}
}
if(!g){
window.alert('Could not find the RSS Feed');
}
To download it, drag this link into your bookmarks toolbar.
Archive Org
A bookmarklet that looks up the current page in Achive.orgs's WayBack Machine.
window.location = "https://web.archive.org/web/*/" + window.location;
To download it, drag this link into your bookmarks toolbar.
Libgen Search
A bookmarklet that takes the selected text and uses it as the search term for a Libgen search.
const selection = window.getSelection().toString();
window.open("http://libgen.rs/search.php?req=" + selection + "&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def");
To download it, drag this link into your bookmarks toolbar.
Libgen Fiction Search
A bookmarklet that takes the selected text and uses it as the search term for a Libgen search.
const selection = window.getSelection().toString();
window.open(`http://libgen.rs/fiction/?q=${selection}&criteria=&language=English&format=epub`);
To download it, drag this link into your bookmarks toolbar.
Z-Lib Search
A bookmarklet that takes the selected text and uses it as the search term for a Z-Lib book search.
const selection = encodeURIComponent(window.getSelection().toString());
window.open(`https://1lib.us/s/${selection}`);
To download it, drag this link into your bookmarks toolbar.
Google Sheets CSV URL
A bookmarklet that takes a Google Sheets URL and creates the CSV export URL for it.
const r = /https:\/\/docs\.google\.com\/spreadsheets\/d\/(.*)\//ig;
const match = r.exec(window.location.href);
navigator.clipboard.writeText(`https://docs.google.com/spreadsheets/d/${match[1]}/export?format=csv&id=${match[1]}`);
To download it, drag this link into your bookmarks toolbar.
Search Feedly
A bookmarklet that search the current site in Feedly.
window.open("https://feedly.com/i/discover/sources/search/feed/" + encodeURI(window.location.href));
To download it, drag this link into your bookmarks toolbar.
Generate Blog Post File Name
This bookmarklet is useful only to me as it allows me to quickly generate a filename for my blog for when I post via Github itself.
const a = new Date().getTime();
navigator.clipboard.writeText(`${a}.md`);
To download it, drag this link into your bookmarks toolbar.
Widen NMA Viewport
This bookmarklet widens the video viewport on the New Master's Academy website.
Array.from(document.getElementsByClassName('col-full')).forEach(e => e.setAttribute('style', 'max-width: 1530px'));
To download it, drag this link into your bookmarks toolbar.
Tools
- Bookmarklet Creator with Script Includer - Peter Coles
- URL Decode and Encode - Online
- RegExr: Learn, Build, & Test RegEx
- X-callback-url Scheme documentation | Bear App
- Bookmarklet Maker
—
You've found yourself on the site of Travis Ennis, a software engineer who lives in Indiana. If you'd like, you can contact me.