Reading URL from web browser
I am working on an Adult Content Filtering project. My software should run at background as a windows service, and should not disturb the user as an external program. When the user enter the URL into the address bar of the browser, I should check that web site is in my black list or not.
Now I have some problems on reading URL from browser. How can I get the address from web browser?
[400 byte] By [
SevenHilla] at [2007-11-26 19:12:14]

# 1
What does this have to do with java?
# 2
The thing I want to do with Java is, when the user enters a URL to the browser, I should read it somehow. I tried to listen DNS port but I couldn't achieve. Is there any way of interacting with other softwares in Java?
# 3
It is more involved than that. You need to also run it as a windows service.
The awt Robot allows for that but I suspect you are going to find that you are going to have to constantly update it to match IE. And what happens if someone uses FireFox?
Certainly in a normal corporate/educational environment it is much easier to do this simply by using a dns proxy server and/or a firewall (internal side restrictions.)
And how are you going to keep the black list up to date?
# 4
there will be a server but this server only stores the black list database. in client computers this program will run in background. it should be compatible with any web browser (IE, Firefox, Opera, etc). If a client finds an inappropriate web site, then it can send it to server.
can i do it by listening dns requests? if it is valid, how i can have the client wait for availibilty check of that url?
# 5
> there will be a server but this server only stores
> the black list database. in client computers this
> program will run in background. it should be
> compatible with any web browser (IE, Firefox, Opera,
> etc). If a client finds an inappropriate web site,
> then it can send it to server.
So if a client sends "forum.java.sun.com" to the server then no one can access the java forums?
> can i do it by listening dns requests?
I said a proxy server. For DNS you simply don't resolve names that are disallowed.
> if it is
> valid, how i can have the client wait for availibilty
> check of that url?
Huh? What do you mean "client wait"? Until the DNS is resolved the client always waits anyways.
# 6
By the way although this might be an interesting learning experience the approach is inappropriate for any real usage. A real application that is going to do this needs the following.
1. An intercept mechanism, perhaps at the IP stack. You wouldn't use java to write that.
2. Manual intervention for site exclusion to some extent. Commercial vendors of this sort of software use a number of employees who constantly update the lists.
# 7
i am doing a small project where i am building a firewall and I am facing the same problem. How can I get hold of the url from the browser and pass it to my java application?
# 8
i am developing a mini project in java to implement a firewall. Is it possible to access the url / ip address typed in the browser and pass it to my java application? please help
# 9
See reply #6. You can't implement a firewall in Java.
ejpa at 2007-7-9 21:10:33 >
