Przeglądaj źródła

fix: disable magic TLD temporarily

Ref: #214
Gerald 8 lat temu
rodzic
commit
86f77434b3
1 zmienionych plików z 12 dodań i 12 usunięć
  1. 12 12
      src/background/utils/tester.js

+ 12 - 12
src/background/utils/tester.js

@@ -1,4 +1,4 @@
-import tldjs from 'tldjs';
+// import tldjs from 'tldjs';
 import cache from './cache';
 import { getOption, hookOptions } from './options';
 
@@ -82,17 +82,17 @@ function autoReg(str) {
   const tests = [
     tstr => re.test(tstr),
   ];
-  if (str.includes('.tld/')) {
-    const reTldStr = reStr.replace('\\.tld/', '((?:\\.\\w+)+)/');
-    tests.push(tstr => {
-      const matches = tstr.match(reTldStr);
-      if (matches) {
-        const suffix = matches[1].slice(1);
-        if (tldjs.getPublicSuffix(suffix) === suffix) return true;
-      }
-      return false;
-    });
-  }
+  // if (str.includes('.tld/')) {
+  //   const reTldStr = reStr.replace('\\.tld/', '((?:\\.\\w+)+)/');
+  //   tests.push(tstr => {
+  //     const matches = tstr.match(reTldStr);
+  //     if (matches) {
+  //       const suffix = matches[1].slice(1);
+  //       if (tldjs.getPublicSuffix(suffix) === suffix) return true;
+  //     }
+  //     return false;
+  //   });
+  // }
   return { test: tstr => tests.some(test => test(tstr)) };
 }