Sunday, 6 October 2019

How to check response of Pac script

I need to get the response of the pacScript in my chrome extension.A pacScript will return DIRECT string in case we don't need to proxy and i want to detect that.

var config = {
        mode: "pac_script",
        pacScript: {
          url: "https://www.example.com/proxy.pac"
        }
      };

chrome.proxy.settings.set({value: config, scope: 'regular'},function() {
    //how can i get the pac response string here 
});

Edit : I tried using JQuery.getScript to load the FindProxyForURL from remote pac file but now the pac specific function like isPlainHostName are now undefined.

I could get the implementations from mozilla but there must be a better way since those are browser functions that should have already been available.



from How to check response of Pac script

No comments:

Post a Comment