Skip to content

Commit d049a36

Browse files
committed
fix(memoryOptimization.ts): discard chrome.system.memory if firefox
1 parent c1f242b commit d049a36

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/background/memoryOptimization.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ function memoryOptimization() {
103103
};
104104

105105
function preCheckForMemOpt() {
106-
chrome.system.memory.getInfo(function (info) {
107-
if (info.availableCapacity / info.capacity < 0.2) {
108-
checkForMemOpt();
109-
}
110-
});
106+
if (utils.getUa() === 'firefox') {
107+
checkForMemOpt();
108+
} else {
109+
chrome.system.memory.getInfo(function (info) {
110+
if (info.availableCapacity / info.capacity < 0.2) {
111+
checkForMemOpt();
112+
}
113+
});
114+
}
111115
}
112116

113117
function saveSuspendUrl(tab) {

0 commit comments

Comments
 (0)