瀏覽代碼

fix #2222: remove #2214 bug leftovers from db

tophf 11 月之前
父節點
當前提交
879c27c753
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/background/utils/db.js

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

@@ -156,7 +156,9 @@ addOwnCommands({
         id,
         uri,
       };
-      script.custom = Object.assign({}, defaultCustom, script.custom);
+      const {pathMap} = script.custom = Object.assign({}, defaultCustom, script.custom);
+      // Patching the bug in 2.27.0 where data: URI was saved as invalid in pathMap
+      if (pathMap) for (const url in pathMap) if (isDataUri(url)) delete pathMap[url];
       maxScriptId = Math.max(maxScriptId, id);
       maxScriptPosition = Math.max(maxScriptPosition, getInt(script.props.position));
       (script.config.removed ? removedScripts : aliveScripts).push(script);