| Index: lib/contentFiltering.js |
| =================================================================== |
| --- a/lib/contentFiltering.js |
| +++ b/lib/contentFiltering.js |
| @@ -156,17 +156,22 @@ |
| return false; |
| // Sometimes the old and new style sheets can be exactly the same. In such a |
| // case, do not remove the "old" style sheet, because it is in fact the new |
| // style sheet now. |
| if (oldStyleSheet && oldStyleSheet != styleSheet) |
| removeStyleSheet(tabId, frameId, oldStyleSheet); |
| - frame.injectedStyleSheets.set(groupName, styleSheet); |
| + // The standard style sheet is ~660 KB per frame (as of Adblock Plus 3.3.2). |
| + // Keeping it in memory would only really be useful on Firefox, which allows |
| + // us to remove it via the tabs.removeCSS API. By choosing not to hold on to |
| + // it, we save potentially several megabytes per tab (#6967). |
| + if (groupName != "standard") |
| + frame.injectedStyleSheets.set(groupName, styleSheet); |
| return true; |
| } |
| function getExecutableCode(script) |
| { |
| let code = executableCode.get(script); |
| if (code) |
| return code; |