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

Browser Integration: On windows use JNA and follow users browser choice for default browser #8224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthiasblaesing
Copy link
Contributor

@matthiasblaesing matthiasblaesing commented Feb 5, 2025

This reduces the amount of native code that needs to be shipped with
NetBeans and allows to support running on more platforms.

The DDE based control was completely removed as in tests MS Edge,
Google Chrome and Mozilla Firefox all did not support DDE.

In addition the code to query the registry keys for the default browser
was updated to consider the users browser selection.

Closes: #8218
Closes: #3960
Closes: #6626

@matthiasblaesing matthiasblaesing added Platform [ci] enable platform tests (platform/*) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) web [ci] enable web job labels Feb 5, 2025
@matthiasblaesing matthiasblaesing added this to the NB26 milestone Feb 5, 2025
@matthiasblaesing matthiasblaesing changed the title Drop native libraries for browser control and use JNA Browser Integation: Drop native libraries for browser control and use JNA Feb 5, 2025
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

changes look good to me - dropping custom native libs is always good to see since it makes maintenance much easier.

I suppose the reason why -J-Dorg.netbeans.modules.extbrowser.UseDesktopBrowse=true didn't work for the user was because the exception happened in a static initializer so the logic gave up before being able to switch to the JDK impl.

@mbien

This comment was marked as resolved.

@mbien
Copy link
Member

mbien commented Feb 13, 2025

#3960 can be likely also linked with this PR (unfortunately I can't easily test this)

@matthiasblaesing matthiasblaesing changed the title Browser Integation: Drop native libraries for browser control and use JNA Browser Integration: On windows use JNA and follow users browser choice for default browser Feb 15, 2025
@matthiasblaesing
Copy link
Contributor Author

@mbien thank you for comments. Updated the code accordingly. The now third commit makes the changes to follow users choice of browser. I tested with Firefox, Edge, Opera and Chrome on Windows 10. Changing browser after NetBeans opened the first browser window will not pick up changes in the default browser, but after a restart of NetBeans new browser preferences are picked up. The issue was, that the old code only queried the global registry paths, not the user specific preferences. The whole registry poking for the default value was replaced by using AssocQueryString, which does "the right thing".

@michelecos, @pontushenriksson, @hellsing71, @kamilkrzywanski, @dragonsKnight5 you all commented on #3960, so it would be great if you could test the dev build available from https://github.com/apache/netbeans/suites/34437970812/artifacts/2597699302 (or via the checks page or this PR)

This reduces the amount of native code that needs to be shipped with
NetBeans and allows to support running on more platforms.

The DDE based control was completely removed as in tests MS Edge,
Google Chrome and Mozilla Firefox all did not support DDE.

Closes: apache#8218
…ml instead of manually poking registry

The function correctly handles user settings, instead of relying on
system wide settings (that are not changed when user changes his default
browser).
@matthiasblaesing
Copy link
Contributor Author

I intent to merge this next week unless objections are raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) os:windows Platform [ci] enable platform tests (platform/*) web [ci] enable web job
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browser is not found. UnsatisfiedLinkError (Windows, aarch64) Default browser on Windows
2 participants