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

feat(windows, linux): Add with_extension_path to WebviewBuilder #11628

Merged
merged 8 commits into from
Nov 12, 2024
Merged

feat(windows, linux): Add with_extension_path to WebviewBuilder #11628

merged 8 commits into from
Nov 12, 2024

Conversation

SpikeHD
Copy link
Contributor

@SpikeHD SpikeHD commented Nov 9, 2024

Now that tauri-apps/wry#1403 has been merged, it's time to bring it to the Tauri side!

Adds a function to the WebviewBuilder that sets the extension path. On Windows, the directory should contain unpacked Chrome extensions. On Linux, it should contain compiled .so extensions.

@SpikeHD SpikeHD requested a review from a team as a code owner November 9, 2024 05:24
Copy link
Contributor

github-actions bot commented Nov 9, 2024

Package Changes Through 3c495ed

There are 6 changes which include tauri with patch, tauri-cli with patch, tauri-runtime with patch, tauri-runtime-wry with patch, tauri-utils with patch, @tauri-apps/cli with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.1.0 2.1.1
tauri-bundler 2.1.0 2.1.1
tauri-runtime 2.2.0 2.2.1
tauri-runtime-wry 2.2.0 2.2.1
tauri-codegen 2.0.3 2.0.4
tauri-macros 2.0.3 2.0.4
tauri-plugin 2.0.3 2.0.4
tauri-build 2.0.3 2.0.4
tauri 2.1.1 2.1.2
@tauri-apps/cli 2.1.0 2.1.1
tauri-cli 2.1.0 2.1.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@SpikeHD
Copy link
Contributor Author

SpikeHD commented Nov 12, 2024

Should be fixed now 👍

amrbashir
amrbashir previously approved these changes Nov 12, 2024
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@amrbashir amrbashir merged commit dc4d794 into tauri-apps:dev Nov 12, 2024
2 of 3 checks passed
@MulverineX
Copy link

MulverineX commented Feb 27, 2025

This is really useful, I'm curious though, what exactly are the compiled .so binaries for Linux in this context, and how are they an equivalent here? Are they applied directly to webkit2gtk for calling webkit APIs?

Is there an equivalent API to AddBrowserExtension in WebKit? Or more efficient methods of establishing content blocking/simulated extension APIs?

Finally, will you be looking into supporting other platforms in any way here?

@FabianLars
Copy link
Member

This is really useful, I'm curious though, what exactly are the compiled .so binaries for Linux in this context, and how are they an equivalent here? Are they applied directly to webkit2gtk for calling webkit APIs?

I think this https://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/ was the best intro to webkitgtk's extensions i found when i tried it out a few years ago for #4912 (comment) a noteworthy part of my comment there:
"WebExtensions (not to be confused with the WebExtensions API)" (context for the content blocking question)

Is there an equivalent API to AddBrowserExtension in WebKit?

No, webkitgtk loads all extensions it finds in the path.

Or more efficient methods of establishing content blocking/simulated extension APIs?

Also no. the epiphany project (browser using webkitgtk) has experimental WebExtension API support https://blog.tingping.se/2022/06/29/WebExtensions-Epiphany.html but the most important(?) api for content blocking webRequest is not implemented. Also, this is for epiphany specifically, and not webkitgtk as a whole so not really helpful.

Finally, will you be looking into supporting other platforms in any way here?

No. This is not up to us.

@MulverineX
Copy link

MulverineX commented Feb 27, 2025

Looks like this is where one would have to start for manually implementing adblocking https://gitlab.gnome.org/GNOME/epiphany/-/blob/main/embed/ephy-filters-manager.c?ref_type=heads

And if you want full extensions:

(Extension support in epiphany is close-ish, these being the main blocking issues. If these are completed it would be possible to port the code to a native WebExtension .so for tauri)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants