0

In response to a previous question posed on Stackoverflow on how to launch Firefox with a proxy a user suggested using a .pac (proxy auto config) file:

Set the path to your .pac file in the firefox settings, under auto-config proxy. Remember to use a file url..

To setup automatic file switching, simply configure firefox to point towards a single file

The problem I'm facing is that I need to tell FF to load the .pac file without needing to tweak any settings in the browser manually.

How can I instruct Firefox to load a .pac file on startup programmatically (preferably in Java as that is the programming language I'm using)?

Thanks

alpha1
  • 426
  • 3
  • 14
  • What OS are you on? – Kaj Hejer Apr 06 '21 at 16:00
  • @KajHejer Windows 10. – alpha1 Apr 06 '21 at 16:01
  • 1
    Look at this question on how to start firefox from cmd line using a different profile which can contain custom proxy settings https://stackoverflow.com/questions/843340/firefox-proxy-settings-via-command-line – Bimalesh Jha Apr 06 '21 at 16:05
  • @BimaleshJha No it is not the same, as that answer relies on prefs.js. If you look at the question linked in my post you'll see that this question is specifically directed at .pac which is a different solution. I explained why using pef.js is not an option in my case. Please see the thread linked in my OP. Thank you. – alpha1 Apr 06 '21 at 16:07
  • @alpha1 you should be able to override the default profile prefs.js with a custom profile. Refer the linked question in my comment. Sorry if this is not what you are looking at. – Bimalesh Jha Apr 06 '21 at 16:12
  • @BimaleshJha thanks again for your suggestion. Using a custom profile fails to solve the main issue at hand as a custom profile has to be setup manually at some point. Sure once it is setup it can be used again programmatically but the main point of my question is how to bypass the need for any manual work/setup. I want to simply tell FF which .pac file to use on startup programmatically.. thanks! – alpha1 Apr 06 '21 at 16:15

0 Answers0