浏览代码

fix: simplify BAD_URL_CHAR

tophf 3 年之前
父节点
当前提交
a32167d878
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      src/background/utils/preinject.js

+ 1 - 3
src/background/utils/preinject.js

@@ -35,9 +35,7 @@ const KEY_EXPOSE = 'expose';
 const KEY_DEF_INJECT_INTO = 'defaultInjectInto';
 const KEY_DEF_INJECT_INTO = 'defaultInjectInto';
 const KEY_IS_APPLIED = 'isApplied';
 const KEY_IS_APPLIED = 'isApplied';
 const KEY_XHR_INJECT = 'xhrInject';
 const KEY_XHR_INJECT = 'xhrInject';
-const BAD_URL_CHAR = IS_FIREFOX
-  ? /[#&',/:;?=+]/g // FF shows `@` fine as ASCII but mangles it as full-width
-  : /[#&',/:;?=+@]/g;
+const BAD_URL_CHAR = /[#/?]/g; // will be encoded to avoid splitting the URL in devtools UI
 const GRANT_NONE_VARS = '{GM,GM_info,unsafeWindow,cloneInto,createObjectIn,exportFunction}';
 const GRANT_NONE_VARS = '{GM,GM_info,unsafeWindow,cloneInto,createObjectIn,exportFunction}';
 const expose = {};
 const expose = {};
 let isApplied;
 let isApplied;