Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Retrieving HTML Source from TBrowser Component.
Thu, Jul 4 2019 12:23 AMPermanent Link

Steve Gill

Avatar

I'm loading a web page using the TBrowser component.  I'm trying to get the source of the browser using the DocumentText property, however this generates an error message:  "Access is denied".

What is the correct way to get the page source?

= Steve
Thu, Jul 4 2019 6:55 AMPermanent Link

Matthew Jones

Steve Gill wrote:

> I'm loading a web page using the TBrowser component.  I'm trying to get the source of the browser using the DocumentText property, however this generates an error message:  "Access is denied".
>
> What is the correct way to get the page source?

This will be some sort of browser security thing. It stops a page grabbing your PayPal password when it is in a frame, for example. I think the solution is have the browser content come from the same server as the main page. But it isn't an EWB issue, so check on the general Javascript security for browsers.


--

Matthew Jones
Fri, Jul 5 2019 8:30 AMPermanent Link

Steve Gill

Avatar

Hi Matthew,

<< This will be some sort of browser security thing. It stops a page grabbing your PayPal password when it is in a frame, for example. I think the solution is have the browser content come from the same server as the main page. But it isn't an EWB issue, so check on the general Javascript security for browsers. >>

So I can view a page but not the source behind it?  In a browser I can right-click on a web page and select View Page Source and see the code.

= Steve
Fri, Jul 5 2019 12:24 PMPermanent Link

Matthew Jones

Steve Gill wrote:

> In a browser I can right-click on a web page and select View Page Source and see the code.

Yes, but that's you, not the code. It stops hijacking of your passwords etc to prevent code seeing what is happening in a sub-pane.

--

Matthew Jones
Fri, Jul 5 2019 9:41 PMPermanent Link

Steve Gill

Avatar

<< Yes, but that's you, not the code. It stops hijacking of your passwords etc to prevent code seeing what is happening in a sub-pane. >>

It's just HTML.  Anyway, I have now done it in PHP with two lines code so problem solved.

= Steve
Image