brad's life - Firefox + PAC considered harmful [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Firefox + PAC considered harmful [Mar. 24th, 2008|09:14 am]
Brad Fitzpatrick
Update to my previous FireFox rant:

After talking with Mike Shaver and sending him some debug info, it turns out the problem is PAC files. Firefox runs all Proxy Auto-Configuration scripts synchronously, blocking the entire UI while things like DNS resolution run in JS (which is more noticeably painful over a slow connection).

Shaver says this won't be fixed until after FF3.

In the meantime, find another solution to your complex proxy rules... localhost proxy w/ PAC logic, ssh tunnels, etc.

As jesserud pointed out, it might be this bug, if you want to track it. (Update: And indeed, Shaver confirms that's the bug, and this comment says what needs to be done.)

Good to know what it is, at least.
LinkReply

Comments:
[User Picture]From: muerte
2008-03-24 04:45 pm (UTC)
Do you have multiple PAC scripts? Why not just hardcode them into FF instead of auto-configure every time. I must be missing something.
(Reply) (Thread)
[User Picture]From: brad
2008-03-24 04:47 pm (UTC)
One PAC file.

Read:
http://en.wikipedia.org/wiki/Proxy_auto-config

It's a JavaScript file that determines, per-URL, which proxy to use. Quite popular in corporate environments.
(Reply) (Parent) (Thread)
[User Picture]From: muerte
2008-03-24 04:53 pm (UTC)
Gotcha... I didn't realize there was JS logic and multiple proxies involved.
(Reply) (Parent) (Thread)
From: baudehlo
2008-03-24 06:16 pm (UTC)

Try SwitchProxy?

I just use SwitchProxy for this. Yes, it's a manual process, but I guess it's better than it being slow for all operations.
(Reply) (Thread)
[User Picture]From: brad
2008-03-24 09:06 pm (UTC)

Re: Try SwitchProxy?

That'd annoy me even more. Too many proxies/rules. That's what PAC is for. :)
(Reply) (Parent) (Thread)
From: baudehlo
2008-03-24 09:24 pm (UTC)

Re: Try SwitchProxy?

Surprised you haven't just written a localhost proxy in perl then :-)
(Reply) (Parent) (Thread)
[User Picture]From: herbie
2008-03-25 06:27 am (UTC)

Re: Try SwitchProxy?

I used to use switchproxy with a PAC, and only enable it when I needed to get into a proxied site, so there's only one setting. I suppose it depends on how often the proxy settings are relevant - if you're always going to sites which need to be proxied, then it sucks, but for occasional use, it's just a binary flag, and will help work around the problem during the majority use case.
(Reply) (Parent) (Thread)
[User Picture]From: herbie
2008-03-25 08:26 am (UTC)

Re: Try SwitchProxy?

I realized i may not have been clear - I had one setting in SwitchProxy for "no proxy" and one for "autoconfigure with this PAC", and just switched between them as needed.
(Reply) (Parent) (Thread)
From: seeds_of_peace
2008-03-24 07:31 pm (UTC)
man i wish vista had some sort of "detected hangs" list like that
(Reply) (Thread)
[User Picture]From: ajaxxx
2008-03-24 11:42 pm (UTC)
I thought this had always been true. Well, at least that the PAC script ran serially and that DNS was slow, not necessarily that it blocked the UI thread.
(Reply) (Thread)
From: luserspaz
2008-03-25 04:05 pm (UTC)
Bug 235853: don't freeze the UI when resolving DNS for PAC, by using deferred
resolution if we would otherwise block on DNS. r+madskills=biesi, a-b5=mconnor


Looks like you owe shaver a beer!
(Reply) (Thread)