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

$(window) causes exception when the page containing my gwt module is accessed by https #381

Open
biancashouse opened this issue Oct 13, 2016 · 2 comments

Comments

@biancashouse
Copy link

When my module is fetched by a page accessed via http, it is good, but when the page is accessed via https I get"

configure-0.js:14352 Uncaught com.google.gwt.core.client.JavaScriptException: (SecurityError) : Blocked a frame with origin "https://htmlhub.io" from accessing a cross-origin frame.

It is not a CORS issue, because the module does start up and runs ok until it encounter any attempt to access $(window); e.g. int w = $(window).width();

@biancashouse biancashouse changed the title $(window) causes exception when server is accessed by https $(window) causes exception when the page containing my gwt module is accessed by https Oct 13, 2016
@biancashouse
Copy link
Author

Digging deeper, the exception happens in JSUtils:

/**

  • Check is a javascript can be cast to a node list.
    /
    public static native boolean isNodeList(JavaScriptObject o) /
    -{
    var r = Object.prototype.toString.call(o);
    return r == '[object HTMLCollection]' || r == '[object NodeList]'
    || (typeof o == 'object' && o.length && o[0] && o[0].tagName) ? true : false;
    }-*/;

Get the exception when the return line executes.
Just prior to the return, r is '[object Window']

@biancashouse
Copy link
Author

Finally, by removing all references to GQuery.window and $(window) and instead using the gwt Window object the issue resolves.

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

1 participant