Is it possible to block URLs with Tasker?
I'd like to block different sites from 9-5 everyday.
Is it possible to block URLs with Tasker?
I'd like to block different sites from 9-5 everyday.
You can if your device is rooted. You need to add the URLs in the hosts file (/etc/hosts
) like:
127.0.0.1 facecrook.com
127.0.0.1 liveminmin.com
and so on.
Note that you'll have to remount (as rw
) your /system
first using the commands:
adb shell
su
mount -o remount,rw /system
Use a file editor to do the editing and then remount the system in ro
mode. Also, before editing, copy the default hosts file at some location say /sdcard/host_files/original/hosts
and the modified hosts file at /sdcard/host_files/modified/hosts
Now with the Tasker:
+
→ Time and select your timing when you want URLs to be blocked.+
→ Code → Run Shell:mount -o remount,rw /system
in Command+
→ File → Copy File:/sdcard/host_files/modified/hosts
/etc
folder by holding it.+
→ Code → Run Shell:mount -o remount,ro /system
in Command+
→ System → Reboot → select Normal
in Type./sdcard/host_files/original/hosts
in step 3 under From.Enjoy!
In general, no. Tasker can't know when a URL is launched (my testing with the "Receive Intent" event had no success), nor does it have the necessary control over the browser to stop the page from loading.
That said, if I could find the time to get DolphinTasker published, then yes, you could do this with Dolphin Browser. But that's not an option at the moment.