|
Re: Browser.execute() issue [message #105557 is a reply to message #105543] |
Thu, 18 September 2008 12:09 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Martin,
here are a few ideas what you could investigate in order to narrow
the problem:
* try to run a different browser and see if it also fails
* are there any add-ons that might prevent the Javscript execution
* what version of RAP are you using?
* if working against RAP CVS HEAD, you could write
"this.debug( e );" in line 29 of Browser.js to see if
a Javascript error occurs
HTH
Rüdiger
Martin Schmied wrote:
> Hi,
>
> The Browser.execute() is not working for me. It always returns false and
> no script is executed. I'm running Ubuntu with Firefox. I've noticed
> this while porting our RCP application. But even the simplest scenario (
> browser.execute("alert('Hello world')" call in RAP Workbench demo )
> produces the same result.
>
> Regards, Martin Schmied
>
|
|
|
|
|
Re: Browser.execute() issue [message #105640 is a reply to message #105624] |
Fri, 19 September 2008 06:42 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Hi Martin,
thanks for your investigation. When using the Browser widget please
bear in mind that it is represented by an IFRAME element on the
client-side. Therefore its general use is limited by implementation
details that vary on different browsers and security restrictions.
Plus user-specific security settings may restrict its features further.
It seems to be a bug that 'this.getContentWindow()' returns null.
Feel free to open a bugzilla if you have a code snippet to reproduce
the behavior.
The 'permission denied' exception, to me looks like a security
restriction that cannot be overcome, except maybe by altering the
client-side security settings.
Cheers,
Rüdiger
Martin Schmied wrote:
> Hi Rüdiger,
>
> thanks for responding. My original setup uses RAP 1.1 I've tried Firefox
> and Opera with the same negative result. Then (already at my laptop
> running Windows Vista) I switched to CVS bundles as you proposed, added
> some JS debugging code and here's the result:
>
> On Firefox and Opera the 'this.getContentWindow()' statement returns
> null causing the subsequent evaluation to throw a NPE
>
> On IE7 the context window is indeed returned, but "Permission denied"
> exception is thrown from the evaluation.
>
> One way or another, the Browser.execute() always fails.
>
> Regards, Martin Schmied
>
|
|
|
|
Re: Browser.execute() issue [message #106094 is a reply to message #106010] |
Wed, 24 September 2008 07:16 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Hi Martin,
this seems to be a problem related to qooxdoo and its queuing
mechanisms. It certainly has nothing to do with the way setUrl() and
execute() are called.
When the client-side Browser object is created, its respective DOM
nodes (namely the IFRAME) aren't created immediately. All DOM
operations are queued and executed 'sometime' later. This is the
reason why getContentWindow() (returns the actual DOM node)
sometimes returns null.
It seems possible to work around this in RAP. Please file a Bugzilla
to track progress on this.
Cheers,
Rüdiger
-----------------------------
Rüdiger Herrmann
Innoopract
http://innoopract.com
delivering eclipse technology
Martin Schmied wrote:
> Hi Rudiger,
>
> I've found that to reproduce the issue in RAP Workspace Demo you have to
> call execute() right after (or close enough) an URL change - when the
> page is still loading. The following code should do that:
>
> browser.setUrl("http://times.com");
> browser.execute("alert('hello world');")
>
> This might be a browser issue you can do nothing about. However, in our
> original application where I encountered the error for the first time,
> there's no URL change directly preceding the execute() call. The page
> loaded in browser contains UI of a streaming map application
> (http://www.openstreetmap.org/). Every time the execute() call fails,
> it's because this.getContentWindow() in Browser.js returns null.
>
> Regards, Martin Schmied
>
|
|
|
|
Re: Browser.execute() issue [message #106148 is a reply to message #106121] |
Wed, 24 September 2008 15:37 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
This is a multi-part message in MIME format.
--------------060708020907020708050804
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi Martin,
if it turns out be actually be a security restriction, I don't think
that we can do much about it.
Still, I wonder, why the IFRAME returned by getContentWindow() is
null. Even if security settings apply, the page is displayed and
thus there must be an IFRAME element. The IFRAME may or may not
execute Javascript, but it should be there at least.
Attached is a Browser.js with the workaround mentioned in the
earlier post.
Note 1: this workaround is *not* to circumvent security issues.
Note 2: it is untested as I cannot reproduce the problem.
You may replace the existing org/eclipse/swt/browser/Browser.js in
the js source folder with this file and see if it works.
HTH,
R
|
|
|
|
Powered by
FUDForum. Page generated in 0.04173 seconds