Skip Navigation

Do you use Javascript bookmarklets? Which ones do you find useful? And are there similar things that would be useful to know of?

Got to know of them recently. They seem very cool.
Like, I don't have to install anything extra.

https://www.freecodecamp.org/news/what-are-bookmarklets/
https://bk7312.github.io/bookmarklets/

::: spoiler I especially like this one that shows Id links. Useful while sharing wikipedia links:
https://github.com/madacol/web-automation/blob/master/bookmarklets/Id%20Linker.js
:::

And

::: spoiler This one which helps to use text fragments:
https://stackoverflow.com/questions/62989058/how-does-text-in-url-work-to-highlight-text#answer-76131511 :::

Discliamer: Be careful with copy-pasting bookmarklets into your browser. Only do so if you trust it.

Which all bookmarklets do you use, find useful?
Please share them.

Are there similar easy things that most people sort of easily have access to? I think Libreoffice's/Excel's record macro function would be useful for people too.

Are there any communities for similar things, sort-of like beginner automation?

Thanks in advance.

19 comments
  • I wrote this one to strip the custom css from any sub on (old) reddit. I use it on subs I find annoying, like mildlyinfuriating.

    javascript:(function(){x=0;s=document.styleSheets;for(const y of s){if(y.title==="applied_subreddit_stylesheet"){if(y.disabled!=true){y.disabled=true;}else{y.disabled=false;}}x++;}})();

  • I wrote this one ages ago to throw shopgoodwill.com items in my calendar because the times are in PDT and they don't have any built in notification (that works)

    Also made it work with govdeals but I haven't tested that in ages so YMMV

    Writes it to a Google calendar URL. I had it write to an ICS file at one point but I don't have version control on this one file

     undefined
        
    javascript: (
        () => {
            function createItem(productTitle, date) {
                console.log(productTitle, date);
                 window.open(`https://calendar.google.com/calendar/render?action=TEMPLATE&text=%24%7BproductTitle%7D&details=%24%7BproductTitle%7D @ Goodwill ${window.location}&dates=${date}/${date}`);
            }
            if (window.location.href.toString().includes("https://shopgoodwill.com/item/")) {
                try {
                    let title = document.querySelectorAll(".mb-4.d-none.d-md-block.ng-star-inserted")[0].innerText;
                    let headers = document.querySelectorAll("th.font-weight-bold.text-nowrap");
                    let time;
                    if (headers[4].innerHTML == " Handling Price: ") {
                        time = headers[5] }
                    else {
                        time = headers[4]
                    }
                    time = time.parentElement.children[1].innerHTML.substring(0, 25) + "DT";
                    console.log(headers);
                    createItem(title, new Date(time).toISOString().split(".")[0].replace(/-/gi, "").replace(/:/gi, "") + "Z");
                } catch (e) {
                    alert("An error occurred, check the console for full details: " + e);
                    console.log(e); 
                }
            } else if (window.location.href.toString().includes("https://www.govdeals.com/index.cfm")) {
                try {
                    createItem(document.querySelectorAll("#asset_short_desc_id")[0].innerText, new Date(document.querySelectorAll("tr > td[align='right'][nowrap='nowrap'] > b")[0].innerText.replace("ET", "EDT")).toISOString().split(".")[0].replace(/-/gi, "").replace(/:/gi, "") + "Z");
                } catch (e) {
                    alert("An error occurred, check the console for full details: " + e);
                    console.log(e);
                }
            } else {
                alert("This is not a goodwill or govdeals item page.");
            }
        })();
    
      
19 comments