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 control with SWT.EDGE: "Save as"-Dialog does not open #1285

Closed
manmuenz opened this issue Jun 18, 2024 · 3 comments
Closed

Browser control with SWT.EDGE: "Save as"-Dialog does not open #1285

manmuenz opened this issue Jun 18, 2024 · 3 comments

Comments

@manmuenz
Copy link

manmuenz commented Jun 18, 2024

Important

If you are reporting a crash on Linux, please check if webkit is mentioned in the crash file.
If yes, please try to set WEBKIT_DISABLE_COMPOSITING_MODE=1 and/or WEBKIT_DISABLE_DMABUF_RENDERER=1 environment variables.
If they prevent crashes, don't report the bug please, it is already known as #843

Describe the bug
The problem startet with a WebView2-Update in March.
last working version: 122.0.2365.52 (Release: 23.2.2024)
first version where we detected the bug: 122.0.2365.80 (Release: 07.3.2024)

In an Eclipse RCP application with a Browser control with SWT.EDGE in a view, in that view the "Save as" dialog does not open when selected, but leaves the view broken.
When opening another Browser control out of the first without SWT control (no swt.browser.OpenWindowListener) the "Save as"-Dialog in the PopUp works as expected.
Opening PopUps out of the first view with swt.browser.OpenWindowListener the "Save as" behavior in the popup is just as buggy as in the first view.

Current Edge-Implementation:
https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Browser/win32/org/eclipse/swt/browser/Edge.java
expects
WebView2 Version 99.0.1150.38 (Code-Comment: // WebView2Loader.dll compatible version. This is NOT the minimal required version.)
This version is quite old.

To Reproduce
import ...
public class EmbeddedBrowserSaveAs {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());

    Browser browser = new Browser(shell, SWT.EDGE);
    browser.setLayout(new FillLayout());
    browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    browser.setUrl("https://www.duckduckgo.com/");

    shell.setSize(800, 600);
    shell.setLocation(100, 100);
    shell.open();

    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}

}

Expected behavior
"Save as" dialog opens as expected:

grafik

Screenshots

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)
    Windows: 10.0.19045 Build 19045
    WebView2 runtime: since 122.0.2365.80, current version: 125.0.2535.92

  2. JRE/JDK version
    OpenJDK 17.0.11

Version since
SWT 3.120.0 from Eclipse - 4.24(2022-06)
We tested also with Eclipse - 4.30(2023-12) and got the same buggy behavior.

Workaround (or) Additional context

@Phillipus
Copy link
Contributor

Phillipus commented Jun 18, 2024

FWIW the "Save As" dialog is working OK for me with this setup:

Windows 11
WebView2 runtime 125.0.2535.92
SWT 3.126.0.v20240528-0813 (Eclipse 4.32 2024-06)

@manmuenz
Copy link
Author

@Phillipus
Thank you for your comment! It was very helpful:
Works for me too with Windows 10 and SWT 3.126.0.v20240528-0813 (Eclipse 4.32 2024-06).
As we are going to update the targetplatform of our RCP-Clients soon, this solves the problem for us.

@Phillipus
Copy link
Contributor

My tests show that this was fixed as a result of b5e86e3

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

No branches or pull requests

2 participants