Skip to content

[Edge] Browser.clearSessions() throws exception when no Edge is open #1592

@N1k145

Description

@N1k145

Describe the bug
Exception is thrown when Browser.clearSessions() is called before the Browser is rendered.
This is a new behaviour in the current I Build compared to the last release (2024-09)

!ENTRY org.eclipse.ui.browser 4 0 2024-11-13 12:51:38.734
!MESSAGE Not implemented [WebView2: cookie access requires a Browser instance]
!STACK 0
org.eclipse.swt.SWTError: Not implemented [WebView2: cookie access requires a Browser instance]
	at org.eclipse.swt.SWT.error(SWT.java:4947)
	at org.eclipse.swt.browser.Edge.getCookieManager(Edge.java:474)
	at org.eclipse.swt.browser.Edge.lambda$0(Edge.java:86)
	at org.eclipse.swt.browser.WebBrowser.clearSessions(WebBrowser.java:265)
	at org.eclipse.swt.browser.Browser.clearSessions(Browser.java:220)
	at org.eclipse.ui.internal.browser.BrowserViewer.<init>(BrowserViewer.java:240)
	at org.eclipse.ui.internal.browser.WebBrowserView.createPartControl(WebBrowserView.java:51)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)

To Reproduce
Change the Code of the BrowserViewer:
grafik
(Also change the catch block to report the exception)
Try to open the Internal Browser View

Expected behavior
No exception is thrown, like in the last release.
When the call can not work, maybe log a warning/error instead

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)
    Edge Browser with -Dorg.eclipse.swt.browser.DefaultType=edge

  2. JRE/JDK version
    org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_22.0.2.v20240802-1626

Version since
I20241112
Did not test earlier I Builds
2024-09 was fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    edgeEdge BrowserregressionSomething that used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions