nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

WebExtensions support

Open Ambrevar opened this issue 2 years ago • 35 comments

After playing with Firefox extensions the other day, I realized that

  • uBlock origin (and friends) are impressive, if not critical extensions;
  • Many other popular extensions like FoxyProxy are easily superseded by Nyxt core;
  • Most other extensions are not that useful or clearly outperformed by Nyxt.

So...

  1. We should conduct a survey + have a look at the most popular extensions.
  2. If the conclusion is that extensions are used mostly for Adblocking, then, maybe it would wiser to focus on our own implementation of uBlock origin instead of implementing WebExtension support. After all, it would certainly be easier! :p Of course we would add some some automatic updater for the rules.

Ambrevar avatar Mar 24 '23 15:03 Ambrevar

I do not mean by this to drop WebExtensions altogether, but that dropping it for 3.0 might still make it possible for us to overpower blocker-mode to the level of uBlock, which would fix one of Nyxt's biggest flaws and would make us way less dependable on WebExtension support.

Ambrevar avatar Mar 24 '23 15:03 Ambrevar

I think the benefit of pursuing WebExtension support is mainly psychological, not functional. If we have it in place, then Nyxt stands as a good citizen in the browser's space and their interoperability.

Say that, functionally, we provide all of the features of a popular extension like uBlock origin. Still, psychologically, it's radically different. People tend to think in terms of what they could lose, and not in terms of potential gains. It's easier for users to take familiar extensions to a new browser, than having to learn how to use an analog.


I agree with you:

  • WebExtensions support for 3.0 is out of scope;
  • Survey users about which functionality found in extension they miss the most;
  • Act based on the point above by setting a realistic goal for 3.0.

aadcg avatar Mar 24 '23 15:03 aadcg

Yes, adblocking matters. But the exact implementation (uBlock (Origin), AdBlock (+) etc.) doesn't, if it's good enough. Much like qutebrowser became less dependent on WebExtensions support with the addition of Brave Rust adblocker, we ourselves can

  • hone our blocker-mode with AdBlock+/uBlock syntax parsing and speedups (right now it slows requests down by up to one second),

  • or leverage WebKit primitives for content filtering (spoiler: they are actually quite good).

So yes, if we don't have WebExtensions, we may still cover lots of cases for these with user scripts (#2813) and proper rule parsing in blocker-mode

aartaka avatar Mar 25 '23 15:03 aartaka

Most of the firefox addons I use could be easily rewritten in CL for nyxt. I'm assuming that would be the case for many (most?) addons, so the question then becomes: is it more work to provide WE3 support than it is to rewrite all those plugins for nyxt?

The point about the psychological impact of having no WE support is valid, but I think should be left out from the "calculation" above.

Additionally, I'm a huge fan the of multi-account-containers/temporary-containers addons (not having the former of the 2 is a deal-breaker for my use cases). Does nyxt even provide the foundation that would allow for something that either via the hypothetical WE support or through a nyxt-native plugin?

FWIW, I'm very much cheering for nyxt to succeed!!

peterhoeg avatar Mar 29 '23 04:03 peterhoeg

Additionally, I'm a huge fan the of multi-account-containers/temporary-containers addons (not having the former of the 2 is a deal-breaker for my use cases). Does nyxt even provide the foundation that would allow for something that either via the hypothetical WE support or through a nyxt-native plugin?

That is possible with "contexts" that we already have. See make-buffer-with-context command. The API is somewhat under-developed, but we're in the process of rethinking it. See #2812 for the discussion.

aartaka avatar Mar 29 '23 10:03 aartaka

Additionally, I'm a huge fan the of multi-account-containers/temporary-containers addons (not having the former of the 2 is a deal-breaker for my use cases). Does nyxt even provide the foundation that would allow for something that either via the hypothetical WE support or through a nyxt-native plugin?

Nyxt core is already designed around these ideas. (See WebKit contexts and profiles.) It's mostly the user-facing interface that's lacking, but there are some examples that are avilable out of the box, see nosave buffers for instance.

Ambrevar avatar Mar 29 '23 10:03 Ambrevar

We should conduct a survey + have a look at the most popular extensions.

@Ambrevar -- I might be able to help. what precisely is the central question you want answered? {perhaps: which web extensions prevent nyxt adoption, which web extensions are people excited to build in CLOS/nyxt, which web extensions are... }

lansingthomas avatar Apr 11 '23 15:04 lansingthomas

Perhaps "which web extension are you missing the most in Nyxt?". From the answers we can extract the kind of functionality people are missing out.

aadcg avatar Apr 11 '23 15:04 aadcg

Agreed.

Ambrevar avatar Apr 13 '23 09:04 Ambrevar

on the topic of another implementation of ublock-origin: one could base this off nx-router, but the repo seems to be gone, I still have a clone

CorruptedVor avatar Apr 19 '23 07:04 CorruptedVor

Mind sharing this clone somewhere? (E.g. GitHub)

Ambrevar avatar Apr 19 '23 08:04 Ambrevar

on the topic of another implementation of ublock-origin: one could base this off nx-router, but the repo seems to be gone, I still have a clone

It's not gone, just moved to Sourcehut: https://git.sr.ht/~conses/nx-router

aartaka avatar Apr 19 '23 09:04 aartaka

Dead link :(

Ambrevar avatar Apr 19 '23 09:04 Ambrevar

on the topic of another implementation of ublock-origin: one could base this off nx-router, but the repo seems to be gone, I still have a clone

It's not gone, just moved to Sourcehut: https://git.sr.ht/~conses/nx-router

indeed it isn't, https://git.sr.ht/~mmoreno/nx-router

As far as I can tell it can block/redirect/etc by

  • domains
  • regex of the URL
  • filetype

Afaik, regex is the essential part as ublock also does that.

CorruptedVor avatar Apr 19 '23 12:04 CorruptedVor

@CorruptedVor Hi, I'm the author of nx-router. The extension is more geared towards being a convenient way to define resource handlers like redirects (think url-dispatching-handler but more elaborate), and under the hood, it uses the same API that blocker-mode does, so IMO the effort should be directed towards improving that

ghost avatar Apr 24 '23 13:04 ghost

Unsure if there's indeed a survey yet, but would love to take it.

In my opinion extensions are a must for any modern web browser. They extend the capabilities of a browser immensely and improve your web experience. For example, host based ad blocking does not block YouTube ads, nor does it block sponsored segments. Auto agreeing to cookies is also something I'd consider a must have. I'm sure there are other must-haves for other people and I'd strongly would push for extension support. It is the only thing that is keeping me from using Nyxt as my main browser right now.

I don't know any Lisp, but willing to learn or help in any other way to help make this a reality. :)

jorisvandijk avatar May 14 '23 07:05 jorisvandijk

@jorisvandijk To clarify, the point of the original post is that if we (ever) get blocker-mode on par with, say, uBlock Origin, then the need to support the WebExtension standard (so extensions that run on Firefox, Chrome, etc.) becomes much less relevant.

Auto-accepting cookies could also be done in pure-Lisp.

Ambrevar avatar May 14 '23 07:05 Ambrevar

I used to use Nyxt(Next) for a short while, but the lack of privacy features deterred me from staying on it. There exist a whole slew of add-ons in Firefox to regain a modicum of privacy. DecentralEyes, ClearURL, PrivacyBadger or CanvasBlocker to name a few. Without tease I feel like I would sacrifice too much privacy for a better UI.

These add-ons are also all recommended by Firefox, so they get vetted to some extent. If all these features were rebuilt in CL, there would still be the issue of trust - who has time to check browser plugin updates themselves?

Firefox also has a lot of built-in settings - like separated cookies per domain - that are immensely important for privacy.

I really like this project, but I feel for anyone marginally interested in privacy, Nyxt isn't daily drivable.

Fenlair avatar May 14 '23 17:05 Fenlair

You have to keep in mind that merely having js enabled already puts your privacy at risk. See https://coveryourtracks.eff.org/ for terms to look up and text to read. As far as I know, no browser mitigates this effectively[1] while having js enabled, but I don't know every browser's js engine.

Edit: [1] It's subjective what you consider to be effective, here is eff's take: https://coveryourtracks.eff.org/about

CorruptedVor avatar May 14 '23 20:05 CorruptedVor

DecentralEyes helps against the super broadly used js libraries from google or cloudflare. PrivacyBadger helps as well. Also JS libraries aren't the only cross-site tracking mechanism. Containerize cookies per domain help, CanvasBlocker helps against fingerprinting, ClearURL helps against jump links. I'm not claiming Firefox or any other browser has the perfect blend of privacy and usability (because just disabling js is a huge pain) - but there are a lot of vetted libraries to alleviate the privacy issue.

Also, I would miss SponsorBlock D:

Fenlair avatar May 14 '23 20:05 Fenlair

For me ublock is pretty important and it would be enough. But I also use "EasyScreenshot" every day which allows me to take full page screenshots including out of scroll content, as well as midnight lizard which allows me to use dark mode on pages that don't support it. Other than that, obviously things like surfkeys aren't necessary in nyxt :)

timthelion avatar May 20 '23 16:05 timthelion

Firefox also has a lot of built-in settings - like separated cookies per domain - that are immensely important for privacy.

Nyxt supports this.

Ambrevar avatar May 22 '23 15:05 Ambrevar

But I also use "EasyScreenshot" every day which allows me to take full page screenshots including out of scroll content, as well as

I'm pretty sure that WebKit has some API for that. We don't have it bound/implemented yet, though.

midnight lizard which allows me to use dark mode on pages that don't support it.

You might want to check out https://github.com/aartaka/nx-dark-reader :)

aartaka avatar May 23 '23 12:05 aartaka

I want to emphasize that there are two separate advantages for foreign extensions:

  1. Getting crucial functionality, that is difficult to replicate, e.g. complicated privacy techniques.
  2. Outsourcing vetting of such extensions.

Some elaboration on the second point: Extensions that aren't easily replicated come with complexity, that can't easily be vetted by everyone. I for myself, don't install extensions in Firefox which aren't recommended by Mozilla - I don't have the time to read through every extension and I wouldn't want to install any extensions without some level of quality control. Being able to pull in extensions from a major browser would allow tapping into their quality control system.

I wouldn't surf the modern internet without web extensions, even if I had to give up a sane UI for it. But that's just my personal opinion.

Fenlair avatar May 25 '23 12:05 Fenlair

A very interesting angle we hadn't adequately evaluated. Thank you @Fenlair , will ponder on this!

jmercouris avatar May 25 '23 21:05 jmercouris

It’s probably also fairly safe to assume that the target audience for nyxt are predominantly firefox users today. Of those users, we can also assume that the majority will be using one or more addons. At least one of those addons is bound to provide functionality that when not available on nyxt will be a deal-breaker.

I really, really want to move to nyxt but presently I am depending on a number of firefox addons that I simply will not operate a browser without. The web has become an unbelievable shit-show without (IMHO).

peterhoeg avatar May 26 '23 02:05 peterhoeg

I want to echo @peterhoeg last sentence, for me this feature is the only thing that is keeping me from moving on to nyxt. As much as I am attracted to a fully hackable browser, I don't have the time (and arguably the skill :laughing: ) to replicate all the extensions that I consider essential in common-lisp. I do wonder how many more people have similar feelings.

danilevy1212 avatar May 26 '23 12:05 danilevy1212

You have to keep in mind that merely having js enabled already puts your privacy at risk. See https://coveryourtracks.eff.org/ for terms to look up and text to read. As far as I know, no browser mitigates this effectively[1] while having js enabled, but I don't know every browser's js engine.

Edit: [1] It's subjective what you consider to be effective, here is eff's take: https://coveryourtracks.eff.org/about

A plain-text reader mode would be awesome. Like the reader mode in Firefox, but without the "save-do-disk" feature; also an always on feature. You'd only have to grab the text from p tags etc.

Web-Ext support is why I stay on Firefox. They also have other features. Isn't Nyxt suppose to be engine agnostic? Forgive my ignorance, but where about in the "model" do these features lie -- if you supported the Firefox "engine", does that include other "backend" features like Web-Ext, or special cookie management features?

I've always thought Firefox would be perfect if someone just rewrote the UI with a native Vim (or Emacs+Evil) mode for everything, and native plugins.

xbc5 avatar Jun 11 '23 12:06 xbc5

So far, it seems people want extensions beyond ad-block.

A similar situation to Xorg -> Wayland - one should switch, but do not break stuff and make people rewrite their stuff. In that sense it's a negative example, because you can't re-use application code written for Xorg as-is. Tl;dr huge backlash, and it's still going.

CorruptedVor avatar Jun 11 '23 15:06 CorruptedVor

Any progress on the survay?

wanderer avatar Sep 15 '23 14:09 wanderer