First... you should update this to use jsinterop - consider just adding 
elemental2-dom to your project and calling DomGlobal.history.pushState(new 
Object(), "", historyRewrite); in plain Java?

To answer the question more directly, you probably need to change "window" 
to "$wnd" to access the actual outer window. Your current code, as written, 
is technically attempting to change the URL of the iframe that the app is 
loaded in.
On Tuesday, December 3, 2024 at 11:43:00 AM UTC-6 Lonzak wrote:

> I successfully updated GWT from 2.10.1 to 2.12.1.
> In Firefox everything works perfectly however not in chrome based 
> browsers. When I try to
> execute the following code:
>
> public static native int setHistory(String historyRewrite) /*-{
>
> window.history.pushState({}, '', historyRewrite);
>
> }-*/;
>
> *Error:*
> SEVERE: (SecurityError) : Failed to execute 'pushState' on 'History': A 
> history state object with URL 'https://company.url/home' cannot be 
> created in a document 
> with origin 'https://company.url' and URL 'about:blank'.
> com.google.gwt.core.client.JavaScriptException: (SecurityError) : Failed 
> to execute 'pushState' on 'History': A history state object with URL 
> 'https://company.url/home' cannot be created in a document with origin '
> https://company.url' and URL 'about:blank'.
>
> If I revert to GWT it works again.
> Any idea what changed (and how to fix it)? 
> Is the script maybe loaded before the document is fully loaded?
>
> 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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/google-web-toolkit/823d20ba-4973-436d-813d-815ec143a792n%40googlegroups.com.

Reply via email to