-
-
Notifications
You must be signed in to change notification settings - Fork 320
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: Allow setting extension path for Windows and Linux #1403
Conversation
Package Changes Through 3b4905bThere are 1 changes which include wry with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Thank you |
Oh looks like you didn't sign your commits and I can't merge the PR unless they are signed. You need to setup commit signing, then you can sign past commit like this. |
b3b62de
to
6d23c17
Compare
One day I will remember to add |
🤣 , I have my global
|
@SpikeHD @amrbashir I attempted to launch a window to load the following extension: https://microsoftedge.microsoft.com/addons/detail/vuejs-devtools/olofadcdnkkjdfgjcmjaadnlehnnihnl
However, when I use Wry on Windows and call When I attempt to enable both Even when I only enable Of course, I’ve also tried using the By the way, I noticed that using the How can I resolve this issue? Thank you again for helping me. |
I've done some digging, and it seems Changing that to have an empty handler function fixes your example:
// Iterate over all folders in the extension path
for entry in fs::read_dir(extension_path)? {
let path = entry?.path();
let path_hs = HSTRING::from(path.as_path());
let handler = ProfileAddBrowserExtensionCompletedHandler::create(Box::new(|_, _| Ok(())));
profile.AddBrowserExtension(&path_hs, &handler)?;
} Keep in mind @zhangsan2lisi that the path you are providing should be a folder where all extensions reside, even if it is just one. For example, this would fail:
let webview = WebViewBuilder::with_web_context(&mut context)
.with_extension_path(PathBuf::from("extension")) but this would succeed:
let webview = WebViewBuilder::with_web_context(&mut context)
.with_extension_path(PathBuf::from("extensions")) because the function reads the files/folders within the provided directory as extensions, not the folder itself. I will make a PR soon to address the |
@SpikeHD Thank you for your help. I have successfully used it. |
Introduces
with_extension_path
, which is now used by Windows and Linux to load extensions from.Linux doesn't include
browser_extensions_enabled
because there is no setting to turn them on or off in WebkitGTK, only to set their directory. I assume if no directory is set, then no extensions are loaded from anywhere, so the option would be redundant.