Browse Source

Fix include rules

Gerald 10 years ago
parent
commit
805261e026
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/background/utils.js

+ 2 - 2
src/background/utils.js

@@ -61,7 +61,7 @@ var scriptUtils = {
       custom: {},
       enabled: 1,
       update: 1,
-      code: '// ==UserScript==\n// @name New Script\n// @namespace Violentmonkey Scripts\n// @include *\n// @grant none\n// ==/UserScript==\n',
+      code: '// ==UserScript==\n// @name New Script\n// @namespace Violentmonkey Scripts\n// @grant none\n// ==/UserScript==\n',
     };
     script.meta = scriptUtils.parseMeta(script.code);
     return script;
@@ -114,7 +114,7 @@ var tester = function () {
       });
     } else {
       // @include
-      ok = inc.some(function (str) {
+      ok = !inc.length || inc.some(function (str) {
         return autoReg(str).test(url);
       });
     }