diff --git a/shared/produce_regex.js b/shared/produce_regex.js new file mode 100644 index 0000000..4fcb9fc --- /dev/null +++ b/shared/produce_regex.js @@ -0,0 +1,9 @@ +'use strict'; + +const shared_urls = require('../shared/urls'); + +const chrome_regex_list = shared_urls.produce_squid_regex_list(/* for_pac_server= */ false); +const chrome_regex_text = chrome_regex_list.join('\n') + '\n'; +console.log(chrome_regex_text); + +process.exit(0); \ No newline at end of file diff --git a/shared/urls.js b/shared/urls.js index 7c067ef..a510023 100644 --- a/shared/urls.js +++ b/shared/urls.js @@ -592,23 +592,3 @@ exports.pac_urls = unblock_youku.pac_proxy_urls; exports.pac_bypass_urls = unblock_youku.pac_proxy_bypass_urls; exports.produce_squid_regex_list = produce_squid_regex_list; - - -(function () { - 'use strict'; - - // http://stackoverflow.com/a/5197219 - // http://stackoverflow.com/a/6398335 - if (typeof module !== 'undefined' && module.exports && require.main === module) { - var squid_regex_list; - if (typeof process !== 'undefined' && process.argv[2] === 'PAC') { - squid_regex_list = produce_squid_regex_list(true /* for PAC service */); - } else { - squid_regex_list = produce_squid_regex_list(false /* for Chrome proxy */); - } - - for (var i = 0; i < squid_regex_list.length; i++) { - console.log(squid_regex_list[i]); - } - } -}());