Showing posts with label Google Chrome. Show all posts
Showing posts with label Google Chrome. Show all posts

Thursday, April 3, 2014

Google Chrome and your local hosts file; Squid proxy for Mac

I was trying to alter my hosts file in order to block Faceb**k[1][2] and other annoying things that Ghostery told me were constantly loading on websites.  I looked up tips on how to do so and was surprised to see that what works on most browsers does not work on Google Chrome.  Here's an excerpt from How-To Geek:
When [we] tested it, Chrome did not use the hosts file in any operating system but we were able to block Facebook in Chrome by adding www.facebook.com.
Weird.  I did go to my Mac's System Preferences -> Network -> Proxies, selected Auto Proxy Discovery, and that seemed to make Google Chrome observe the /etc/hosts file.

There might have been more at work there, but I didn't want to mess with it further.  Instead, I decided it was time to install my own Squid proxy.  Of course, I wanted to see if someone had already made this less painful.  :-)  And voila:


A Squid wrapper for Mac.  It installs and configures Squid, giving you a nice GUI to configure basic options.  It is designed to be a personal proxy, running on your local box, but you can configure it to accept connects from other computers, a subnet, etc.

Side note, it was unfortunate that the URL filtering on my router wasn't very smart or else I would have used that instead.

Update:

I set Squid up as a transparent proxy, meaning basically that it requires no configuration by the clients, and that all HTTP traffic will go through Squid by default.  The problem is with HTTPS.  Using HTTPS with a transparent proxy appears to work with Google Chrome, which seems to delegate all proxy settings to the system, but it does not work with Firefox.  With Firefox, HTTP did work, but HTTPS did not.  Only when manually setting Firefox to use Squid as an HTTPS proxy did HTTPS proxying work.

Update:

When trying to accomplish the same thing on my Ubuntu box, this is how I got Chrome to respect Squid:

http://askubuntu.com/questions/66554/why-is-google-chrome-ignoring-my-proxy-settings


References

Thursday, March 1, 2012

Debugging Google Chrome / Chromium CPU Horror

I hated to admit that using Google Chrome was destroying my productivity on my Ubuntu workstation at work.  The CPU usage was absolutely horrible, and the average load on my machine was usually anywhere from 1.5 to 7.  I know!

My workstation was fairly beefy memory-wise and CPU-wise, and had plenty of disk space.  I disabled everything I could think of, enabled GPU rendering of things, disabled debugging, extensions, ETC. . . .

I exited Chrome and waited for the processes to die.  Usually, I just verify this happened by looking at top; since Chrome usually owns the top spots (no pun intended), I wait until top shows no chrome processes, then I restart it.  This time, I did ps for chrome and chromium processes.  TURNS OUT that after using the Profile Manager[1] extension, several chrome and chromium processes were starting up every time I logged in.  I verified this by looking at "~/.config/autostart", which showed several *.desktop files pointing to Google Chrome and Chromium profiles.

So far, the change is extremely significant.  I recorded no benchmarks along the way, so I am unsure of how much each of my changes improved performance.  However, it appears that all of the extra Chrome processes were what made the biggest difference.

Chalk up another win for blogging about anecdotal information that may or may not lead to misunderstandings about technology.  :-)  You're welcome!


-Ali


[1]  I started using Profile Manager because I wanted to run multiple Chrome sessions in isolation, depending on what I was working on.  For my day-to-day work, I use one profile.  For my volunteer work, which I associate with its own Google Apps account, I use another profile.  For my browser testing, I use another.  THE LIST GOES ON.