Page 1 of 1
PHP Browser environment
Posted: Thu Feb 24, 2005 7:47 am
by nomis_uk
Hi, I'm attempting to create a browser environment by stripping the tool bars out of a browser and use a frameset to have seperate frames for the browser icons and one for the web site the user is visiting.
Is there a way to stop web sites, that open links in new windows or sites that use pop-ups, escaping my browser?
Any suggestions would be helpful.
Posted: Thu Feb 24, 2005 8:09 am
by CoderGoblin
You might be able to do some things with Javascript BUT this is easy to switch off.
Restricting usage is not normally advisable. What happens if they do not like your "browser" and wish to use the default ? Most users are familiar with the browser they use, why should they have to learn a "new" one. In this instance I would probably leave the site and never go back.[/b]
Posted: Thu Feb 24, 2005 8:27 am
by nomis_uk
Sorry, i didnt fully explain myself. Im a student, as part of my coursework Im making a web browser with simplified AI by making the browser search google via its google's API, as well as search RSS feeds.
But because of timescale, writting a browser from scratch is unrealistic so I need it to work ontop of an existing browser engine, so thats why I thought of stripping tool bars etc. This isn't about restricting usage, its about making a simulation of a browser. I dont really want to prevent things opening in new windows, but i want to be able to detect when this does happen and make sure it opens within the frameset to keep the browser appearence.
Posted: Thu Feb 24, 2005 8:37 am
by feyd
you could make your own extension/modification of Firefox/Mozilla, not too far fetched..
detecting whether something will open in a new windows is a bit tricky.. depending on the savvy of the writer. Regular expressions would be the usual solution, however there are many ways to 'hide' from simple regular expressions, so you will need to scrutinize the page code with your parser... Personally, that's too much work for little benefit, I'd just tweak Firefox

Posted: Thu Feb 24, 2005 8:47 am
by nomis_uk
or is there a way, with javascript i guess, to iterate through all open windows, and check their location, and if the URL is not that of my browser redirect them to my interface, passing the url so it redirects to the correct page but within my interface?
any ideas?
Posted: Thu Feb 24, 2005 9:01 am
by timvw
you can easily write your own basic browser in java....
just write the code to download content from a given url (probably this has been done before), then feed that content to javax.swing.JEditorPane and there you are

Now attach eventlisteners to the hyperlinks in the document.. and you are ready to go....
i'm pretty sure there are similar components available for .net....
Posted: Thu Feb 24, 2005 9:23 am
by feyd
Personally, I don't see why you want to create a "browser." Why not just create a page that displays search results and what-not, and let the user navigate it how they wish?
Posted: Thu Feb 24, 2005 3:44 pm
by nomis_uk
by creating a php interface means the system can track the user, and look for relate web sites automatically etc etc.
Posted: Thu Feb 24, 2005 9:31 pm
by timvw
in that case i would write some sort of a proxy... and lookup "related" data... and the modify the data (add the related data to it) that is passed to the browser...
and it doesn't force the user to work with a crippled browser. only with a crippled internet :p