Merge branch 'master' of github-jeremy:schomery/stylish-chrome

This commit is contained in:
Jeremy Schomery 2017-03-16 17:17:00 +03:30
commit 85a0ce52da

View File

@ -321,14 +321,24 @@ function initObserver() {
iframeObserver.disconnect(); iframeObserver.disconnect();
// we can destroy global functions in this context to free up memory // we can destroy global functions in this context to free up memory
var globals = Object.keys(window); [
for (var i = 0, len = globals.length; i < len; i++) { 'addDocumentStylesToAllIFrames',
var key = globals[i]; 'addDocumentStylesToIFrame',
var obj = window[key]; 'addStyleElement',
if (typeof obj == 'function' && !/native code/.test(obj)) { 'addStyleToIFrameSrcDoc',
window[key] = null; 'applyOnMessage',
} 'applySections',
} 'applyStyles',
'disableAll',
'getDynamicIFrames',
'iframeIsDynamic',
'iframeIsLoadingSrcDoc',
'initObserver',
'removeStyle',
'replaceAll',
'requestStyles',
'retireStyle'
].forEach(fn => window[fn] = null);
// we can destroy global variables // we can destroy global variables
g_styleElements = iframeObserver = retiredStyleIds = null; g_styleElements = iframeObserver = retiredStyleIds = null;