Live data from Hacker News

For your next side project, make a browser extension

geoffreylitt.com

271–280 of 286 posts

Re: For your next side project, make a browser extension

#271
post #110
post #104

I spent some time some productivity extensions, for gmail replies[0] and quick notetaking[1]. It was a lot of fun, but like other people have mentioned, porting to and working with manifest v3 is not as nice. I've noticed also that the way Google asks for permissions from the user is done in human-understandable, but worst-case language. For example, I think there was something where I wanted access to the current ta…

They're describing the worst-case thing someone could do with the privilege being granted, because they have no way of saying what the developer will do with the privilege. The way to make the prompt sound less scary, is to use finer-grained permissions where the worst-case thing someone could do is less scary. (Or, if there aren't any fine-grained permissions suited to doing your task — then propose some! The browse…

Would be interesting if they did the same thing for their own operation. „We collect all data that we can about you, so that we can become a mega corp that can control most of your life.“ Wonder why they don’t do it?

Re: For your next side project, make a browser extension

#273
post #69
post #2

A lot of the most useful software I've made for myself has been browser extensions. Spend too much time on Hacker News? I made an extension to freeze the front page so it updates once every 6 hours. Spend too much time on Reddit? I made an extension requiring a password to be input for every page I visit. Want to extensively filter LinkedIn jobs, and track which jobs you've applied to? I made an extension to apply ve…

> Spend too much time on Hacker News? I made an extension to freeze the front page so it updates once every 6 hours. Me, I just open a guest account, or a new profile, etc. Meaning, the extension is at most a reminder to try to stop. it's still trivial to bypass

All it needs to do is pattern interrupt strongly enough that you're not sucked into the social media black hole for hours.

A bypass for 15 minutes button might be too weak, but a small math problem or a password you need to get from your manager would be enough friction.

The decision to bypass after being interrupted is with you, and that's ok.

Re: For your next side project, make a browser extension

#274
post #257

Earlier quoted context omitted.

You don't need an extension to do that. You can get by with a bookmarklet, which would be wise, considering how much contempt browser makers have for extension authors.

Wait...a bookmarklet can do stuff on multiple pages? I thought that if I had a bookmarklet and invoked it on a page, and the bookmarklet navigated to a different page the running instance of that bookmarklet would go away.

A bookmarklet is more or less just a JS expression that executes on command (the user's, that is). The execution model is approximately the same as for content-delivered scripts, and it's subject to the same constraints.

So, yes, if you just naively write a bookmarklet that navigates to a new page with e.g. assignment to window.location and then expect any result other than the next line of code not executing, then you're going to be disappointed. You solve this the same way you'd solve it if you were writing an ordinary Web app--implemented in JS delivered by the server with script elements on your own page. Two stupid easy solutions that immediately come to mind: use XHR/fetch instead of actual page navigation; alternatively, have the bookmarklet open up a ~postage stamp-sized window with window.open that you can use both to output visible diagnostics and to keep the crawler resident (by doing all the work in the diagnostic window's context, which uses window.opener to control the initial tab as its puppet)... etc.

Re: For your next side project, make a browser extension

#275

Earlier quoted context omitted.

Mobile devices support extensions to some degree now, too! iOS Safari fully supports them, so that’s millions upon millions of potential users. Unfortunately, the UI for initiating them isn’t quite as nice as the desktop, which is a big reason why we haven’t implemented our extension for iOS yet. Once Apple figures out a better install and activation workflow, then we’ll probably do it.

For those who haven't tried, the UX for initiating an extension is something like this: 1. download extension 2. open Safari and tap on puzzle piece icon on the left side of the address bar (when visible) 3. tap the newly downloaded extension 4. when prompted, give permission for it to run 5. give permission for it to run always on the current site 6. give permission for it to run on every site I appreciate the need…

I can attest to this. The UX is quite bad. I run a small SaaS[0] and had a hard time explaining to my users on how to enable the Safari extension. The UX to use is not as nice either.

In the end I switched to the traditional Share Extension.

[0]: https://ktool.io

Re: For your next side project, make a browser extension

#276
post #242

Earlier quoted context omitted.

Shameless plug, but we built the Plasmo Framework to make that (and a lot more) super easy: https://github.com/plasmohq/plasmo

heard you guys on the logrocket podcast btw, thank you for taking on this challenging but unexplored market. do you have any design patterns for (as geoffreylitt said) “stably addressing dom elements” in twitter and gmail? i noticed there was a gmail specific extension platform launching here the other day, have yet to try it out tho

We have a lot of ideas on how to make this problem a lot easier. It's a big reason why extensions aren't as big as they could be. Browser extension devs having to tinker and even think about the DOM or any other website-specific quirk is a leaky abstraction.

If it's an issue, people's usual approach to solving that problem is to create some mapping of "twitter-sidebar : some XPath selector" on the backend and have their extension query whenever they want to interact with the web page.

They'll have e2e tests to check if their selectors or xpaths still work. If not, they'll figure out what changed and modify the xpath. Some automate this step.

It's tricky because A/B tests are a thing, websites might change based on geographical region, and a bunch of other stuff that leads to users seeing different things in the DOM compared to the e2e test). Logging errors to something like Sentry mitigates some of this, but the complexity is still quite large.

It stems from the fact that frontends only consider humans, not robots. You either need to make your robot super resilient to change (above approach), make your robot act more like a human, have the website consider the robot ("Connect to Wallet", etc), or use the web app's backend API if it exists.

We're experimenting with all four of these approaches this year and seeing which ones are the most valuable to people, so stay tuned for more exciting extension stuff!

Re: For your next side project, make a browser extension

#277

Earlier quoted context omitted.

For those who haven't tried, the UX for initiating an extension is something like this: 1. download extension 2. open Safari and tap on puzzle piece icon on the left side of the address bar (when visible) 3. tap the newly downloaded extension 4. when prompted, give permission for it to run 5. give permission for it to run always on the current site 6. give permission for it to run on every site I appreciate the need…

I can attest to this. The UX is quite bad. I run a small SaaS[0] and had a hard time explaining to my users on how to enable the Safari extension. The UX to use is not as nice either. In the end I switched to the traditional Share Extension. [0]: https://ktool.io

Share extensions are fine, but they still require activation. Also, they can't automatically run on a page without user intervention, which is necessary for many/most traditional extensions.

Re: For your next side project, make a browser extension

#278
post #260

Earlier quoted context omitted.

Shameless plug, but we built the Plasmo Framework to make that (and a lot more) super easy: https://github.com/plasmohq/plasmo

Suggestion: please indicate your supported target platforms (browsers) in the readme.

Great feedback! I'll push a change to add that.

Re: For your next side project, make a browser extension

#279

Earlier quoted context omitted.

Shameless plug, but we built the Plasmo Framework to make that (and a lot more) super easy: https://github.com/plasmohq/plasmo

I am a user of plasmo and it is amazing, super easy to get started and it just works

So great to hear! What kind of extension are you building?

Re: For your next side project, make a browser extension

#280
post #235

Last time I was making one (for myself, not to publish), my main issue was that browsers made it nearly unusable to have a private local extension because you only had two choices: - either upload it on their website and go through approval everytime - either lower security to run in developer mode, and have an alert warning you about it every X minutes, ruining your focus VSCode on the other hand has no issue runnin…

AMO does not require a manual review nor the extension to be uploaded publicly. You can sign it through their site and then distribute it elsewhere. Also, I don't see how you can compare browser extensions to vscode extensions. One product is aimed at your grandma, the other at software developers and doesn't have access to your email, banking and credit cards.

What’s AMO?
Post reply on HN