7

How to block some url (site) on android default browser?

I want to restrict user to access some url which are black listed.

eg. If i want to block facebook then phone built-in app browser will not access this facebook site.

5
  • um... What use is this? Commented Jul 1, 2013 at 6:51
  • Gosh!! Now someone wants to block access to certain sites in my personal phone.. I must kill himm b4 he succeeds... Commented Jul 1, 2013 at 6:56
  • @CRUSADER maybe he wants a tool to control access for certain websites like a parenting tool. That sounds good idea. Commented Jul 1, 2013 at 6:58
  • @CRUSADER: actually, there are plenty of good reasons to have a web filter... (not only parental control) for example, to prevent users to open malicious websites. Commented Oct 22, 2013 at 9:56
  • @PrvN: Did you finally come up with a solution? I have a similar problem: stackoverflow.com/questions/19453841/… Commented Oct 22, 2013 at 12:50

3 Answers 3

9

Do you want to block some websites on a user's device by letting them install an app?

If that is the case, it will only work if they are rooted. If they are, then you could add an entry of the url to the hosts file and redirect it to another ip address (eg 127.0.0.1). But since they need to be rooted, they will probably get a popup asking for permission to access root. This could raise some suspicion with the user.

On a device that's not rooted, preventing the standard browser from accessing a certain website is not possible by installing an app.

Sign up to request clarification or add additional context in comments.

2 Comments

I am in need of functionality where when a user types a url on the browser and searches for it, my app should be able to get that url first and then continue its work based on my permission. Can u please help me with this issue
This is five years old but i've come across an app called BlockSite which uses accessibility permissions to achieve exactly this. Does anyone have an idea of how it achieves this ? Want to create a custom version of that
1

You can't prevent the user from using their browser on their device to access any site.

If you want to do this, make your own browser and replace the one on their device with it (may not be possible without root).

1 Comment

For somehow Kaspersky in Android is able to block access to websites that marked as blacklisted in thier database.
0

There's a work around which is using a VPN service to monitor and filter all the traffic.

An example of this is the NetGuard project:

https://github.com/M66B/NetGuard.

Of course, the user should give his permission to permit this service to take control of the traffic. And in some systems, some system applications are not directed to this service (I've noted that the Samsung Web Browser traffic is not sent through the system VPN).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.