How to block some url on android browser?

ε祈祈猫儿з 提交于 2020-01-12 09:51:40

问题


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 inbuilt app browser will not access this facebook site.

Thanks in advance!


回答1:


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.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/17398841/how-to-block-some-url-on-android-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!