Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Proxy .PAC file no longer works

I use a .pac file in order to enable/disable my web proxy when browsing specified sites with Safari. It worked fine under Snow Leopard, but does not work under Lion. My .pac looks like this:


function FindProxyForURL(url, host)

{

// variable strings to return

var proxy_yes = "PROXY my proxy.com:7128";

var proxy_no = "DIRECT";

if (shExpMatch(url, "https://proxy_this_site.com*")) { return proxy_yes; }

if (shExpMatch(url, "http://whatismyipaddress.com")) { return proxy_yes; }

// Proxy anything else

return proxy_no;

}


Any advice on how to get the .pac working again?

15" i5 MacBook 2.4GHz, Mac OS X (10.6.5)

Posted on Jul 23, 2011 3:36 AM

Reply
47 replies

Dec 6, 2011 6:47 PM in response to Keri Henare

Same problem here with proxy.pac but we have always used it from a remote web server. The same URL we have used for all our Windows XP, Win7, 2003 and 2008 machines along with out Mac OS X 10.4 and 10.6 machines no longer works with 10.7.


We are using 10.7.2 and Safari 5.1.1 I believe - whatever the latest version are as of 3 days ago.


Any resolution on this?

Jul 25, 2012 7:12 PM in response to Tom Fischer

Looks like the readable folders have changed with Mountain Lion's release. After upgrading to 10.8, the proxy rules weren't working, so using Tom's same search method, you can browse which files are accessible in /system/library/privateFrameworks/webkit2.framework/webprocess.app/contents/res ources/com.apple.WebProcess.sb, and move your .pac file there. Works now for me with Safari 6.

Jul 26, 2012 4:41 AM in response to SpaceAge

Interesting. After upgrading to Mountain Lion, I didn't see ANY changes. My .pac file is located in /Library/WebServer/Documents as it was under Lion, and it continues to function as expected. I point to the .pac file in the Network->Advanced->Proxies prefence pane. I did notice that the Web Sharing option in the Sharing preference pane is gone though.

Apr 26, 2013 12:05 AM in response to Tim Kimpton

Hi Tim,


The proxy.pac issue has been around since Safari 6.0 with the sandboxing feature. In version 6.0.4, the sandbox file was overwritten with a new one (exactly the same as version 6.0.3), in the same directory as for version 6.0.3, located at:


/System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Content s/Resources/com.apple.WebProcess.sb


You either need to look in this file and find a directory that Safari has been given read access to, and put your proxy.pac file in there, or add another line containing your proxy .pac filename and location to the "allow file-read*" list. This section starts at line #21 in the file, and looks like:


————————————————

;; Read-only preferences and data

(allow file-read*

;; Basic system paths

————————————————



Using my own setup as an example, I edited the file, and added the following lines at around line #35 of the file:


————————————————

;; Added by Tom for proxy.pac

(literal "/Users/tfischer/Documents/scripts/proxy.pac")

————————————————


While waiting for Apple to fix this, I've been using the above as a reliable workaround since the release of verion 6.0...


best regards,


tom

Apr 26, 2013 7:41 AM in response to Tom Fischer

I Originally used this method and packaged it up creating a pkg with Jamf Composer.


https://discussions.apple.com/thread/4138324?answerId=19045147022#19045147022


I Was then able to update from Safari 6.0.3 to 6.0.4 and keep the proxy work around. Unfortunately it didn't work and I have entries firm my proxy PAC file.


I will try you entry method instead and see if it works.


thanks for your help Tom it very useful, unlike another thread in the Safari discussions where a guy is saying repair permissions, boot to recovery disk lol. I'm ok because I'm a unix geek but feel sorry for the suckers spending hours following that screwy advice.

Apr 26, 2013 8:03 AM in response to Tom Fischer

On Safari 6.0.3 Mountain Lion i used /System/Library/PrivateFrameworks/WebKit2.framework/WebProcess.app/Contents/Reso urces/com.apple.WebProcess.sb


;; Plugins

(subpath "/Library/Internet Plug-Ins")

(home-subpath "/Library/Internet Plug-Ins")


I have used my tools to look at the Safai 6.0.4 and see what it actually includes and you are correct Tom, the file

path i should be looking at now for 6.0.4 is


/System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Contents/Resources/com.apple.WebProcess .sb

Jun 5, 2013 2:55 AM in response to Tim Kimpton

Grrr... With the Safari 6.0.5 (Mac OS X 10.8.4) update, it looks like Apple has moved the sandbox configuration file back to:


/System/Library/PrivateFrameworks/WebKit2.framework/WebProcess.app/Contents/Reso urces/com.apple.WebProcess.sb


They've made some minor changes to the file since 6.0.4. After re-adding my pointers to my proxy.pac file, the proxy stuff works again...


best regards,



tom

Proxy .PAC file no longer works

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.