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.

asked Apr 26, 2014 at 22:07
6
  • 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? Commented Apr 26, 2014 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. Commented Apr 26, 2014 at 22:12
  • And what do you want to do with the content after the click? Commented Apr 26, 2014 at 22:34
  • nothing. once the btn is clicked the job is done. Commented Apr 27, 2014 at 5:24
  • Why can't you simply make a request to the last page directly? Commented Apr 27, 2014 at 10:32

1 Answer 1

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 ...).

answered Apr 26, 2014 at 22:23
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.