1

I've built a GWT application that simulates a standalone popup widget. I can invoke a javascript method that pops the widget from the html page that is part of the application (i.e. PopWidget.html) -- the html is basically auto-generated when I create the GWT eclipse project.

Now I'd like to invoke the javascript method from a standalone html (not part of application). When I try to call the javascript method, I am getting a permissions exception. Is this a SOP issue? And if so, How can i either work around this problem or transform the app to behave as an embeddable 3rd-party javascript library?

I've looked in gwt gadgets and this seems like the ticket, but I have not discovered any "popup" gadgets...

  • take a look at this similiar question: http://stackoverflow.com/questions/3125556/gwt-to-create-utility-javascript-library – Daniel Kurka Nov 01 '11 at 17:16

1 Answers1

0

You are correct that it is an SOP issue - the default linker used builds an iframe, and loads the app source into that iframe. To prevent the js from running any file on your system, this is locked down (in most browsers).

Take a look at the "Controlling Compiler Output" section of this link http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml- the standard linker (std) uses iframes to protect against possible xss issues, but in your case you want cross origin loading, so you can probably use the xs linker instead.

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
  • You'd rather use the xsiframe linker instead. The xs linker is deprecated; xsiframe on the other hand supports DevMode and code splitting. – Thomas Broyer Nov 02 '11 at 00:20
  • Thanks, good to know - too bad the 'latest' docs don't always have the docs for the latest code. One can submit bug reports and code reviews, is there a way to submit doc fixed? – Colin Alworth Nov 02 '11 at 01:34
  • Submit as a bug, it'll be triaged in Category-Documentation. – Thomas Broyer Nov 02 '11 at 01:51