Open Bug 78436 Opened 24 years ago Updated 5 months ago

PAC: PAC files need to be displayed (not loaded)

Categories

(Firefox :: File Handling, enhancement, P5)

enhancement

Tracking

()

People

(Reporter: benc, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: helpwanted)

Mac, commercial 2001-04-30-08-mtrunk STEPS: 1- Type the URL of a PAC file into a URL field and hit return OBSERVED BEHAVIOR: Netscape 6 tries to download this file: "Downloading This file has mime type application-x-ns-proxy-autoconfig and cannot be viewed in Netscape 6. You can open it with another application, or save it to disk. []Open Using []Save to disk" EXPECTED BEHAVIOR: Communicator 4 would refuse to load and execute PAC files via "normal surfing methods (typing URL, links, etc). "Warning: Server sent an unregistered proxy automatic configuration file to Netscape: http://proxy.packetgram.com:443// Configuration file will be ignored. POSSIBLE SOLUTIONS: 1- emulate Communicator 4 fully We need a similar error for mozilla. 2- use a newer, smarter behavior Treat surfed pac files as text and display them on the screen. Why? When I was a proxy administrator, I hated working with a configuration file that I could not easily see. Knowing that the browser can load and display the file is a win for admins (ease of configuration) and users (they can see where their requests are going). NOTES: The download dialog also was behaving weird in several ways. I used Mac, but will update for Win32+Linux later: 1- Open does not display the file, but saves it to disk as a text file (openable in Simpletext) 2- Save suggests a filename, but already creates the file on disk, so you cannot save to the suggested name. If you change the name so you can save, you get a corrupted file that has a blank file icon but appears to ResEdit as a folder?!
Target Milestone: --- → mozilla1.0
qa to me. I don't think this should be futured, so I'm nominating this nscatfood.
QA Contact: tever → benc
Whiteboard: nscatfood
-->PAC bugs to Jussi
Assignee: neeti → jpm
Blocks: 79893
QA Contact: benc → pacqa
Serge, can you take a look at these PAC issues? Thanks - Jussi-Pekka
Assignee: jpm → serge
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
to default owner
Assignee: serge → new-network-bugs
qa to me - (pac is back). +nsbeta1, 4xp - this is a design aspect where I don't fully understand if downloading is a security issue. Comm 4 had a behavior that we definitely don't have.
Component: Networking → File Handling
QA Contact: pacqa → benc
Summary: PAC: PAC files should not load outside of prefs mechanisms → PAC: PAC files need to be displayed (not loaded)
Whiteboard: nscatfood → nsbeta1, 4xp
-> file handling, now that I think about it.
Assignee: new-network-bugs → law
QA Contact: benc → sairuh
Whiteboard: nsbeta1, 4xp → nsbeta1, 4xp, helpwanted
Keywords: 4xp, helpwanted, nsbeta1
Whiteboard: nsbeta1, 4xp, helpwanted
Nav triage team: nsbeta1-
Keywords: nsbeta1nsbeta1-
Keywords: qawanted
QA Contact: sairuh → nobody
QA Contact: nobody → pacqa
I think that bug 57342 would basically fix this bug, if I understood it correctly.
Depends on: 57342
retargeting
Target Milestone: mozilla1.0.1 → Future
I think law is gone.
.
Assignee: law → file-handling
Target Milestone: Future → ---
I'm not going to hack layout and parser to know about this random made-up MIME type. IMO this should be wontfix and the server should use the JS type for what is after all a JS file. Note that we don't try to "load" the PAC file when loading this way -- we simply don't know what to do with it.
bz: maybe a non-hacky solution would be a streamconverter that converts PAC files to HTML and shows a message as in comment 0 at top and the file in <pre> below
Yeah, that would work. In fact, could we just write a stream converter to convert arbitrary data to text/plain? Then we could stop special-casing all sorts of MIME types in layout and parser in favor of registering this stream converter with various contractids, maybe...
that would be for things like text/javascript? sounds good to me
Yeah, text/javascript, text/css, application/x-javascript, etc.
WFM on 1.7a (2004010708); it won't execute it but instead asks what to do with the file. When I go to our PAC server, I get the normal download dialog: =========== The file "" is of type application/x-ns-proxy-autoconfig, and Mozilla does not know how to handle this file type. This file is located at: http://pac.pusd.org What should Mozilla do with this file? . . . =========== I've mapped .PAC to a text editor so opening it in the default application works. This is also resolved by creating a MIME type in Helper Applications that always opens it in a text editor (e.g., Notepad).
I thought about this, but couldn't get it to work on my Mac. It turns out I had done the config wrong. It seems to work well, should look at editing the file handling defaults? Also, how would you do this for linux?
Keywords: qawanted
Hmm, after getting this to work on my Mac, I looked at mimeTypes.rdf: <RDF:Description about="urn:mimetype:externalApplication:application/x-ns-proxy-autoconfig" NC:path="/Applications/TextEdit.app" NC:prettyName="TextEdit.app" /> <RDF:Description about="urn:mimetype:application/x-ns-proxy-autoconfig" NC:description="PAC file" NC:fileExtensions="pac" NC:value="application/x-ns-proxy-autoconfig" NC:editable="true"> <NC:handlerProp resource="urn:mimetype:handler:application/x-ns-proxy-autoconfig"/> </RDF:Description> <RDF:Description about="urn:mimetype:handler:application/x-ns-proxy-autoconfig" NC:alwaysAsk="false" NC:saveToDisk="false" NC:useSystemDefault="false" NC:handleInternal="false"> <NC:externalApplication resource="urn:mimetype:externalApplication:application/x-ns-proxy-autoconfig"/> </RDF:Description> My RDF experience is a bit limited, does anyone else want to help me w/ a patch?
Assignee: file-handling → nobody
QA Contact: pacqa → file-handling
Product: Core → Firefox
Version: Trunk → unspecified
QA Whiteboard: qa-not-actionable

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

The severity field is not set for this bug.
:Gijs, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gijskruitbosch+bugs)

Valentin, do you know if PAC files are still in common use and/or if it would make sense to treat these as text/plain so they showed up inline by default? AIUI this is much simpler to fix than bug 57342 - to fix that bug would require UI work and thinking about what the UX should be in the current world (where the "what do you want to do with this file" dialog isn't the default anyway). But here, I think we could "just" add a converter registration that maps application/x-ns-proxy-autoconfig to text/html using the text-to-html converter, I think? cf. https://searchfox.org/mozilla-central/search?q=streamconv%3B1%3Ffrom&path=&case=false&regexp=false

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(valentin.gosu)

PAC files are still very much in use. I'm not sure just how critical it is to be able to display them in the browser though, but looking through the PAC code I don't think treating them as text/plain would cause any issues.

But here, I think we could "just" add a converter registration that maps application/x-ns-proxy-autoconfig to text/html using the text-to-html converter, I think? cf. https://searchfox.org/mozilla-central/search?q=streamconv%3B1%3Ffrom&path=&case=false&regexp=false

Yes, I think that might work. Or otherwise just add a content handler for this content type here? The opposite of what we're doing in bug 1824325 for application/http-index-format.

Flags: needinfo?(valentin.gosu)
See Also: → proxy-autoconfig

The severity field is not set for this bug.
:Gijs, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gijskruitbosch+bugs)
Severity: -- → N/A
Type: defect → enhancement
Flags: needinfo?(gijskruitbosch+bugs)
Priority: -- → P5

PAC files are similar to JavaScript files.
Since Firefox displays JavaScript as plain text, there is no complication in displaying .pac similarly.

You need to log in before you can comment on or make changes to this bug.