You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running SWT on Ubuntu 24.04 LTS with libwebkit2gtk 4.1 (default), Browser.setCookie always fails (returns false). It works with libwebkit2gtk 4.0 on earlier Ubuntu versions. This seems to be due to libwebkit2gtk 4.1 upgrading to libsoup 3 and SWT only supporting libsoup 2.
To Reproduce
Install "Eclipse IDE for RCP and RAP Developers" 2024-12 on Ubuntu 24.04 LTS
Run this SWT snippet in a Java project: (with swt.jar from swt-4.34-gtk-linux-x86_64.zip on the classpath)
package setcookietest;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class SetCookieTest {
public static void main(String[] args) throws Exception {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Browser browser = new Browser(shell, SWT.WEBKIT);
browser.setUrl("http://www.eclipse.org/swt");
browser.addProgressListener(ProgressListener.completedAdapter(_ -> {
boolean success = Browser.setCookie("cookie1=value1", "http://www.eclipse.org/swt");
System.out.println("setCookie: " + success);
System.exit(success ? 0 : 1);
}));
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Note that you get this output:
SWT WebKit: SoupURI == 0 when setting cookie
setCookie: false
Try the same on Ubuntu 20.04 LTS and get this output:
setCookie: true
Expected behavior
The same behavior on Ubuntu 24.04 LTS as on Ubuntu 20.04 LTS.
Environment:
Select the platform(s) on which the behavior is seen:
All OS
Windows
Linux
macOS
Additional OS info (e.g. OS version, Linux Desktop, etc)
Workaround (or) Additional context
Possibly there could be other incompatibilities with libsoup 3 than settings cookies.
The problem would likely be exposed by the test Test_org_eclipse_swt_browser_Browser.test_get_set_Cookies(), but this test seems to have been inadvertently disabled by 50da5ad since webkitGtkVersionInts is no longer initialized.
No known workaround, besides trying to manually downgrade libwebkit2gtk to 4.0.
The text was updated successfully, but these errors were encountered:
Describe the bug
When running SWT on Ubuntu 24.04 LTS with libwebkit2gtk 4.1 (default),
Browser.setCookie
always fails (returns false). It works with libwebkit2gtk 4.0 on earlier Ubuntu versions. This seems to be due to libwebkit2gtk 4.1 upgrading to libsoup 3 and SWT only supporting libsoup 2.To Reproduce
Expected behavior
The same behavior on Ubuntu 24.04 LTS as on Ubuntu 20.04 LTS.
Environment:
Ubuntu 24.04.1 LTS
OpenJDK 23.0.1 (org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_23.0.1.v20241024-1700/jre)
Version since
Support for Ubuntu 24.04 LTS is claimed as "Target Environment" for the Eclipse platform since 2024-09, see https://eclipse.dev/eclipse/development/plans/eclipse_project_plan_4_33.xml#target_environments, so it could count as a bug since Eclipse/SWT 4.33.
Workaround (or) Additional context
Possibly there could be other incompatibilities with libsoup 3 than settings cookies.
The problem would likely be exposed by the test
Test_org_eclipse_swt_browser_Browser.test_get_set_Cookies()
, but this test seems to have been inadvertently disabled by 50da5ad sincewebkitGtkVersionInts
is no longer initialized.No known workaround, besides trying to manually downgrade libwebkit2gtk to 4.0.
The text was updated successfully, but these errors were encountered: