Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Java/Javascript Bridge and SVG documents
Java/Javascript Bridge and SVG documents [message #521451] Wed, 17 March 2010 15:59 Go to next message
Mat Booth is currently offline Mat BoothFriend
Messages: 13
Registered: July 2009
Junior Member
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 #521491 is a reply to message #521451] Wed, 17 March 2010 18:36 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Mat,

the place where the function is created/registered in the Browser
document is Browser.js#createFunction( name ). The Browser.js is located
in org.eclipse.rap.rwt.q07. Maybe the registered function is not
accessible from the SVG?

HTH,
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 #521502 is a reply to message #521451] Wed, 17 March 2010 19:46 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
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 Go to previous message
Mat Booth is currently offline Mat BoothFriend
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. Smile

Regards,
Mat
Previous Topic:Why is a very large virtual table so slow?
Next Topic:Prevent horizontal scrolling in Form for long Text Content
Goto Forum:
  


Current Time: Sat Nov 27 23:49:30 GMT 2021

Powered by FUDForum. Page generated in 0.02216 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top