Subj : Re: PAC support in SpiderMonkey To : Heath Raftery From : Brendan Eich Date : Tue Aug 19 2003 11:47 pm Heath Raftery wrote: >>The core language, specified by ECMA-262 Edition 3, is a general-purpose >>scripting language. It has nothing about PAC, DOM, VXML, or any of the >>many other embedding layers in it. >> >> > >I see, but didn't Netscape/Mozilla? develop PAC? > Yes, Ari Luotonen and I did in 1995. See http://lxr.mozilla.org/classic/source/network/main/mkautocf.c for what was open-sourced on 3/31/1998 based on that original code. > I would have thought >there would be code available to support PAC files, since it seems a >little silly to require everyone who wants to support PAC to roll their >own. > Indeed, but not every embedding that wants PAC support wants the netlib we released in '98, or today's Mozilla Necko netlib. If you want the latter, though, the PAC implementation is there. >>>nor in >>>that file. I went for a bit of a hunt for it but got caught chasing my >>>tail. Any suggestions? >>> >>> >>> >>If you are not using Mozilla's networking library (Necko, source in >>mozilla/netwerk/), then what are you using for things like DNS resolution? >> >> > >I hope we are understanding each other - PAC support is just part of my >C application. I use normal BSD interfaces for DNS and so forth. > Great, but Mozilla can't use BSD interfaces directly (not portable), and Mozilla has to worry about asynchrony, aka "blocking i/o" -- we can't have a slow DNS lookup freeze the UI. If you don't need to care about portability or blocking, then you don't need Necko, but I thought I'd mention it, because it does do PAC, and it works. > I also >want to be able to parse a PAC file within my application though. I was >hoping SpiderMonkey would help me out here, and after embedding it in my >application, it appears it is. However, I'm still stuck supporting the >PAC extensions to the ECMA specification. > Is that hard? It doesn't sound like a lot of extra code to hack together. >I'll look at the Necko code to see if I can rip the right parts out of >there. I don't want to include the entire networking stack though, if I >can help it! > You shouldn't have to. It ought to be easy to buy "by the yard". Keep us informed about how it goes, ok? /be .