Thursday, August 28, 2025

Re: How to remove/avoid unsafe-eval in GWT with CSP?

Sounds like you're hitting this:  https://github.com/gwtproject/gwt/issues/9578

On Friday, 29 August 2025 at 3:35:25 pm UTC+10 Deepali Sharma wrote:

Hi all,

I am working on a GWT application and facing issues with Content Security Policy (CSP). Currently, GWT uses eval() (or similar dynamic code execution), which means I need to allow unsafe-eval in my CSP. Without this, the page does not load at all.

This is causing repeated failures in application security scans, since unsafe-eval is considered a security risk.

  • Is there a way to remove or avoid unsafe-eval in GWT?

  • Does GWT provide a CSP-compliant compilation mode or configuration to handle this?

  • If yes, how can I enable it in my project (Maven/GWT config)?

Any guidance or best practices to make GWT work with CSP without unsafe-eval would be really helpful.

Thanks!

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/8e0d4b7a-f84d-4a05-858e-988a8f931da6n%40googlegroups.com.

How to remove/avoid unsafe-eval in GWT with CSP?

Hi all,

I am working on a GWT application and facing issues with Content Security Policy (CSP). Currently, GWT uses eval() (or similar dynamic code execution), which means I need to allow unsafe-eval in my CSP. Without this, the page does not load at all.

This is causing repeated failures in application security scans, since unsafe-eval is considered a security risk.

  • Is there a way to remove or avoid unsafe-eval in GWT?

  • Does GWT provide a CSP-compliant compilation mode or configuration to handle this?

  • If yes, how can I enable it in my project (Maven/GWT config)?

Any guidance or best practices to make GWT work with CSP without unsafe-eval would be really helpful.

Thanks!

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/006d142f-f80d-4b59-b67c-6bf3327a71d0n%40googlegroups.com.

Domino-ui 2.0.5 released

Domino-ui 2.0.5 have been released with many bug fixes and enhancements.
You can check the release notes here https://github.com/DominoKit/domino-ui/releases/tag/2.0.5

Demo application https://dominokit.com/domino-ui/demo/v2 have also been updated and deployed.

Enjoy!. 😀

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/1b66517f-dbdb-4462-9ec7-2ae08fbecdd1n%40googlegroups.com.

Tuesday, August 19, 2025

Re: Elemental2 WebRTC createOffer and createAnswer are incorrect

Following up on my own comment:  A request for a new build with updated closure externs has been made:  https://github.com/google/elemental2/issues/175

