Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Chrome-based renderer #2989

Open
aadcg opened this issue May 28, 2023 · 19 comments
Open

Support Chrome-based renderer #2989

aadcg opened this issue May 28, 2023 · 19 comments
Assignees
Labels
4-series Related to releases whose major version is 4. ffi Renderer-specific quirks.

Comments

@aadcg
Copy link
Member

aadcg commented May 28, 2023

WebKitGTK has enabled us to mature Nyxt, but it is undeniable that its performance as a web renderer is subpar when compared to Chrome-based ones. This is particularly noticeable in resource intensive tasks such as watching a video on YouTube.

Supporting new renderers is in itself beneficial since it puts Nyxt's API under the test. As a remainder, Nyxt is renderer agnostic.

To achieve this goal there are two alternatives: CEF or Electron. The former has proved to be tough to achieve, while the latter seems promising.

WebKitGTK will continue to be supported.

This move will also helps us to distribute Nyxt on MacOS and Windows.

@aartaka
Copy link
Contributor

aartaka commented May 29, 2023

There's always QtWebEngine as yet another Chromium wrapper that's more or less ethical and modularized. Just that it's C++ and pain to bind to (⌒_⌒;)

@LinArcX
Copy link

LinArcX commented May 31, 2023

Really? Electron?

Did you measure performance?

@aadcg
Copy link
Member Author

aadcg commented May 31, 2023

@LinArcX performance is certainly an important factor. But the ability to easily write Lisp bindings is actually the most important aspect to achieve this goal.

Others can expand on the technical issues, if you'd like to :)

@aartaka
Copy link
Contributor

aartaka commented May 31, 2023

Yep, ease of Lisp bindings is the main feature for us, because we don't have:

@fnicastri
Copy link

fnicastri commented Jun 7, 2023

I really like the idea of Nyxt and I would like to be capable to use it on Mac but,
honestly, Electron would be probably a bad choice.

@aadcg
Copy link
Member Author

aadcg commented Jun 7, 2023

@fnicastri Would you like to expand? Thanks.

@Haider-Mirza
Copy link

The Vieb browser also uses electron, it uses it well and I find electron to be a promising option especially if it provides easy Lisp bindings.

The faster speeds would be nice :)

@aadcg
Copy link
Member Author

aadcg commented Jun 8, 2023

@Haider-Mirza that remark is spot on!

@LinArcX
Copy link

LinArcX commented Jun 8, 2023

I don't understand the word of "promising".

Guys, you are not creating a toy tool. This is a browser.

We're living in a world that most people's work migrated to the web. So look at nyxt as an operating system.

Performance matters and it matters a lot in your domian.

Please don't waste your time and efforts with "promising" technologies.

@ILoveGoulash
Copy link

ILoveGoulash commented Jun 9, 2023

Are there numbers about the performance gap relevant to real world use? What about complexity (incl. bloat) or features (e.g. the recently talked about JPEG XL thing)? Is supporting more than one implementation going to be a massive pain in the "glue" part of the code? Webkit seems to be more suited to CL in spirit: much more conservative than Blink (same for jscore vs v8).

Not that, as a beggar, my opinion matters much, but personally, I'd focus on reaching a good "feature complete" state (whatever that means; for most, it's having a proper (not hostfile based) adblocker) before thinking about such a big endeavour.

Also, even if Electron is only the rendering part of Chromium, I'd try to make sure that all the Google spyware that ungoogled-chromium or qtwebengine had to remove stays gone.

@aartaka
Copy link
Contributor

aartaka commented Jun 9, 2023

Guys, you are not creating a toy tool. This is a browser. We're living in a world that most people's work migrated to the web. So look at nyxt as an operating system.

We already do. And, much like an operating system doesn't care about the graphic chip or OpenGL version that's installed on one's machine (I'm somewhat exaggerating, but still), we don't really care about what renderer is there, as long as it works and allows us to build this exact Nyxt system.

Performance matters and it matters a lot in your domian.

That's exactly why we look into Electron: it's basically Chromium torn apart to be embeddable anywhere. And, however painful it is to acknowledge that for me:

  • Chromium is the fastest and the most web-friendly web engine.
    • Yes, that's because Google is a freaking monopolist enforcing their "vision" onto the Web.
    • Yes, it eats hella lot of RAM, but it fullfills its promises in runtime performance and rendering.
    • But it gives lots of benefits hard to achieve with any other engine:
      • Proper rendering of any webpage.
      • Being cross-platform. Like, truly cross-platform.
      • And being easy to instrumentalize.

The notoriety of Electron is the consequence of it being used in a really wrong way: as GUI for desktop application. It's slow, it's resource-heavy, it's not really configurable and accessible... for a desktop GUI. It's intended to be a browser engine, not a GUI. And that's why we picked it as the renderer for Nyxt: it's a browser engine. Intended to be a basis for a browser, just gone astray into the land of desktop and wreaking havoc there.


As it's been already stated above, the main thing we look for in the new engine is ease of bindings and maintenance. So, if someone is religiously opposed to Electron (as a browser engine, not as a desktop GUI framework—because the latter I'm opposed to too) to a degree sufficient to spend their time helping us find alternatives and work on them—we'll be glad to accept any contribution. Two directions that we abandoned because of the terrible time we spent binding them were:

  • QtWebEngine.
  • and Chromium Embedded Framework.

So if someone has enough experience with these (or any other technology we're unaware of) to help us bind those to Nyxt, then I myself (and, likely, other team members too) will happily ditch Electron and help this person in making a better port for Nyxt.

But, until that happens, Electron is our best bet, given the resource/expertise restrictions we have on the team.

@aadcg
Copy link
Member Author

aadcg commented Jun 9, 2023

The notoriety of Electron is the consequence of it being used in a really wrong way

Precisely!

@fnicastri
Copy link

fnicastri commented Jun 10, 2023

Thanks for the explanation, it makes more sense now.
Still hope one day another way will open...
Maybe another, lighter, electron-like one that use the already installed engine?
Or Servo...?

Anyway can't wait to use it on Mac ;)

@Gavinok
Copy link
Contributor

Gavinok commented Jun 10, 2023

Have a look at servo on its own and you will see it's no where near ready. It's currently as slow as molasses and even less stable than WebKit.

I worked on porting it to Nyxt and it wasn't long before I realised it's a lost cause

@fnicastri
Copy link

What I meant was: maybe in the future Servo will be an option, I know it's not stable nor
workable for now.

@moumn-almunawy
Copy link

Why not use tauri?

@aadcg
Copy link
Member Author

aadcg commented Jul 19, 2023

From my cursory look, tauri uses WebKitGTK for GNU/Linux. Nyxt already uses it today directly, without a middle man. Thanks for the tip, but I don't see how it could help us in supporting a new web renderer.

This was referenced Aug 14, 2023
@aadcg aadcg mentioned this issue Sep 4, 2023
7 tasks
This was referenced Jan 29, 2024
This was referenced Feb 13, 2024
@AlexanderMaxRanabel
Copy link

Its kind of a bummer that we cannot have browsers without Chromium these days

@ed9w2in6
Copy link

ed9w2in6 commented Jul 9, 2024

@AlexanderMaxRanabel
It seems that Chromium is more secure though: https://madaidans-insecurities.github.io/firefox-chromium.html

And personally I found that Chromium looks better on across different OSs when compared to Firefox.

That being said I'm using a mac and the webkit-based Safari mostly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4-series Related to releases whose major version is 4. ffi Renderer-specific quirks.
Development

No branches or pull requests