Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Possible Bug With DocumentText
Thu, Mar 17 2016 12:42 PMPermanent Link

Mark Brooks

Slikware

Avatar

Tim

I'm using the OnLoad event of a TBrowser with IE11. When I try to read the DocumentText property I get an exception on the JS line:

$r = $t.telement_fdomelement.contentDocument

which states "access denied".

Any ideas?

Thanks
Mark
Fri, Mar 18 2016 5:13 AMPermanent Link

Matthew Jones

Mark Brooks wrote:

> I'm using the OnLoad event of a TBrowser with IE11. When I try to
> read the DocumentText property I get an exception on the JS line:
>
> $r = $t.telement_fdomelement.contentDocument
>
> which states "access denied".
>
> Any ideas?

This is simple browser security. You simply cannot do it.

--

Matthew Jones
Fri, Mar 18 2016 6:33 AMPermanent Link

Mark Brooks

Slikware

Avatar

"Matthew Jones" wrote:

>>This is simple browser security. You simply cannot do it.

Hi Matthew

Fair comment, however (a) I'm just trying to read the value (b) Tim has wrapped this already as a read / write property (c) all other browsers seem to support this.

So I think it's just not as simple as "you can't do it"?
Fri, Mar 18 2016 7:47 AMPermanent Link

Matthew Jones

Mark Brooks wrote:

> So I think it's just not as simple as "you can't do it"?

Yes, you are probably right, but I suspect that it will become harder
over time, not easier. Key is it isn't an EWB issue, but javascript
generally, so you can google generally to find solutions.

http://javascript.info/tutorial/same-origin-security-policy is
interesting, but it seems that the domain is a key part of whether you
can do it. Good luck!

--

Matthew Jones
Fri, Mar 18 2016 12:26 PMPermanent Link

Uli Becker

Mark,

I remember two discussions which might help:

http://tinyurl.com/zw4wglz
http://tinyurl.com/z856esu

Regards Uli
Fri, Mar 18 2016 2:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< Fair comment, however (a) I'm just trying to read the value (b) Tim has wrapped this already as a read / write property (c) all other browsers seem to support this.

So I think it's just not as simple as "you can't do it"? >>

Where ever the content in the TBrowser control is coming from will need to handle/return the proper CORS headers in order to allow the client application direct access to the document content in the TBrowser control.  This is out of the hands of EWB.

Tim Young
Elevate Software
www.elevatesoft.com
Image