Home » Eclipse Projects » Remote Application Platform (RAP) » IE8 access denied in iframe
IE8 access denied in iframe [message #1239882] |
Wed, 05 February 2014 09:03 |
bogdan toma Messages: 39 Registered: February 2010 |
Member |
|
|
Hello all,
We have an application done with RAP2.0 (using RWT). This application loads inside an iframe.
In "IE8.0.7601.17514 64-bit Edition" we have the following problem:
- the user clicks around in application
- in the time waiting for the server to respond the user clicks outside the iframe on some javascript action(actually on any javscript). E.g.
if ($("#sliderContent").is(":hidden")) {
$("#slider").animate({
width: "210px"
}, 500 );
}
or
<a href="javascript:;" title="Unify" class="smartlogo"></a>
- when the response for the RAP application comes from server we get the error:
Quote:
Error: Operation "set" on target "w57" of type "rwt.widgets.Text" failed:
Access is denied.
Properties:
text = 10481
Script: {
"head": {
"requestCounter": 897
},
"operations": [ [ "set", "w46", {
"visible": true
} ], [ "set", "w57", {
"text": "10481"
} ], [ "set", "w77", {
"visible": true
} ], [ "set", "w88", {
"text": "14030"
} ], [ "set", "w140", {
"text": "11098"
} ], [ "set", "w225", {
"text": "18865"
} ], [ "set", "w226", {
"text": "14000"
} ] ]
}
name: Error
description: Operation "set" on target "w57" of type "rwt.widgets.Text" failed:
Access is denied.
Properties:
text = 10481
message: Operation "set" on target "w57" of type "rwt.widgets.Text" failed:
Access is denied.
Properties:
text = 10481
Debug: off
Request: {"head":{"requestCounter":896},"operations":[["set","w1",{"cursorLocation":[202,606]}]]}
- if the user clicks on this javascript action and afterwards before the iframe request is finished he does a focus inside the iframe, there are no problems; no errors occur.
Do you have any idea what is going on ?
In Chrome and Firefox this does not happen.
Thank you.
|
|
|
Re: IE8 access denied in iframe [message #1239915 is a reply to message #1239882] |
Wed, 05 February 2014 10:12 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
This is new to me. Is the document the RAP application is embedded in
loaded from the same origin[1] so that it would have access to the
iframe? (Not that should be required, it's just interesting to know.)
I'm pretty sure this is a browser bug/restriction. You might also try to
reset the IE security options, or make them less restrictive. Even if
that's not an option for the end-user it might give some more insights
on what's going on.
Greetings,
Tim
[1]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
Am 05.02.2014 10:03, schrieb bogdan toma:
> Hello all,
> We have an application done with RAP2.0 (using RWT). This application
> loads inside an iframe.
> In "IE8.0.7601.17514 64-bit Edition" we have the following problem:
> - the user clicks around in application
> - in the time waiting for the server to respond the user clicks outside
> the iframe on some javascript action(actually on any javscript). E.g.
>
> if ($("#sliderContent").is(":hidden")) {
> $("#slider").animate({ width: "210px"
> }, 500 );
> }
>
> or
>
> <a href="javascript:;" title="Unify" class="smartlogo"></a>
>
>
> - when the response for the RAP application comes from server we get the
> error:
> Quote:
>> Error: Operation "set" on target "w57" of type "rwt.widgets.Text" failed:
>> Access is denied.
>>
>> Properties: text = 10481
>>
>>
>> Script: {
>> "head": {
>> "requestCounter": 897
>> },
>> "operations": [ [ "set", "w46", {
>> "visible": true
>> } ], [ "set", "w57", {
>> "text": "10481"
>> } ], [ "set", "w77", {
>> "visible": true
>> } ], [ "set", "w88", {
>> "text": "14030"
>> } ], [ "set", "w140", {
>> "text": "11098"
>> } ], [ "set", "w225", {
>> "text": "18865"
>> } ], [ "set", "w226", {
>> "text": "14000"
>> } ] ]
>> }
>> name: Error
>> description: Operation "set" on target "w57" of type
>> "rwt.widgets.Text" failed:
>> Access is denied.
>>
>> Properties: text = 10481
>>
>> message: Operation "set" on target "w57" of type "rwt.widgets.Text"
>> failed:
>> Access is denied.
>>
>> Properties: text = 10481
>>
>> Debug: off
>> Request:
>> {"head":{"requestCounter":896},"operations":[["set","w1",{"cursorLocation":[202,606]}]]}
>>
>
>
> - if the user clicks on this javascript action and afterwards before the
> iframe request is finished he does a focus inside the iframe, there are
> no problems; no errors occur.
>
> Do you have any idea what is going on ?
> In Chrome and Firefox this does not happen.
>
> Thank you.
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | | |
Re: IE8 access denied in iframe [message #1252546 is a reply to message #1251745] |
Fri, 21 February 2014 10:29 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
> do you have a link (or an article or something) which somehow explain
> your previous statement?
No. As I said, it's just an (educated) guess. If you managed to
reproduce the whole scenario in a small example project I might be able
to debug it to see where exactly the error occurs. However, I don't
think that it would help resolving the issue, since I'm already
relatively sure where is occurs.
You see, the error is not created by RAP itself (there is no such error
message in our code), it has to come form the browser, and if you google
it you see that is likely related to cross-domain scripting (iframe
access).
If you look at the server response, the operation that fails is the
second one. That the first one doesn't fail, but it may not directly
access the DOM (some operations are put into a queue). So the second
operations is probably the very first attempt to access a DOM element
(the "input" element of the "Text" widget), and that's when the error
occurs.
The fact that the script is allowed to handle normal JavaScript objects
from within the iFrame (we wouldn't get to the processing phase
otherwise) but not DOM elements is a contradiction, and that's why I
think it's a browser bug.
Of course I can't proof any of this (at least not without debugging it
myself), but I don't see any other explanation. Why the bug occurs with
your RAP application bug not others I can't explain, there are any
number of factors that could provoke it.
I'm sorry, but the way I see it the only reliable way to fix this issue
is to ensure both documents are served from the same security domain.
(See the link I prevously provided.)
Greetings,
Tim
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: IE8 access denied in iframe [message #1252716 is a reply to message #1252546] |
Fri, 21 February 2014 14:22 |
bogdan toma Messages: 39 Registered: February 2010 |
Member |
|
|
Hello,
thank you for your reply.
You are right that if iframe and main application are served from same domain it works.
My problem is that i cannot prove that it is a known IE8 bug or something. (i mean i cannot say that it is a cross-domain problem, if i cannot say what is crossing the line )
As for small example i have one; but i do not know how to send it; so i will post some code here:
If you click on DIV in time that RAP is processing the request, you should get the exception.
RAP2.0, IE8.0.7601.17514 64-bit Edition
HTML side:
<html>
<head>
</head>
<body>
<div onclick="alert('clicked');" >Click on text</div><br/>
<iframe id="serviceFrame1" src="http://vmapache.net/example.accessdenied/accesseddenied" width="1024px" height="990px" name="UI" style="border:0px none; margin-top:5px;"></iframe>
</body></html>
RAP side:
public class AccessedDeniedDemo extends AbstractEntryPoint
{
protected void createContents(Composite parent)
{
parent.setLayout(new GridLayout(1, true));
final Button button = new Button(parent, SWT.CHECK);
button.setText("Press");
final Text text = new Text(parent, SWT.None);
text.setText("it will be changed!");
button.addSelectionListener(new SelectionListener()
{
@Override
public void widgetSelected(SelectionEvent arg0)
{
try
{
Thread.sleep(5000);
text.setText("Done");
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
@Override
public void widgetDefaultSelected(SelectionEvent arg0)
{
// TODO Auto-generated method stub
}
});
}
}
public class AccessedDeniedDemoConfigurator implements ApplicationConfiguration
{
public void configure(Application application)
{
application.addEntryPoint("/accesseddenied", AccessedDeniedDemo.class, null);
}
}
Thank you.
Kind regards,
Tommy
|
|
|
Re: IE8 access denied in iframe [message #1257561 is a reply to message #1252716] |
Wed, 26 February 2014 15:18 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
Sorry for the big delay, I have been very busy ;-)
I will try to debug your example, but It may take a while until I'm able
to fit it into my schedule.
Greetings,
Tim
Am 21.02.2014 15:22, schrieb bogdan toma:
> Hello,
> thank you for your reply.
> You are right that if iframe and main application are served from same
> domain it works.
> My problem is that i cannot prove that it is a known IE8 bug or
> something. (i mean i cannot say that it is a cross-domain problem, if i
> cannot say what is crossing the line :) )
>
>
> As for small example i have one; but i do not know how to send it; so i
> will post some code here:
> If you click on DIV in time that RAP is processing the request, you
> should get the exception.
>
> RAP2.0, IE8.0.7601.17514 64-bit Edition
>
> HTML side:
>
> <html>
>
> <head>
>
> </head>
>
> <body> <div onclick="alert('clicked');" >Click on text</div><br/>
>
> <iframe id="serviceFrame1"
> src="http://vmapache.net/example.accessdenied/accesseddenied"
> width="1024px" height="990px" name="UI" style="border:0px none;
> margin-top:5px;"></iframe>
>
> </body></html>
>
>
>
>
>
> RAP side:
>
> public class AccessedDeniedDemo extends AbstractEntryPoint
> {
>
> protected void createContents(Composite parent)
> {
> parent.setLayout(new GridLayout(1, true));
>
> final Button button = new Button(parent, SWT.CHECK);
> button.setText("Press");
>
> final Text text = new Text(parent, SWT.None);
> text.setText("it will be changed!");
> button.addSelectionListener(new SelectionListener()
> {
>
> @Override
> public void widgetSelected(SelectionEvent arg0)
> {
> try
> {
> Thread.sleep(5000);
> text.setText("Done");
> }
> catch (InterruptedException e)
> {
> e.printStackTrace();
> }
>
> }
>
> @Override
> public void widgetDefaultSelected(SelectionEvent arg0)
> {
> // TODO Auto-generated method stub
>
> }
> });
>
> }
>
> }
>
>
> public class AccessedDeniedDemoConfigurator implements
> ApplicationConfiguration
> {
>
> public void configure(Application application)
> {
> application.addEntryPoint("/accesseddenied",
> AccessedDeniedDemo.class, null);
> }
> }
>
>
>
>
> Thank you.
> Kind regards,
> Tommy
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Goto Forum:
Current Time: Tue Apr 23 09:32:15 GMT 2024
Powered by FUDForum. Page generated in 0.03764 seconds
|