On Sunday, 20 July 2025 at 9:37:31 am UTC+10 Craig Mitchell wrote:
Now the good people at the closure-compiler have fixed the error ( https://github.com/google/closure-compiler/commit/5aadfa78592a2778ae4cac52613fb9238228b3e8 ), I see I can build a new version of Elemental2 locally ( https://github.com/google/elemental2?tab=readme-ov-file#build-gwt-compatible-maven-jar-files ).

It would be nice to get an offical Elemental2 build, and have it pushed to Maven.  It looks like one hasn't been done for 9 months, is there any offical Elemental2 release schedule?

On Tuesday, 15 July 2025 at 7:37:27 pm UTC+10 Craig Mitchell wrote:
Thanks Jens.  Bug raised:  https://github.com/google/closure-compiler/issues/4249

On Tuesday, 15 July 2025 at 6:49:06 pm UTC+10 Jens wrote:
And this works great.  But it would be nice to fix Elemental2.

You have to file an issue against closure-compiler because elemental2 takes their definition: https://github.com/google/closure-compiler/blob/15c5dd492cbb9dcdfd24d01f75b64e3e9b2291eb/externs/browser/w3c_rtc.js#L3586C23-L3586C44

-- J. 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/6d1d255c-fd80-4285-a99c-df045e6c73f2n%40googlegroups.com.

Re: Elemental2 doesn't support all calls?

Thanks Thomas.

I see w3c_vibration.js in the closure-compiler:  https://github.com/google/closure-compiler/blob/master/externs/browser/w3c_vibration.js

So it looks like the Elemental2 build needs to be updated to use w3c_vibration.js.

Issue raised:  https://github.com/google/elemental2/issues/177

On Tuesday, 19 August 2025 at 10:33:03 pm UTC+10 Thomas Broyer wrote:
Elemental2 is generated from the Closure Library definitions (with some overrides), so first Closure needs to be updated to include it, then Elemental2 needs to pick up the changes (assuming they are in a file that Elemental2 looks at; so sometimes Elemental2 build needs to be updated)

On Friday, August 15, 2025 at 1:03:39 AM UTC+2 ma...@craig-mitchell.com wrote:
The opening statement of Elemental2 says "Elemental2 provides type checked access to all browser APIs for Java code."

I went to use navigator.vibrate ( https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate ) and found Elemental2 doesn't have it.

Does anyone know why it's not there?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/d572e484-d79b-4011-8b6a-7a303f4c7f81n%40googlegroups.com.

Re: Elemental2 doesn't support all calls?

Elemental2 is generated from the Closure Library definitions (with some overrides), so first Closure needs to be updated to include it, then Elemental2 needs to pick up the changes (assuming they are in a file that Elemental2 looks at; so sometimes Elemental2 build needs to be updated)

On Friday, August 15, 2025 at 1:03:39 AM UTC+2 ma...@craig-mitchell.com wrote:
The opening statement of Elemental2 says "Elemental2 provides type checked access to all browser APIs for Java code."

I went to use navigator.vibrate ( https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate ) and found Elemental2 doesn't have it.

Does anyone know why it's not there?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/01f78ff9-3730-4412-b958-ecd6b1b93712n%40googlegroups.com.

Thursday, August 14, 2025

Re: Elemental2 doesn't support all calls?

btw:  This isn't a big deal, as JSInterop can easily do it:

import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface NavigatorVibrate {
  @JsMethod
  boolean vibrate(double milliseconds);
  @JsMethod
  boolean vibrate(double[] pattern);
}

NavigatorVibrate nav = Js.cast(DomGlobal.navigator);
nav.vibrate(80);

Just found it odd that this one thing (maybe others too?) is missing.

On Friday, 15 August 2025 at 9:03:39 am UTC+10 Craig Mitchell wrote:
The opening statement of Elemental2 says "Elemental2 provides type checked access to all browser APIs for Java code."

I went to use navigator.vibrate ( https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate ) and found Elemental2 doesn't have it.

Does anyone know why it's not there?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/2a4ebfb2-8081-4824-bb60-a910c3567867n%40googlegroups.com.

Elemental2 doesn't support all calls?

The opening statement of Elemental2 says "Elemental2 provides type checked access to all browser APIs for Java code."

I went to use navigator.vibrate ( https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate ) and found Elemental2 doesn't have it.

Does anyone know why it's not there?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/7997599e-0f3a-4a30-aa95-95e158ad0f05n%40googlegroups.com.

Tuesday, August 5, 2025

Re: Don't use the GWT mouse button constants with Elemental2

Thanks Jens.  Interesting that elemental2.dom.KeyboardEvent doesn't include keyCode or charCode.  I guess that's a good thing, so you can't use deprecated attributes.

On Monday, 4 August 2025 at 7:17:50 pm UTC+10 Jens wrote:
The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

JS KeyboardEvent has 

- key (number, the physical key on the keyboard)
- code (string, the final character on the keyboard after evaluating locale, keyboard layout and SHIFT / ALT / CTRL)
- keyCode (number, deprecated, the number does not represent the final character)
- charCode (number, deprecated, only available during keyPress event)

GWT uses keyCode for legacy reasons. You should always use code/key. But even if you use code/key you still have to take care if your application is international. A classic one is ALT + "/" as a keyboard shortcut which I cannot trigger at all for example.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/411462b8-032e-410b-80c1-a50cf81cc494n%40googlegroups.com.

Monday, August 4, 2025

Re: Don't use the GWT mouse button constants with Elemental2

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

JS KeyboardEvent has 

- key (number, the physical key on the keyboard)
- code (string, the final character on the keyboard after evaluating locale, keyboard layout and SHIFT / ALT / CTRL)
- keyCode (number, deprecated, the number does not represent the final character)
- charCode (number, deprecated, only available during keyPress event)

GWT uses keyCode for legacy reasons. You should always use code/key. But even if you use code/key you still have to take care if your application is international. A classic one is ALT + "/" as a keyboard shortcut which I cannot trigger at all for example.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/ca2b1c1e-6585-4bef-8ab0-dac690895dc1n%40googlegroups.com.

Re: Don't use the GWT mouse button constants with Elemental2

These constants are expected to be used with NativeEvent.getButton(). GWT's implementation translates 0, 1, 2 to 1, 2, 4. The values 1, 2, 4 had been used by IE.

See DOMImplStandard.eventGetButton(). 

-- J.

Craig Mitchell schrieb am Montag, 4. August 2025 um 03:36:12 UTC+2:
PSA:  GWT uses old mouse button constants in com.google.gwt.dom.client.NativeEvent:

public static final int BUTTON_LEFT = 1;
public static final int BUTTON_MIDDLE = 4;
public static final int BUTTON_RIGHT = 2;

These are not the correct values to use with Elemental2 elemental2.dom.MouseEvent.button.

JavaScript now uses https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button so these are the correct values:

public static final int BUTTON_LEFT = 0;
public static final int BUTTON_MIDDLE = 1;
public static final int BUTTON_RIGHT = 2;

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

I couldn't find any definitions for these new mouse buttons or key codes.  I still need to have a look at projects like Akasha and Elemento, as hopefully they fix these Elemental2 gotchas.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/7d90c4d8-496d-464d-9f15-48b6273bb369n%40googlegroups.com.

Sunday, August 3, 2025

Don't use the GWT mouse button constants with Elemental2

PSA:  GWT uses old mouse button constants in com.google.gwt.dom.client.NativeEvent:

public static final int BUTTON_LEFT = 1;
public static final int BUTTON_MIDDLE = 4;
public static final int BUTTON_RIGHT = 2;

These are not the correct values to use with Elemental2 elemental2.dom.MouseEvent.button.

JavaScript now uses https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button so these are the correct values:

public static final int BUTTON_LEFT = 0;
public static final int BUTTON_MIDDLE = 1;
public static final int BUTTON_RIGHT = 2;

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

I couldn't find any definitions for these new mouse buttons or key codes.  I still need to have a look at projects like Akasha and Elemento, as hopefully they fix these Elemental2 gotchas.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/cd71cff3-b9d5-47a4-a61f-9e69881b62c0n%40googlegroups.com.

Saturday, August 2, 2025

Re: Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

What works best for me is to;

1 - first establish the best sematic correct html for the component you want to implement. This is relevant wrt the current accessibility requirements. 

2 - style it with css so it is layed out how you want it (according to the UX best practices). 

3 - Implement Widgets to generate that specific html (using functional classes) and use that css for GWT.

The advantage of using widgets as opposed to uibinder is that you keep all logic and structure in the java domain. I find the java domain more practical to work with and maintain down the lifecycle of the application - but YMMV.
Plus I find it's easier to modify. I recently had to do a redesign of an existing GWT application to comply with the EU accessibility guidelines, and it was done in 2 weeks. None of the widget logic and interaction was changed. Just the tags they generate and a bit of structure rework (like for instance adding <section> tags here and there).

If you have no experience with 1 and 2 - that's where AI can help.

rg,

Leon.

Op zaterdag 2 augustus 2025 om 00:48:21 UTC+2 schreef Craig Mitchell:
Sorry, maybe you're asking, should you use the prebuilt GWT widgets ( https://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPanel ), or create your own based from HTML/CSS?   Personally, I like creating my own, as I have more control over them.  Or there is a third option and use a 3rd party widgets.

...actually, I'm still just guessing what you're after.  🙂

On Saturday, 2 August 2025 at 8:40:17 am UTC+10 Craig Mitchell wrote:
I'm a little unclear what advice you're after.  I'm not a professional UI designer, and I don't know your requirements, but my initial advice is: Using bottom tabs to open a sidebar is a little out of the ordinary.  But maybe it makes perfect sense in your situation.

Anyway, if you have a GWT question, I'm more than happy to help.

On Saturday, 2 August 2025 at 3:50:01 am UTC+10 divyanshu kumar wrote:

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/935e57e1-de22-45e1-b4ab-88235c3c15a5n%40googlegroups.com.

Friday, August 1, 2025

Re: Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

Sorry, maybe you're asking, should you use the prebuilt GWT widgets ( https://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPanel ), or create your own based from HTML/CSS?   Personally, I like creating my own, as I have more control over them.  Or there is a third option and use a 3rd party widgets.

...actually, I'm still just guessing what you're after.  🙂

On Saturday, 2 August 2025 at 8:40:17 am UTC+10 Craig Mitchell wrote:
I'm a little unclear what advice you're after.  I'm not a professional UI designer, and I don't know your requirements, but my initial advice is: Using bottom tabs to open a sidebar is a little out of the ordinary.  But maybe it makes perfect sense in your situation.

Anyway, if you have a GWT question, I'm more than happy to help.

On Saturday, 2 August 2025 at 3:50:01 am UTC+10 divyanshu kumar wrote:

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/e7f00e2f-a9bd-4d15-812d-5b7ade9df9c1n%40googlegroups.com.

Re: Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

I'm a little unclear what advice you're after.  I'm not a professional UI designer, and I don't know your requirements, but my initial advice is: Using bottom tabs to open a sidebar is a little out of the ordinary.  But maybe it makes perfect sense in your situation.

Anyway, if you have a GWT question, I'm more than happy to help.

On Saturday, 2 August 2025 at 3:50:01 am UTC+10 divyanshu kumar wrote:

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/a1973f33-1481-4dae-b763-48bd4b126f92n%40googlegroups.com.

Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/acc468a6-8ce5-4f53-897c-7243475ee273n%40googlegroups.com.

Re: Mixing Elemental2 with GWT Widgets

Someone here once did

https://github.com/akasha/akasha

which is similar to elemental2 but has a more natural Java API. For example for common event types specific methods had been added similar to GWT widgets.

But I don't know about the state and future of that library. Maybe you ask the maintainer about it. It might be an alternative for you but I am pretty sure it has other pain points, as always :)

-- J.

Craig Mitchell schrieb am Freitag, 1. August 2025 um 03:20:39 UTC+2:
Thanks Gerard, I'll check out Elemento.

Elemental2 is a little lacking on strongly typing events.  Eg: Adding this code:

myElement.addEventListener(BrowserEvents.MOUSEDOWN, event -> {
  MouseEvent mouseEvent = Js.cast(event);
  ...
});

I could mess up on the event name, or the typecast, and I wouldn't know until runtime.

And unless you read the JS docs, it's not obvious what event name, maps to what event object.

Having something that strongly types all the events, so it was obvious and stops you messing up, would be great.

On Thursday, 31 July 2025 at 11:17:54 pm UTC+10 Gerard Keiser wrote:
Elemento has event more event types, if you need: https://hal-console.gitbook.io/elemento/event-handlers

On Thursday, July 31, 2025 at 4:45:19 AM UTC-5 Jens wrote:
btw:  With addEventListener, we have to use hard coded strings for the event name.  Eg: 

img.addEventListener("load", e -> doStuff());

Or are there event name constants we can use somewhere?

GWT has com.google.gwt.dom.client.BrowserEvents but it is not a complete list.

-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/54288e20-58cf-4c74-98fd-6b429b24952dn%40googlegroups.com.