|
|
Re: Java/Javascript Bridge and SVG documents [message #521502 is a reply to message #521451] |
Wed, 17 March 2010 19:46 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Mat,
I've just took a look at your screen-shot attached to the bug. It seems
that the RAP application is starter from localhost (127.0.0.1), but the
page with SVG in the Browser widget is from different domain (
www.matbooth.co.uk). Due to browser security restrictions, it is not
possible to register a javascript function in a page, located in a
different domain than the RAP application. This is a limitation of
BrowserFunction support, but we can't do anything about it - browser
security policies.
Best,
Ivan
On 03/17/2010 5:59 PM, Mat Booth wrote:
> I am using the Browser widget to display an SVG. The SVG has embedded
> Javascript that calls Java BrowserFunctions exposed by the Browser
> widget.
>
> This works fine in RCP, but fails in RAP 1.3 M5 ( I raised a bug here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=306209 )
>
> I'd really like to get a single-sourcing demo of this working for a
> potential future project. Can anyone suggest where (and how!) I should
> start debugging this?
>
> Regards,
> Mat
|
|
|
Re: Java/Javascript Bridge and SVG documents [message #521618 is a reply to message #521502] |
Thu, 18 March 2010 10:22 |
Mat Booth Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Ivan Furnadjiev wrote on Wed, 17 March 2010 15:46:
> Hi Mat,
>
> I've just took a look at your screen-shot attached to the bug. It seems
> that the RAP application is starter from localhost (127.0.0.1), but the
> page with SVG in the Browser widget is from different domain (
> www.matbooth.co.uk). Due to browser security restrictions, it is not
> possible to register a javascript function in a page, located in a
> different domain than the RAP application. This is a limitation of
> BrowserFunction support, but we can't do anything about it - browser
> security policies.
>
Aha!
If I serve the document as a static resource using the "org.eclipse.equinox.http.registry.resources" extension point, then it works as expected.
I wasn't aware of this browser restriction, but it seems you are right. Thanks for your help, it's been most useful.
I will close the bug.
Regards,
Mat
|
|
|
Powered by
FUDForum. Page generated in 0.03796 seconds