hey, im porn addict. I don't want to block google as a whole, just entering google image section
This is difficult - partially because Google images isn't even a separate subdomain anymore, but mostly because it's almost impossible to put in any sort of block that you can't overrule the moment you feel like it.
Nevertheless, here's my attempt at a solution.
1. Create a separate administrator account and log in to it. Make sure your day to day user account is
not an administrator.
2. Create a new text document in TextEdit and press cmd+shift+T to convert to plain text. Paste the following in and then save it to the Public folder inside the admin user's home folder as
proxy.pac.
Code:
var normal = "DIRECT", blackhole = "PROXY 127.0.0.1:3421";
function testpat(regexpr, url) {
var pat = new RegExp(regexpr)
return pat.test(url)
}
function FindProxyForURL(url, host) {
tests = [ "google.*=images",
"images\.google",
"google.*tbm=isch",
]
for( var i = 0; i < tests.length; i++ ) {
if( testpat(tests[i], url) ) {
return blackhole;
}
}
return normal;
}
3. Open Terminal and type the following commands:
Code:
cd Public
chmod og-w proxy.pac
chmod og+r proxy.pac
4. Now go into
System Preferences ->
Network and select
Wi-Fi or whatever your normal network interface is. Click the padlock in the bottom left then give it your admin username and password. Click the
Advanced... button towards the bottom right and then the
Proxies tab at the top.
5. Select
Automatic Proxy Configuration and put the following in the URL box, substituting
admin for the username of the admin user. Note there are
three forward slashes at the beginning.
Code:
file:///Users/admin/Public/proxy.pac
6. Click
Okay then
Apply.
That should have blocked everything remotely resembling Google Images in most browsers, but Safari (*sigh*) has some bugs (?) that (eurgh) prevent the proxy from working. Luckily, we can lock Safari out as well:
7. Open Terminal again and type the following commands. Note that the last command will ask for your password, and that nothing will appear as you type it in. This is normal. Just keep typing and hit enter at the end.
Code:
cd /Applications
sudo chmod ugo-x Safari.app
Your regular user should now be totally unable to access Google Images. Let me know if you find a hole anywhere or have trouble with any of the instructions. If you need to lock yourself out of the administrator account as well, that can be arranged, but life will start getting difficult from there.