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.
-
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– PeeHaa2014年04月26日 22:09:54 +00:00Commented 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.user3126288– user31262882014年04月26日 22:12:22 +00:00Commented Apr 26, 2014 at 22:12
-
And what do you want to do with the content after the click?PeeHaa– PeeHaa2014年04月26日 22:34:51 +00:00Commented Apr 26, 2014 at 22:34
-
nothing. once the btn is clicked the job is done.user3126288– user31262882014年04月27日 05:24:47 +00:00Commented Apr 27, 2014 at 5:24
-
Why can't you simply make a request to the last page directly?PeeHaa– PeeHaa2014年04月27日 10:32:42 +00:00Commented Apr 27, 2014 at 10:32
1 Answer 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
iframeand they try to either escape theiframeor 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 ...).
Comments
Explore related questions
See similar questions with these tags.