Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
bogdan toma is currently offline bogdan tomaFriend
Messages: 38
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 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 387
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 #1239944 is a reply to message #1239915] Wed, 05 February 2014 11:06 Go to previous messageGo to next message
bogdan toma is currently offline bogdan tomaFriend
Messages: 38
Registered: February 2010
Member
Thank you for fast reply.

According to [1] there are not same origin.
I did the following steps(taken from [2]) and there is no problem.
"
navigate to your personal site in IE8;
click on Tools in the toolbar and hit Internet Options;
click on the Security tab and click on the Trusted sites icon;
click the Sites button and add your site to the list of trusted sites then save the list;
click on the Custom level... button and scroll down the the Miscellaneous section;
change setting in the fist category, Access data sources across domains, to Enable and save the settings; and
refresh your site and notice that the "access is denied" error is gone.
"

The strange thing for me is that these applications are not interacting one with the other (anyway not on client side), but seems still a cross-domain problem.



[1]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
[2]
https://github.com/chuckcarpenter/REM-unit-polyfill/issues/7

Regards,
Tommy
Re: IE8 access denied in iframe [message #1240024 is a reply to message #1239944] Wed, 05 February 2014 14:56 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 387
Registered: July 2009
Senior Member
I guess there is a bug in IE that causes the response of the
HTTP-request to be processed in the security domain of the currently
focused frame, not the one that caused it.

Am 05.02.2014 12:06, schrieb bogdan toma:
> Thank you for fast reply.
>
> According to [1] there are not same origin.
> I did the following steps(taken from [2]) and there is no problem.
> "
> navigate to your personal site in IE8;
> click on Tools in the toolbar and hit Internet Options;
> click on the Security tab and click on the Trusted sites icon;
> click the Sites button and add your site to the list of trusted sites
> then save the list;
> click on the Custom level... button and scroll down the the
> Miscellaneous section;
> change setting in the fist category, Access data sources across domains,
> to Enable and save the settings; and
> refresh your site and notice that the "access is denied" error is gone.
> "
>
> The strange thing for me is that these applications are not interacting
> one with the other (anyway not on client side), but seems still a
> cross-domain problem.
>
>
>
> [1]
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
>
> [2]
> https://github.com/chuckcarpenter/REM-unit-polyfill/issues/7
>
> Regards,
> Tommy

--
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 #1251745 is a reply to message #1240024] Thu, 20 February 2014 14:59 Go to previous messageGo to next message
bogdan toma is currently offline bogdan tomaFriend
Messages: 38
Registered: February 2010
Member
Hello again,
Quote:
I guess there is a bug in IE that causes the response of the
HTTP-request to be processed in the security domain of the currently
focused frame, not the one that caused it.

do you have a link (or an article or something) which somehow explain your previous statement?

Thank you.
Regards,
Tommy
Re: IE8 access denied in iframe [message #1252546 is a reply to message #1251745] Fri, 21 February 2014 10:29 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 387
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 Go to previous messageGo to next message
bogdan toma is currently offline bogdan tomaFriend
Messages: 38
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 Smile )


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 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 387
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/
Previous Topic:Combo problems in Firefox
Next Topic:Menu access via keyboard not possible
Goto Forum:
  


Current Time: Sat Dec 20 23:54:24 GMT 2014

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

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