Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332561 - BrowserFunction not found in Firefox, with different port
Summary: BrowserFunction not found in Firefox, with different port
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-14 13:56 EST by Flavio Donze CLA
Modified: 2010-12-15 05:14 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Flavio Donze CLA 2010-12-14 13:56:42 EST
Build Identifier: 1.4 M3

I have a web server running on "http://127.0.0.1:8080" and RAP is running on "http://127.0.0.1:8081".
HTML documents of the web server are displayed in a RAP Editor using the SWT Browser component.

Those HTML documents contain JavaScript calls javascript:openObj('uuid').
On the RAP side I then register a BrowserFunction for openObj.

This works fine on IE but fails on Firefox (3.6). The console says: openObj is not defined

It works in Firefox if I place the file in the RAP environment (http://127.0.0.1:8081) and so using the same port.

I know there are some security related restrictions on IFrames and JS, but since it works on IE I don't think this is the case here. 

The host is the same, only the port differs.

Reproducible: Always
Comment 1 Ivan Furnadjiev CLA 2010-12-15 05:14:55 EST
Hi Flavio, I did some tests and the result is the following. FF, Safari, Chrome and Opera throw "Permission denied" error when we try to get the window of the iframe - "Permission denied for <http://127.0.0.1:8080> to get property HTMLDocument.defaultView from <http://127.0.0.1:8081>". This is a typical error for cross-domain scripting. Only IE allows this :-). Different protocols or ports are considered different domains. Typically, the solution to this is to map the resource from one to the other.
We have plans to improve the Browser widget error handling for such kind of errors - see bug 330361. We can't do anything against browser security policies. That's why I will close this bug as NOT_ECLIPSE.