0

I have two different questions I would like to ask. I am new to javascript and I am trying to create a project ... of some sort.

Firstly, is it possible to have an integrated webbrowser within ... say a PHP page? e.g. using javascript, I have a canvas sized 500 x 700 within my "index.php" page, and can navigate to any website while remaining on my "index.php", but the websites appearing on that canvas?

If this is not possible, then is it possible to navigate to a website, and then interact with the elements thereof? I doubt this because you would no longer be connected to your file if you rediirect to another website, hence the integrated idea.

If neither or those are a possibility, then is it at all possible to interact with an EXTERNAL website's elements? External being not yours in this context.

user3126288
  • 35
  • 1
  • 9
  • What do you want to do with the external content? Simply parse it? Or do you also want to have the ability for the user to interact with it? – PeeHaa Apr 26 '14 at 22:09
  • I want the script to navigate to the website, wait a certain amount of seconds, then click a button. That's it. It sounds very simple yet here I am asking questions. – user3126288 Apr 26 '14 at 22:12
  • And what do you want to do with the content after the click? – PeeHaa Apr 26 '14 at 22:34
  • nothing. once the btn is clicked the job is done. – user3126288 Apr 27 '14 at 05:24
  • Why can't you simply make a request to the last page directly? – PeeHaa Apr 27 '14 at 10:32
  • If you mean to simply navigate to the site, then what about the button? Are you talking about the HREF where the button leads to? If yes, the problem is that there is something which activates only upon the button being clicked, not by going to the ultimate destination. I therefore need the event to happen in order to trigger the required goal. – user3126288 Apr 27 '14 at 13:54

1 Answers1

1

You can use an iframe tag to load an external page, however

  • With most modern browsers you're not allowed to interact with the elements for security reasons
  • Many sites (still for security reasons) don't want to be loaded inside an iframe and they try to either escape the iframe or just render back a blank page instead.

One security problem is that a malicious page could open an iframe with e.g. a buy page of amazon.com and then render over it another opaque element that lets the click go through it. This way a user may be tricked into click over a "watch the cute kitties" button and instead is clicking on the one-click-buy button of amazon (or liking a facebook page, or starting following a spammer on twitter or ...).

6502
  • 112,025
  • 15
  • 165
  • 265