i4640

Untitled

Apr 11th, 2023 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.90 KB | None | 0 0
  1. var proxy = "SOCKS5 192.168.7.1:10081; DIRECT;";
  2.  
  3. var rules = [
  4. "||he.net",
  5. "||vimeocdn.com",
  6. "||hcaptcha.com",
  7. "||akamaized.net",
  8. "||googleapis.com",
  9. "||gstatic.com",
  10. "||openai.com",
  11. "||vimeo.com",
  12. "||googletagmanager.com",
  13. "||f7tk.com",
  14. "||doubleclick.net",
  15. "||google-analytics.com",
  16. "||ai.com",
  17. "||cloudflare.com",
  18. "||intercom.io",
  19. "||statsigapi.net",
  20. "||featuregates.org",
  21. "||intercomcdn.com",
  22. "||pki.goog",
  23. "||auth0.com",
  24. "||identrust.com",
  25. "||cloudflareinsights.com",
  26. "||edgecompute.app",
  27. "||compute-pipe.com",
  28. "||stripe.com",
  29. "||stripe.network",
  30. ];
  31.  
  32. /*
  33. * This file is part of Adblock Plus <http://adblockplus.org/>,
  34. * Copyright (C) 2006-2014 Eyeo GmbH
  35. *
  36. * Adblock Plus is free software: you can redistribute it and/or modify
  37. * it under the terms of the GNU General Public License version 3 as
  38. * published by the Free Software Foundation.
  39. *
  40. * Adblock Plus is distributed in the hope that it will be useful,
  41. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  42. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  43. * GNU General Public License for more details.
  44. *
  45. * You should have received a copy of the GNU General Public License
  46. * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
  47. */
  48.  
  49. function createDict()
  50. {
  51. var result = {};
  52. result.__proto__ = null;
  53. return result;
  54. }
  55.  
  56. function getOwnPropertyDescriptor(obj, key)
  57. {
  58. if (obj.hasOwnProperty(key))
  59. {
  60. return obj[key];
  61. }
  62. return null;
  63. }
  64.  
  65. function extend(subclass, superclass, definition)
  66. {
  67. if (Object.__proto__)
  68. {
  69. definition.__proto__ = superclass.prototype;
  70. subclass.prototype = definition;
  71. }
  72. else
  73. {
  74. var tmpclass = function(){}, ret;
  75. tmpclass.prototype = superclass.prototype;
  76. subclass.prototype = new tmpclass();
  77. subclass.prototype.constructor = superclass;
  78. for (var i in definition)
  79. {
  80. if (definition.hasOwnProperty(i))
  81. {
  82. subclass.prototype[i] = definition[i];
  83. }
  84. }
  85. }
  86. }
  87.  
  88. function Filter(text)
  89. {
  90. this.text = text;
  91. this.subscriptions = [];
  92. }
  93. Filter.prototype = {
  94. text: null,
  95. subscriptions: null,
  96. toString: function()
  97. {
  98. return this.text;
  99. }
  100. };
  101. Filter.knownFilters = createDict();
  102. Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?:[$^*]?=[^\(\)"]*)?\))*)|#([^{}]+))$/;
  103. Filter.regexpRegExp = /^(@@)?\/.*\/(?:\$~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[^,\s]+)?)*)?$/;
  104. Filter.optionsRegExp = /\$(~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[^,\s]+)?)*)$/;
  105. Filter.fromText = function(text)
  106. {
  107. if (text in Filter.knownFilters)
  108. {
  109. return Filter.knownFilters[text];
  110. }
  111. var ret;
  112. if (text[0] == "!")
  113. {
  114. ret = new CommentFilter(text);
  115. }
  116. else
  117. {
  118. ret = RegExpFilter.fromText(text);
  119. }
  120. Filter.knownFilters[ret.text] = ret;
  121. return ret;
  122. };
  123.  
  124. function InvalidFilter(text, reason)
  125. {
  126. Filter.call(this, text);
  127. this.reason = reason;
  128. }
  129. extend(InvalidFilter, Filter, {
  130. reason: null
  131. });
  132.  
  133. function CommentFilter(text)
  134. {
  135. Filter.call(this, text);
  136. }
  137. extend(CommentFilter, Filter, {
  138. });
  139.  
  140. function ActiveFilter(text, domains)
  141. {
  142. Filter.call(this, text);
  143. this.domainSource = domains;
  144. }
  145. extend(ActiveFilter, Filter, {
  146. domainSource: null,
  147. domainSeparator: null,
  148. ignoreTrailingDot: true,
  149. domainSourceIsUpperCase: false,
  150. getDomains: function()
  151. {
  152. var prop = getOwnPropertyDescriptor(this, "domains");
  153. if (prop)
  154. {
  155. return prop;
  156. }
  157. var domains = null;
  158. if (this.domainSource)
  159. {
  160. var source = this.domainSource;
  161. if (!this.domainSourceIsUpperCase)
  162. {
  163. source = source.toUpperCase();
  164. }
  165. var list = source.split(this.domainSeparator);
  166. if (list.length == 1 && list[0][0] != "~")
  167. {
  168. domains = createDict();
  169. domains[""] = false;
  170. if (this.ignoreTrailingDot)
  171. {
  172. list[0] = list[0].replace(/\.+$/, "");
  173. }
  174. domains[list[0]] = true;
  175. }
  176. else
  177. {
  178. var hasIncludes = false;
  179. for (var i = 0; i < list.length; i++)
  180. {
  181. var domain = list[i];
  182. if (this.ignoreTrailingDot)
  183. {
  184. domain = domain.replace(/\.+$/, "");
  185. }
  186. if (domain == "")
  187. {
  188. continue;
  189. }
  190. var include;
  191. if (domain[0] == "~")
  192. {
  193. include = false;
  194. domain = domain.substr(1);
  195. }
  196. else
  197. {
  198. include = true;
  199. hasIncludes = true;
  200. }
  201. if (!domains)
  202. {
  203. domains = createDict();
  204. }
  205. domains[domain] = include;
  206. }
  207. domains[""] = !hasIncludes;
  208. }
  209. this.domainSource = null;
  210. }
  211. return this.domains;
  212. },
  213. sitekeys: null,
  214. isActiveOnDomain: function(docDomain, sitekey)
  215. {
  216. if (this.getSitekeys() && (!sitekey || this.getSitekeys().indexOf(sitekey.toUpperCase()) < 0))
  217. {
  218. return false;
  219. }
  220. if (!this.getDomains())
  221. {
  222. return true;
  223. }
  224. if (!docDomain)
  225. {
  226. return this.getDomains()[""];
  227. }
  228. if (this.ignoreTrailingDot)
  229. {
  230. docDomain = docDomain.replace(/\.+$/, "");
  231. }
  232. docDomain = docDomain.toUpperCase();
  233. while (true)
  234. {
  235. if (docDomain in this.getDomains())
  236. {
  237. return this.domains[docDomain];
  238. }
  239. var nextDot = docDomain.indexOf(".");
  240. if (nextDot < 0)
  241. {
  242. break;
  243. }
  244. docDomain = docDomain.substr(nextDot + 1);
  245. }
  246. return this.domains[""];
  247. },
  248. isActiveOnlyOnDomain: function(docDomain)
  249. {
  250. if (!docDomain || !this.getDomains() || this.getDomains()[""])
  251. {
  252. return false;
  253. }
  254. if (this.ignoreTrailingDot)
  255. {
  256. docDomain = docDomain.replace(/\.+$/, "");
  257. }
  258. docDomain = docDomain.toUpperCase();
  259. for (var domain in this.getDomains())
  260. {
  261. if (this.domains[domain] && domain != docDomain && (domain.length <= docDomain.length || domain.indexOf("." + docDomain) != domain.length - docDomain.length - 1))
  262. {
  263. return false;
  264. }
  265. }
  266. return true;
  267. }
  268. });
  269.  
  270. function RegExpFilter(text, regexpSource, contentType, matchCase, domains, thirdParty, sitekeys)
  271. {
  272. ActiveFilter.call(this, text, domains, sitekeys);
  273. if (contentType != null)
  274. {
  275. this.contentType = contentType;
  276. }
  277. if (matchCase)
  278. {
  279. this.matchCase = matchCase;
  280. }
  281. if (thirdParty != null)
  282. {
  283. this.thirdParty = thirdParty;
  284. }
  285. if (sitekeys != null)
  286. {
  287. this.sitekeySource = sitekeys;
  288. }
  289. if (regexpSource.length >= 2 && regexpSource[0] == "/" && regexpSource[regexpSource.length - 1] == "/")
  290. {
  291. var regexp = new RegExp(regexpSource.substr(1, regexpSource.length - 2), this.matchCase ? "" : "i");
  292. this.regexp = regexp;
  293. }
  294. else
  295. {
  296. this.regexpSource = regexpSource;
  297. }
  298. }
  299. extend(RegExpFilter, ActiveFilter, {
  300. domainSourceIsUpperCase: true,
  301. length: 1,
  302. domainSeparator: "|",
  303. regexpSource: null,
  304. getRegexp: function()
  305. {
  306. var prop = getOwnPropertyDescriptor(this, "regexp");
  307. if (prop)
  308. {
  309. return prop;
  310. }
  311. var source = this.regexpSource.replace(/\*+/g, "*").replace(/\^\|$/, "^").replace(/\W/g, "\\$&").replace(/\\\*/g, ".*").replace(/\\\^/g, "(?:[\\x00-\\x24\\x26-\\x2C\\x2F\\x3A-\\x40\\x5B-\\x5E\\x60\\x7B-\\x7F]|$)").replace(/^\\\|\\\|/, "^[\\w\\-]+:\\/+(?!\\/)(?:[^\\/]+\\.)?").replace(/^\\\|/, "^").replace(/\\\|$/, "$").replace(/^(\.\*)/, "").replace(/(\.\*)$/, "");
  312. var regexp = new RegExp(source, this.matchCase ? "" : "i");
  313. this.regexp = regexp;
  314. return regexp;
  315. },
  316. contentType: 2147483647,
  317. matchCase: false,
  318. thirdParty: null,
  319. sitekeySource: null,
  320. getSitekeys: function()
  321. {
  322. var prop = getOwnPropertyDescriptor(this, "sitekeys");
  323. if (prop)
  324. {
  325. return prop;
  326. }
  327. var sitekeys = null;
  328. if (this.sitekeySource)
  329. {
  330. sitekeys = this.sitekeySource.split("|");
  331. this.sitekeySource = null;
  332. }
  333. this.sitekeys = sitekeys;
  334. return this.sitekeys;
  335. },
  336. matches: function(location, contentType, docDomain, thirdParty, sitekey)
  337. {
  338. if (this.getRegexp().test(location) && this.isActiveOnDomain(docDomain, sitekey))
  339. {
  340. return true;
  341. }
  342. return false;
  343. }
  344. });
  345. RegExpFilter.prototype["0"] = "#this";
  346. RegExpFilter.fromText = function(text)
  347. {
  348. var blocking = true;
  349. var origText = text;
  350. if (text.indexOf("@@") == 0)
  351. {
  352. blocking = false;
  353. text = text.substr(2);
  354. }
  355. var contentType = null;
  356. var matchCase = null;
  357. var domains = null;
  358. var sitekeys = null;
  359. var thirdParty = null;
  360. var collapse = null;
  361. var options;
  362. var match = text.indexOf("$") >= 0 ? Filter.optionsRegExp.exec(text) : null;
  363. if (match)
  364. {
  365. options = match[1].toUpperCase().split(",");
  366. text = match.input.substr(0, match.index);
  367. for (var _loopIndex6 = 0; _loopIndex6 < options.length; ++_loopIndex6)
  368. {
  369. var option = options[_loopIndex6];
  370. var value = null;
  371. var separatorIndex = option.indexOf("=");
  372. if (separatorIndex >= 0)
  373. {
  374. value = option.substr(separatorIndex + 1);
  375. option = option.substr(0, separatorIndex);
  376. }
  377. option = option.replace(/-/, "_");
  378. if (option in RegExpFilter.typeMap)
  379. {
  380. if (contentType == null)
  381. {
  382. contentType = 0;
  383. }
  384. contentType |= RegExpFilter.typeMap[option];
  385. }
  386. else if (option[0] == "~" && option.substr(1) in RegExpFilter.typeMap)
  387. {
  388. if (contentType == null)
  389. {
  390. contentType = RegExpFilter.prototype.contentType;
  391. }
  392. contentType &= ~RegExpFilter.typeMap[option.substr(1)];
  393. }
  394. else if (option == "MATCH_CASE")
  395. {
  396. matchCase = true;
  397. }
  398. else if (option == "~MATCH_CASE")
  399. {
  400. matchCase = false;
  401. }
  402. else if (option == "DOMAIN" && typeof value != "undefined")
  403. {
  404. domains = value;
  405. }
  406. else if (option == "THIRD_PARTY")
  407. {
  408. thirdParty = true;
  409. }
  410. else if (option == "~THIRD_PARTY")
  411. {
  412. thirdParty = false;
  413. }
  414. else if (option == "COLLAPSE")
  415. {
  416. collapse = true;
  417. }
  418. else if (option == "~COLLAPSE")
  419. {
  420. collapse = false;
  421. }
  422. else if (option == "SITEKEY" && typeof value != "undefined")
  423. {
  424. sitekeys = value;
  425. }
  426. else
  427. {
  428. return new InvalidFilter(origText, "Unknown option " + option.toLowerCase());
  429. }
  430. }
  431. }
  432. if (!blocking && (contentType == null || contentType & RegExpFilter.typeMap.DOCUMENT) && (!options || options.indexOf("DOCUMENT") < 0) && !/^\|?[\w\-]+:/.test(text))
  433. {
  434. if (contentType == null)
  435. {
  436. contentType = RegExpFilter.prototype.contentType;
  437. }
  438. contentType &= ~RegExpFilter.typeMap.DOCUMENT;
  439. }
  440. try
  441. {
  442. if (blocking)
  443. {
  444. return new BlockingFilter(origText, text, contentType, matchCase, domains, thirdParty, sitekeys, collapse);
  445. }
  446. else
  447. {
  448. return new WhitelistFilter(origText, text, contentType, matchCase, domains, thirdParty, sitekeys);
  449. }
  450. }
  451. catch (e)
  452. {
  453. return new InvalidFilter(origText, e);
  454. }
  455. };
  456. RegExpFilter.typeMap = {
  457. OTHER: 1,
  458. SCRIPT: 2,
  459. IMAGE: 4,
  460. STYLESHEET: 8,
  461. OBJECT: 16,
  462. SUBDOCUMENT: 32,
  463. DOCUMENT: 64,
  464. XBL: 1,
  465. PING: 1,
  466. XMLHTTPREQUEST: 2048,
  467. OBJECT_SUBREQUEST: 4096,
  468. DTD: 1,
  469. MEDIA: 16384,
  470. FONT: 32768,
  471. BACKGROUND: 4,
  472. POPUP: 268435456,
  473. ELEMHIDE: 1073741824
  474. };
  475. RegExpFilter.prototype.contentType &= ~ (RegExpFilter.typeMap.ELEMHIDE | RegExpFilter.typeMap.POPUP);
  476.  
  477. function BlockingFilter(text, regexpSource, contentType, matchCase, domains, thirdParty, sitekeys, collapse)
  478. {
  479. RegExpFilter.call(this, text, regexpSource, contentType, matchCase, domains, thirdParty, sitekeys);
  480. this.collapse = collapse;
  481. }
  482. extend(BlockingFilter, RegExpFilter, {
  483. collapse: null
  484. });
  485.  
  486. function WhitelistFilter(text, regexpSource, contentType, matchCase, domains, thirdParty, sitekeys)
  487. {
  488. RegExpFilter.call(this, text, regexpSource, contentType, matchCase, domains, thirdParty, sitekeys);
  489. }
  490. extend(WhitelistFilter, RegExpFilter, {
  491. });
  492.  
  493. function Matcher()
  494. {
  495. this.clear();
  496. }
  497. Matcher.prototype = {
  498. filterByKeyword: null,
  499. keywordByFilter: null,
  500. clear: function()
  501. {
  502. this.filterByKeyword = createDict();
  503. this.keywordByFilter = createDict();
  504. },
  505. add: function(filter)
  506. {
  507. if (filter.text in this.keywordByFilter)
  508. {
  509. return;
  510. }
  511. var keyword = this.findKeyword(filter);
  512. var oldEntry = this.filterByKeyword[keyword];
  513. if (typeof oldEntry == "undefined")
  514. {
  515. this.filterByKeyword[keyword] = filter;
  516. }
  517. else if (oldEntry.length == 1)
  518. {
  519. this.filterByKeyword[keyword] = [oldEntry, filter];
  520. }
  521. else
  522. {
  523. oldEntry.push(filter);
  524. }
  525. this.keywordByFilter[filter.text] = keyword;
  526. },
  527. remove: function(filter)
  528. {
  529. if (!(filter.text in this.keywordByFilter))
  530. {
  531. return;
  532. }
  533. var keyword = this.keywordByFilter[filter.text];
  534. var list = this.filterByKeyword[keyword];
  535. if (list.length <= 1)
  536. {
  537. delete this.filterByKeyword[keyword];
  538. }
  539. else
  540. {
  541. var index = list.indexOf(filter);
  542. if (index >= 0)
  543. {
  544. list.splice(index, 1);
  545. if (list.length == 1)
  546. {
  547. this.filterByKeyword[keyword] = list[0];
  548. }
  549. }
  550. }
  551. delete this.keywordByFilter[filter.text];
  552. },
  553. findKeyword: function(filter)
  554. {
  555. var result = "";
  556. var text = filter.text;
  557. if (Filter.regexpRegExp.test(text))
  558. {
  559. return result;
  560. }
  561. var match = Filter.optionsRegExp.exec(text);
  562. if (match)
  563. {
  564. text = match.input.substr(0, match.index);
  565. }
  566. if (text.substr(0, 2) == "@@")
  567. {
  568. text = text.substr(2);
  569. }
  570. var candidates = text.toLowerCase().match(/[^a-z0-9%*][a-z0-9%]{3,}(?=[^a-z0-9%*])/g);
  571. if (!candidates)
  572. {
  573. return result;
  574. }
  575. var hash = this.filterByKeyword;
  576. var resultCount = 16777215;
  577. var resultLength = 0;
  578. for (var i = 0, l = candidates.length; i < l; i++)
  579. {
  580. var candidate = candidates[i].substr(1);
  581. var count = candidate in hash ? hash[candidate].length : 0;
  582. if (count < resultCount || count == resultCount && candidate.length > resultLength)
  583. {
  584. result = candidate;
  585. resultCount = count;
  586. resultLength = candidate.length;
  587. }
  588. }
  589. return result;
  590. },
  591. hasFilter: function(filter)
  592. {
  593. return filter.text in this.keywordByFilter;
  594. },
  595. getKeywordForFilter: function(filter)
  596. {
  597. if (filter.text in this.keywordByFilter)
  598. {
  599. return this.keywordByFilter[filter.text];
  600. }
  601. else
  602. {
  603. return null;
  604. }
  605. },
  606. _checkEntryMatch: function(keyword, location, contentType, docDomain, thirdParty, sitekey)
  607. {
  608. var list = this.filterByKeyword[keyword];
  609. for (var i = 0; i < list.length; i++)
  610. {
  611. var filter = list[i];
  612. if (filter == "#this")
  613. {
  614. filter = list;
  615. }
  616. if (filter.matches(location, contentType, docDomain, thirdParty, sitekey))
  617. {
  618. return filter;
  619. }
  620. }
  621. return null;
  622. },
  623. matchesAny: function(location, contentType, docDomain, thirdParty, sitekey)
  624. {
  625. var candidates = location.toLowerCase().match(/[a-z0-9%]{3,}/g);
  626. if (candidates === null)
  627. {
  628. candidates = [];
  629. }
  630. candidates.push("");
  631. for (var i = 0, l = candidates.length; i < l; i++)
  632. {
  633. var substr = candidates[i];
  634. if (substr in this.filterByKeyword)
  635. {
  636. var result = this._checkEntryMatch(substr, location, contentType, docDomain, thirdParty, sitekey);
  637. if (result)
  638. {
  639. return result;
  640. }
  641. }
  642. }
  643. return null;
  644. }
  645. };
  646.  
  647. function CombinedMatcher()
  648. {
  649. this.blacklist = new Matcher();
  650. this.whitelist = new Matcher();
  651. this.resultCache = createDict();
  652. }
  653. CombinedMatcher.maxCacheEntries = 1000;
  654. CombinedMatcher.prototype = {
  655. blacklist: null,
  656. whitelist: null,
  657. resultCache: null,
  658. cacheEntries: 0,
  659. clear: function()
  660. {
  661. this.blacklist.clear();
  662. this.whitelist.clear();
  663. this.resultCache = createDict();
  664. this.cacheEntries = 0;
  665. },
  666. add: function(filter)
  667. {
  668. if (filter instanceof WhitelistFilter)
  669. {
  670. this.whitelist.add(filter);
  671. }
  672. else
  673. {
  674. this.blacklist.add(filter);
  675. }
  676. if (this.cacheEntries > 0)
  677. {
  678. this.resultCache = createDict();
  679. this.cacheEntries = 0;
  680. }
  681. },
  682. remove: function(filter)
  683. {
  684. if (filter instanceof WhitelistFilter)
  685. {
  686. this.whitelist.remove(filter);
  687. }
  688. else
  689. {
  690. this.blacklist.remove(filter);
  691. }
  692. if (this.cacheEntries > 0)
  693. {
  694. this.resultCache = createDict();
  695. this.cacheEntries = 0;
  696. }
  697. },
  698. findKeyword: function(filter)
  699. {
  700. if (filter instanceof WhitelistFilter)
  701. {
  702. return this.whitelist.findKeyword(filter);
  703. }
  704. else
  705. {
  706. return this.blacklist.findKeyword(filter);
  707. }
  708. },
  709. hasFilter: function(filter)
  710. {
  711. if (filter instanceof WhitelistFilter)
  712. {
  713. return this.whitelist.hasFilter(filter);
  714. }
  715. else
  716. {
  717. return this.blacklist.hasFilter(filter);
  718. }
  719. },
  720. getKeywordForFilter: function(filter)
  721. {
  722. if (filter instanceof WhitelistFilter)
  723. {
  724. return this.whitelist.getKeywordForFilter(filter);
  725. }
  726. else
  727. {
  728. return this.blacklist.getKeywordForFilter(filter);
  729. }
  730. },
  731. isSlowFilter: function(filter)
  732. {
  733. var matcher = filter instanceof WhitelistFilter ? this.whitelist : this.blacklist;
  734. if (matcher.hasFilter(filter))
  735. {
  736. return !matcher.getKeywordForFilter(filter);
  737. }
  738. else
  739. {
  740. return !matcher.findKeyword(filter);
  741. }
  742. },
  743. matchesAnyInternal: function(location, contentType, docDomain, thirdParty, sitekey)
  744. {
  745. var candidates = location.toLowerCase().match(/[a-z0-9%]{3,}/g);
  746. if (candidates === null)
  747. {
  748. candidates = [];
  749. }
  750. candidates.push("");
  751. var blacklistHit = null;
  752. for (var i = 0, l = candidates.length; i < l; i++)
  753. {
  754. var substr = candidates[i];
  755. if (substr in this.whitelist.filterByKeyword)
  756. {
  757. var result = this.whitelist._checkEntryMatch(substr, location, contentType, docDomain, thirdParty, sitekey);
  758. if (result)
  759. {
  760. return result;
  761. }
  762. }
  763. if (substr in this.blacklist.filterByKeyword && blacklistHit === null)
  764. {
  765. blacklistHit = this.blacklist._checkEntryMatch(substr, location, contentType, docDomain, thirdParty, sitekey);
  766. }
  767. }
  768. return blacklistHit;
  769. },
  770. matchesAny: function(location, docDomain)
  771. {
  772. var key = location + " " + docDomain + " ";
  773. if (key in this.resultCache)
  774. {
  775. return this.resultCache[key];
  776. }
  777. var result = this.matchesAnyInternal(location, 0, docDomain, null, null);
  778. if (this.cacheEntries >= CombinedMatcher.maxCacheEntries)
  779. {
  780. this.resultCache = createDict();
  781. this.cacheEntries = 0;
  782. }
  783. this.resultCache[key] = result;
  784. this.cacheEntries++;
  785. return result;
  786. }
  787. };
  788. var defaultMatcher = new CombinedMatcher();
  789.  
  790. var direct = 'DIRECT;';
  791.  
  792. for (var i = 0; i < rules.length; i++) {
  793. defaultMatcher.add(Filter.fromText(rules[i]));
  794. }
  795.  
  796. function FindProxyForURL(url, host) {
  797. if (defaultMatcher.matchesAny(url, host) instanceof BlockingFilter) {
  798. return proxy;
  799. }
  800. return direct;
  801. }
  802.  
Add Comment
Please, Sign In to add comment