5 ms·
It's strange that addons have so much unsandboxed power. I think browser manufacturers are not very keen on letting users customize their browsing experience. O
by mg 3y ago
It's strange that addons have so much unsandboxed power. I think browser manufacturers are not very keen on letting users customize their browsing experience. Otherwise they would give them finer control over what addons can do.
Fortunately, most customizations can be done via bookmarklets.
Benefits of bookmarklets:
- Easy to edit
- Inactive until clicked
- Work in all browsers
- Work on mobile
- Integrate nicely into the UI. You can move them around, put them into any bookmark folder, assign shortcuts.
I wrote this bookmarlet editor which makes it easy to convert between clean code and a bookmarklet:
https://www.gibney.org/bookmarklet_editor https://www.gibney.org/bookmarklet_editor
Here is one that I use to read HN:
if (!location.href.match('ycom'))
location.href='https://news.ycombinator.com';
doTheMagic = function() {
if (typeof e!=='undefined')
e.style.background='#c0c0c0';
e=Array.from(document.querySelectorAll('.age a:not(.seen)')).sort().at(-1);e.style.background='#ff0';
e.classList.add('seen');
e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});
}
doTheMagic();
if (typeof theMagicIsActive=='undefined') {
document.addEventListener("keydown", function(evnt) {
if (evnt.key === "n") doTheMagic();
});
theMagicIsActive = true;
}
When clicked and HN is not already opened, it opens HN. When on HN, it jumps to the next newest story. Or comment - it also works in the threads. After jumping to the newest story, clicking it again jumps to the next newest story. Instead of clicking it, pressing "n" also works.
Also works in the comments view of a profile. So when you want to see if someone replied to your comments, you click on "comments" in your profile and then on the bookmarklet to jump to the newest reply.
- michaelt 3y ago> It's strange that addons have so much unsandboxed power. That's because addons are a relic from the wild west era of the 1990s, where the philosophy was to give the user a chainsaw and if they chop their own leg off that's their problem. That's in contrast to the modern software design philosophy, which is that the average user is so drunk they're almost falling over, and the world should contain no chainsaws whatsoever in order to accommodate this. Browser designers would love to remove add-ons, but no browser can succeed without an ad blocker, and providing an extension mechanism provides this, without requiring the browser maker to get into the ad blocking game personally.
- mdaniel 3y agoI recognize that I may be contributing to your "addons have so much power" argument, but I wanted to draw your attention to ViolentMonkey <https://github.com/violentmonkey/violentmonkey#readme https://github.com/violentmonkey/violentmonkey#readme> which is stellar for these site-specific customizations (known as User Scripts, of which Greasemonkey was the most famous)
- crtasm 3y agoMost extensions I see could be userscripts. Benefits include: it's easy to see the code you're about to install + if you get them from GreasyFork there's some good protections against obfuscated or external code. https://greasyfork.org/en/help/code-rules https://greasyfork.org/en/help/code-rules https://greasyfork.org/en/help/external-scripts https://greasyfork.org/en/help/external-scripts It would be great if there was a way to set them to not execute until clicked, but at least it's easy to see the list of scripts that are set to run on the current page and toggle them on and off.
- oriel 3y agoIve had a side project going for a few years to modularize this exact type of middleware for the browser's WebExtension (and WebAPI) capabilities. https://github.com/1ps0/elos-connect https://github.com/1ps0/elos-connect https://elos-edu.notion.site/eLOS-Connect-0-0-11-a72acbec8936417c8324fca336b8bbf4?pvs=74 https://elos-edu.notion.site/eLOS-Connect-0-0-11-a72acbec893... Curious to see if anyone else is able to find use cases for the components/sidebar and urlbar CLI I've been building.