Skip to content

Commit

Permalink
limit bgMortalChanged to mv3
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Feb 12, 2025
1 parent 1ddf2d3 commit 93deaaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/background/style-manager/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ const toWrite = new Set();

export default cache;

bgMortalChanged.add(val => {
if (val) cacheDB.putMany(Object.values(cache));
else cacheDB.clear();
});
if (__.MV3) {
bgMortalChanged.add(val => {
if (val) cacheDB.putMany(Object.values(cache));
else cacheDB.clear();
});
}

/** @param {MatchCache.Entry} val
* @return {void} */
Expand Down
2 changes: 1 addition & 1 deletion src/background/tab-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const putObject = obj => stateDB.putMany(
Object.keys(obj).map(Number)
);

export const bgMortalChanged = new Set();
export const bgMortalChanged = __.MV3 && new Set();
export let bgMortal;

bgInit.push(async () => {
Expand Down

0 comments on commit 93deaaa

Please sign in to comment.