Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29555932: Issue 5781 - Merge messages for regular and emulated element hiding filters (Closed)
Patch Set: Addressed comments Created Sept. 26, 2017, 9:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -345,16 +345,11 @@
this.style = null;
this.tracer = null;
this.inject = true;
+ this.emulatedPatterns = null;
this.elemHideEmulation = new ElemHideEmulation(
window,
- callback =>
- {
- ext.backgroundPage.sendMessage({
- type: "filters.get",
- what: "elemhideemulation"
- }, callback);
- },
+ callback => callback(this.emulatedPatterns),
this.addSelectors.bind(this),
this.hideElements.bind(this)
);
@@ -506,7 +501,9 @@
else if (this.tracer)
this.tracer.addSelectors(response.selectors);
+ this.emulatedPatterns = response.emulatedPatterns;
this.elemHideEmulation.apply();
+ this.emulatedPatterns = null;
Sebastian Noack 2017/09/26 21:50:40 Don't leak memory.
});
}
};
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld