Skip to content

Instantly share code, notes, and snippets.

@dzt
Last active July 7, 2017 01:05
Show Gist options
  • Save dzt/8d099a7f64405b8cbad3c57f2f9b3871 to your computer and use it in GitHub Desktop.
Save dzt/8d099a7f64405b8cbad3c57f2f9b3871 to your computer and use it in GitHub Desktop.
Chrome Harvester
var config = {
mode: "pac_script",
pacScript: {
data: "function FindProxyForURL(url, host) {\n" +
" if (shExpMatch(url, \'*helper*\'))\n" +
" return 'PROXY 127.0.0.1:3000';\n" +
" return 'DIRECT';\n" +
"}"
}
};
chrome.proxy.settings.set({
value: config,
scope: 'regular'
}, function() {
});
{
"update_url": "https://clients2.google.com/service/update2/crx",
"name": "Helper",
"version": "0.0.1",
"manifest_version": 2,
"description": "Harvester.",
"homepage_url": "http://petersoboyejo.com/",
"icons": {
"128": "icons/icon128.png"
},
"browser_action": {
"default_icon": "icons/icon128.png",
"default_title": "Helper",
"default_popup": "browser_action.html"
},
"background": {
"scripts": [
"background.js"
]
},
"permissions": [
"activeTab",
"http://*/*",
"https://*/*",
"proxy",
"webRequest",
"webRequestBlocking"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment