diff options
Diffstat (limited to 'js/messaging.js')
-rw-r--r-- | js/messaging.js | 266 |
1 files changed, 133 insertions, 133 deletions
diff --git a/js/messaging.js b/js/messaging.js index d5c472f..0a1ff4a 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -29,7 +29,7 @@ (function() { -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -39,11 +39,11 @@ function onMessage(request, sender, callback) { // Async switch ( request.what ) { case 'getAssetContent': - µm.assets.get(request.url, { dontCache: true }, callback); + ηm.assets.get(request.url, { dontCache: true }, callback); return; case 'selectHostsFiles': - µm.selectHostsFiles(request, callback); + ηm.selectHostsFiles(request, callback); return; default: @@ -55,35 +55,35 @@ function onMessage(request, sender, callback) { switch ( request.what ) { case 'forceReloadTab': - µm.forceReload(request.tabId, request.bypassCache); + ηm.forceReload(request.tabId, request.bypassCache); break; case 'forceUpdateAssets': - µm.scheduleAssetUpdater(0); - µm.assets.updateStart({ delay: 2000 }); + ηm.scheduleAssetUpdater(0); + ηm.assets.updateStart({ delay: 2000 }); break; case 'getUserSettings': response = { - userSettings: µm.userSettings, + userSettings: ηm.userSettings, matrixSwitches: { - 'https-strict': µm.pMatrix.evaluateSwitch('https-strict', '*') === 1, - 'referrer-spoof': µm.pMatrix.evaluateSwitch('referrer-spoof', '*') === 1, - 'noscript-spoof': µm.pMatrix.evaluateSwitch('noscript-spoof', '*') === 1 + 'https-strict': ηm.pMatrix.evaluateSwitch('https-strict', '*') === 1, + 'referrer-spoof': ηm.pMatrix.evaluateSwitch('referrer-spoof', '*') === 1, + 'noscript-spoof': ηm.pMatrix.evaluateSwitch('noscript-spoof', '*') === 1 } }; break; case 'gotoExtensionURL': - µm.gotoExtensionURL(request); + ηm.gotoExtensionURL(request); break; case 'gotoURL': - µm.gotoURL(request); + ηm.gotoURL(request); break; case 'mustBlock': - response = µm.mustBlock( + response = ηm.mustBlock( request.scope, request.hostname, request.type @@ -91,17 +91,17 @@ function onMessage(request, sender, callback) { break; case 'readRawSettings': - response = µm.stringFromRawSettings(); + response = ηm.stringFromRawSettings(); break; case 'reloadHostsFiles': - µm.reloadHostsFiles(); + ηm.reloadHostsFiles(); break; case 'setMatrixSwitch': - µm.tMatrix.setSwitch(request.switchName, '*', request.state); - if ( µm.pMatrix.setSwitch(request.switchName, '*', request.state) ) { - µm.saveMatrix(); + ηm.tMatrix.setSwitch(request.switchName, '*', request.state); + if ( ηm.pMatrix.setSwitch(request.switchName, '*', request.state) ) { + ηm.saveMatrix(); } break; @@ -109,11 +109,11 @@ function onMessage(request, sender, callback) { if ( request.hasOwnProperty('value') === false ) { request.value = undefined; } - response = µm.changeUserSettings(request.name, request.value); + response = ηm.changeUserSettings(request.name, request.value); break; case 'writeRawSettings': - µm.rawSettingsFromString(request.content); + ηm.rawSettingsFromString(request.content); break; default: @@ -138,7 +138,7 @@ vAPI.messaging.setup(onMessage); // popup.js -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -146,15 +146,15 @@ var µm = µMatrix; var RowSnapshot = function(srcHostname, desHostname, desDomain) { this.domain = desDomain; - this.temporary = µm.tMatrix.evaluateRowZXY(srcHostname, desHostname); - this.permanent = µm.pMatrix.evaluateRowZXY(srcHostname, desHostname); + this.temporary = ηm.tMatrix.evaluateRowZXY(srcHostname, desHostname); + this.permanent = ηm.pMatrix.evaluateRowZXY(srcHostname, desHostname); this.counts = RowSnapshot.counts.slice(); this.totals = RowSnapshot.counts.slice(); }; RowSnapshot.counts = (function() { var aa = []; - for ( var i = 0, n = µm.Matrix.columnHeaderIndices.size; i < n; i++ ) { + for ( var i = 0, n = ηm.Matrix.columnHeaderIndices.size; i < n; i++ ) { aa[i] = 0; } return aa; @@ -163,14 +163,14 @@ RowSnapshot.counts = (function() { /******************************************************************************/ var matrixSnapshot = function(pageStore, details) { - var µmuser = µm.userSettings; - var headerIndices = µm.Matrix.columnHeaderIndices; + var ηmuser = ηm.userSettings; + var headerIndices = ηm.Matrix.columnHeaderIndices; var r = { appVersion: vAPI.app.version, blockedCount: pageStore.requestStats.blocked.all, - collapseAllDomains: µmuser.popupCollapseAllDomains, - collapseBlacklistedDomains: µmuser.popupCollapseBlacklistedDomains, + collapseAllDomains: ηmuser.popupCollapseAllDomains, + collapseBlacklistedDomains: ηmuser.popupCollapseBlacklistedDomains, diff: [], domain: pageStore.pageDomain, has3pReferrer: pageStore.has3pReferrer, @@ -183,35 +183,35 @@ var matrixSnapshot = function(pageStore, details) { mtxCountModified: pageStore.mtxCountModifiedTime !== details.mtxCountModifiedTime, mtxContentModifiedTime: pageStore.mtxContentModifiedTime, mtxCountModifiedTime: pageStore.mtxCountModifiedTime, - pMatrixModified: µm.pMatrix.modifiedTime !== details.pMatrixModifiedTime, - pMatrixModifiedTime: µm.pMatrix.modifiedTime, + pMatrixModified: ηm.pMatrix.modifiedTime !== details.pMatrixModifiedTime, + pMatrixModifiedTime: ηm.pMatrix.modifiedTime, pSwitches: {}, rows: {}, rowCount: 0, scope: '*', tabId: pageStore.tabId, - tMatrixModified: µm.tMatrix.modifiedTime !== details.tMatrixModifiedTime, - tMatrixModifiedTime: µm.tMatrix.modifiedTime, + tMatrixModified: ηm.tMatrix.modifiedTime !== details.tMatrixModifiedTime, + tMatrixModifiedTime: ηm.tMatrix.modifiedTime, tSwitches: {}, url: pageStore.pageUrl, userSettings: { - colorBlindFriendly: µmuser.colorBlindFriendly, - displayTextSize: µmuser.displayTextSize, - popupScopeLevel: µmuser.popupScopeLevel + colorBlindFriendly: ηmuser.colorBlindFriendly, + displayTextSize: ηmuser.displayTextSize, + popupScopeLevel: ηmuser.popupScopeLevel } }; if ( typeof details.scope === 'string' ) { r.scope = details.scope; - } else if ( µmuser.popupScopeLevel === 'site' ) { + } else if ( ηmuser.popupScopeLevel === 'site' ) { r.scope = r.hostname; - } else if ( µmuser.popupScopeLevel === 'domain' ) { + } else if ( ηmuser.popupScopeLevel === 'domain' ) { r.scope = r.domain; } - for ( var switchName of µm.Matrix.switchNames ) { - r.tSwitches[switchName] = µm.tMatrix.evaluateSwitchZ(switchName, r.scope); - r.pSwitches[switchName] = µm.pMatrix.evaluateSwitchZ(switchName, r.scope); + for ( var switchName of ηm.Matrix.switchNames ) { + r.tSwitches[switchName] = ηm.tMatrix.evaluateSwitchZ(switchName, r.scope); + r.pSwitches[switchName] = ηm.pMatrix.evaluateSwitchZ(switchName, r.scope); } // These rows always exist @@ -219,7 +219,7 @@ var matrixSnapshot = function(pageStore, details) { r.rows['1st-party'] = new RowSnapshot(r.scope, '1st-party', '1st-party'); r.rowCount += 1; - var µmuri = µm.URI; + var ηmuri = ηm.URI; var reqType, reqHostname, reqDomain; var desHostname; var row, typeIndex; @@ -235,7 +235,7 @@ var matrixSnapshot = function(pageStore, details) { if ( reqHostname === '' ) { reqHostname = pageStore.pageHostname; } - reqDomain = µmuri.domainFromHostname(reqHostname) || reqHostname; + reqDomain = ηmuri.domainFromHostname(reqHostname) || reqHostname; // We want rows of self and ancestors desHostname = reqHostname; @@ -263,7 +263,7 @@ var matrixSnapshot = function(pageStore, details) { row.totals[anyIndex] += count; } - r.diff = µm.tMatrix.diff(µm.pMatrix, r.hostname, Object.keys(r.rows)); + r.diff = ηm.tMatrix.diff(ηm.pMatrix, r.hostname, Object.keys(r.rows)); return r; }; @@ -272,7 +272,7 @@ var matrixSnapshot = function(pageStore, details) { var matrixSnapshotFromTabId = function(details, callback) { var matrixSnapshotIf = function(tabId, details) { - var pageStore = µm.pageStoreFromTabId(tabId); + var pageStore = ηm.pageStoreFromTabId(tabId); if ( pageStore === null ) { callback('ENOTFOUND'); return; @@ -280,8 +280,8 @@ var matrixSnapshotFromTabId = function(details, callback) { // First verify whether we must return data or not. if ( - µm.tMatrix.modifiedTime === details.tMatrixModifiedTime && - µm.pMatrix.modifiedTime === details.pMatrixModifiedTime && + ηm.tMatrix.modifiedTime === details.tMatrixModifiedTime && + ηm.pMatrix.modifiedTime === details.pMatrixModifiedTime && pageStore.mtxContentModifiedTime === details.mtxContentModifiedTime && pageStore.mtxCountModifiedTime === details.mtxCountModifiedTime ) { @@ -333,15 +333,15 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'toggleMatrixSwitch': - µm.tMatrix.setSwitchZ( + ηm.tMatrix.setSwitchZ( request.switchName, request.srcHostname, - µm.tMatrix.evaluateSwitchZ(request.switchName, request.srcHostname) === false + ηm.tMatrix.evaluateSwitchZ(request.switchName, request.srcHostname) === false ); break; case 'blacklistMatrixCell': - µm.tMatrix.blacklistCell( + ηm.tMatrix.blacklistCell( request.srcHostname, request.desHostname, request.type @@ -349,7 +349,7 @@ var onMessage = function(request, sender, callback) { break; case 'whitelistMatrixCell': - µm.tMatrix.whitelistCell( + ηm.tMatrix.whitelistCell( request.srcHostname, request.desHostname, request.type @@ -357,7 +357,7 @@ var onMessage = function(request, sender, callback) { break; case 'graylistMatrixCell': - µm.tMatrix.graylistCell( + ηm.tMatrix.graylistCell( request.srcHostname, request.desHostname, request.type @@ -365,17 +365,17 @@ var onMessage = function(request, sender, callback) { break; case 'applyDiffToPermanentMatrix': // aka "persist" - if ( µm.pMatrix.applyDiff(request.diff, µm.tMatrix) ) { - µm.saveMatrix(); + if ( ηm.pMatrix.applyDiff(request.diff, ηm.tMatrix) ) { + ηm.saveMatrix(); } break; case 'applyDiffToTemporaryMatrix': // aka "revert" - µm.tMatrix.applyDiff(request.diff, µm.pMatrix); + ηm.tMatrix.applyDiff(request.diff, ηm.pMatrix); break; case 'revertTemporaryMatrix': - µm.tMatrix.assign(µm.pMatrix); + ηm.tMatrix.assign(ηm.pMatrix); break; default: @@ -396,7 +396,7 @@ vAPI.messaging.listen('popup.js', onMessage); (function() { -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -404,12 +404,12 @@ var foundInlineCode = function(tabId, pageStore, details, type) { if ( pageStore === null ) { return; } var pageHostname = pageStore.pageHostname, - µmuri = µm.URI.set(details.documentURI), - frameURL = µmuri.normalizedURI(); + ηmuri = ηm.URI.set(details.documentURI), + frameURL = ηmuri.normalizedURI(); var blocked = details.blocked; if ( blocked === undefined ) { - blocked = µm.mustBlock(pageHostname, µmuri.hostname, type); + blocked = ηm.mustBlock(pageHostname, ηmuri.hostname, type); } var mapTo = { @@ -421,31 +421,31 @@ var foundInlineCode = function(tabId, pageStore, details, type) { // Look-up here whether inline scripting is blocked for the frame. var url = frameURL + '{inline_' + mapTo[type] + '}'; pageStore.recordRequest(type, url, blocked); - µm.logger.writeOne(tabId, 'net', pageHostname, url, type, blocked); + ηm.logger.writeOne(tabId, 'net', pageHostname, url, type, blocked); }; /******************************************************************************/ var contentScriptLocalStorageHandler = function(tabId, originURL) { - var tabContext = µm.tabContextManager.lookup(tabId); + var tabContext = ηm.tabContextManager.lookup(tabId); if ( tabContext === null ) { return; } - var blocked = µm.mustBlock( + var blocked = ηm.mustBlock( tabContext.rootHostname, - µm.URI.hostnameFromURI(originURL), + ηm.URI.hostnameFromURI(originURL), 'cookie' ); - var pageStore = µm.pageStoreFromTabId(tabId); + var pageStore = ηm.pageStoreFromTabId(tabId); if ( pageStore !== null ) { var requestURL = originURL + '/{localStorage}'; pageStore.recordRequest('cookie', requestURL, blocked); - µm.logger.writeOne(tabId, 'net', tabContext.rootHostname, requestURL, 'cookie', blocked); + ηm.logger.writeOne(tabId, 'net', tabContext.rootHostname, requestURL, 'cookie', blocked); } - var removeStorage = blocked && µm.userSettings.deleteLocalStorage; + var removeStorage = blocked && ηm.userSettings.deleteLocalStorage; if ( removeStorage ) { - µm.localStorageRemovedCounter++; + ηm.localStorageRemovedCounter++; } return removeStorage; @@ -456,33 +456,33 @@ var contentScriptLocalStorageHandler = function(tabId, originURL) { // Evaluate many URLs against the matrix. var lookupBlockedCollapsibles = function(tabId, requests) { - if ( placeholdersReadTime < µm.rawSettingsWriteTime ) { + if ( placeholdersReadTime < ηm.rawSettingsWriteTime ) { placeholders = undefined; } if ( placeholders === undefined ) { placeholders = { - frame: µm.rawSettings.framePlaceholder, - image: µm.rawSettings.imagePlaceholder + frame: ηm.rawSettings.framePlaceholder, + image: ηm.rawSettings.imagePlaceholder }; if ( placeholders.frame ) { placeholders.frameDocument = - µm.rawSettings.framePlaceholderDocument.replace( + ηm.rawSettings.framePlaceholderDocument.replace( '{{bg}}', - µm.rawSettings.framePlaceholderBackground !== 'default' ? - µm.rawSettings.framePlaceholderBackground : - µm.rawSettings.placeholderBackground + ηm.rawSettings.framePlaceholderBackground !== 'default' ? + ηm.rawSettings.framePlaceholderBackground : + ηm.rawSettings.placeholderBackground ); } if ( placeholders.image ) { placeholders.imageBorder = - µm.rawSettings.imagePlaceholderBorder !== 'default' ? - µm.rawSettings.imagePlaceholderBorder : - µm.rawSettings.placeholderBorder; + ηm.rawSettings.imagePlaceholderBorder !== 'default' ? + ηm.rawSettings.imagePlaceholderBorder : + ηm.rawSettings.placeholderBorder; placeholders.imageBackground = - µm.rawSettings.imagePlaceholderBackground !== 'default' ? - µm.rawSettings.imagePlaceholderBackground : - µm.rawSettings.placeholderBackground; + ηm.rawSettings.imagePlaceholderBackground !== 'default' ? + ηm.rawSettings.imagePlaceholderBackground : + ηm.rawSettings.placeholderBackground; } placeholdersReadTime = Date.now(); } @@ -494,12 +494,12 @@ var lookupBlockedCollapsibles = function(tabId, requests) { placeholders: placeholders }; - var tabContext = µm.tabContextManager.lookup(tabId); + var tabContext = ηm.tabContextManager.lookup(tabId); if ( tabContext === null ) { return response; } - var pageStore = µm.pageStoreFromTabId(tabId); + var pageStore = ηm.pageStoreFromTabId(tabId); if ( pageStore !== null ) { pageStore.lookupBlockedCollapsibles(requests, response); } @@ -520,9 +520,9 @@ var onMessage = function(request, sender, callback) { } var tabId = sender && sender.tab ? sender.tab.id || 0 : 0, - tabContext = µm.tabContextManager.lookup(tabId), + tabContext = ηm.tabContextManager.lookup(tabId), rootHostname = tabContext && tabContext.rootHostname, - pageStore = µm.pageStoreFromTabId(tabId); + pageStore = ηm.pageStoreFromTabId(tabId); // Sync var response; @@ -539,20 +539,20 @@ var onMessage = function(request, sender, callback) { case 'mustRenderNoscriptTags?': if ( tabContext === null ) { break; } response = - µm.tMatrix.mustBlock(rootHostname, rootHostname, 'script') && - µm.tMatrix.evaluateSwitchZ('noscript-spoof', rootHostname); + ηm.tMatrix.mustBlock(rootHostname, rootHostname, 'script') && + ηm.tMatrix.evaluateSwitchZ('noscript-spoof', rootHostname); if ( pageStore !== null ) { pageStore.hasNoscriptTags = true; } // https://github.com/gorhill/uMatrix/issues/225 // A good place to force an update of the page title, as at // this point the DOM has been loaded. - µm.updateTitle(tabId); + ηm.updateTitle(tabId); break; case 'securityPolicyViolation': if ( request.directive === 'worker-src' ) { - var url = µm.URI.hostnameFromURI(request.blockedURI) !== '' ? + var url = ηm.URI.hostnameFromURI(request.blockedURI) !== '' ? request.blockedURI : request.documentURI; if ( pageStore !== null ) { @@ -560,7 +560,7 @@ var onMessage = function(request, sender, callback) { pageStore.recordRequest('script', url, true); } if ( tabContext !== null ) { - µm.logger.writeOne(tabId, 'net', rootHostname, url, 'worker', request.blocked); + ηm.logger.writeOne(tabId, 'net', rootHostname, url, 'worker', request.blocked); } } else if ( request.directive === 'script-src' ) { foundInlineCode(tabId, pageStore, request, 'script'); @@ -571,7 +571,7 @@ var onMessage = function(request, sender, callback) { case 'shutdown?': if ( tabContext !== null ) { - response = µm.tMatrix.evaluateSwitchZ('matrix-off', rootHostname); + response = ηm.tMatrix.evaluateSwitchZ('matrix-off', rootHostname); } break; @@ -597,7 +597,7 @@ vAPI.messaging.listen('contentscript.js', onMessage); /******************************************************************************/ -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -606,7 +606,7 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'cloudGetOptions': vAPI.cloud.getOptions(function(options) { - options.enabled = µm.userSettings.cloudStorageEnabled === true; + options.enabled = ηm.userSettings.cloudStorageEnabled === true; callback(options); }); return; @@ -655,7 +655,7 @@ vAPI.messaging.listen('cloud-ui.js', onMessage); (function() { -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -673,22 +673,22 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'getUserRules': response = { - temporaryRules: µm.tMatrix.toString(), - permanentRules: µm.pMatrix.toString() + temporaryRules: ηm.tMatrix.toString(), + permanentRules: ηm.pMatrix.toString() }; break; case 'setUserRules': if ( typeof request.temporaryRules === 'string' ) { - µm.tMatrix.fromString(request.temporaryRules); + ηm.tMatrix.fromString(request.temporaryRules); } if ( typeof request.permanentRules === 'string' ) { - µm.pMatrix.fromString(request.permanentRules); - µm.saveMatrix(); + ηm.pMatrix.fromString(request.permanentRules); + ηm.saveMatrix(); } response = { - temporaryRules: µm.tMatrix.toString(), - permanentRules: µm.pMatrix.toString() + temporaryRules: ηm.tMatrix.toString(), + permanentRules: ηm.pMatrix.toString() }; break; @@ -710,12 +710,12 @@ vAPI.messaging.listen('user-rules.js', onMessage); (function() { -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ var prepEntries = function(entries) { - var µmuri = µm.URI; + var ηmuri = ηm.URI; var entry; for ( var k in entries ) { if ( entries.hasOwnProperty(k) === false ) { @@ -723,8 +723,8 @@ var prepEntries = function(entries) { } entry = entries[k]; if ( typeof entry.homeURL === 'string' ) { - entry.homeHostname = µmuri.hostnameFromURI(entry.homeURL); - entry.homeDomain = µmuri.domainFromHostname(entry.homeHostname); + entry.homeHostname = ηmuri.hostnameFromURI(entry.homeURL); + entry.homeDomain = ηmuri.domainFromHostname(entry.homeHostname); } } }; @@ -733,11 +733,11 @@ var prepEntries = function(entries) { var getLists = function(callback) { var r = { - autoUpdate: µm.userSettings.autoUpdate, + autoUpdate: ηm.userSettings.autoUpdate, available: null, cache: null, - current: µm.liveHostsFiles, - blockedHostnameCount: µm.ubiquitousBlacklist.count + current: ηm.liveHostsFiles, + blockedHostnameCount: ηm.ubiquitousBlacklist.count }; var onMetadataReady = function(entries) { r.cache = entries; @@ -747,15 +747,15 @@ var getLists = function(callback) { var onAvailableHostsFilesReady = function(lists) { r.available = lists; prepEntries(r.available); - µm.assets.metadata(onMetadataReady); + ηm.assets.metadata(onMetadataReady); }; - µm.getAvailableHostsFiles(onAvailableHostsFilesReady); + ηm.getAvailableHostsFiles(onAvailableHostsFilesReady); }; /******************************************************************************/ var onMessage = function(request, sender, callback) { - var µm = µMatrix; + var ηm = ηMatrix; // Async switch ( request.what ) { @@ -771,15 +771,15 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'purgeCache': - µm.assets.purge(request.assetKey); - µm.assets.remove('compiled/' + request.assetKey); + ηm.assets.purge(request.assetKey); + ηm.assets.remove('compiled/' + request.assetKey); break; case 'purgeAllCaches': if ( request.hard ) { - µm.assets.remove(/./); + ηm.assets.remove(/./); } else { - µm.assets.purge(/./, 'public_suffix_list.dat'); + ηm.assets.purge(/./, 'public_suffix_list.dat'); } break; @@ -801,7 +801,7 @@ vAPI.messaging.listen('hosts-files.js', onMessage); (function() { -var µm = µMatrix; +var ηm = ηMatrix; /******************************************************************************/ @@ -819,13 +819,13 @@ var restoreUserData = function(userData) { vAPI.storage.set({ userMatrix: userData.rules }, onCountdown); vAPI.storage.set({ liveHostsFiles: userData.hostsFiles }, onCountdown); if ( userData.rawSettings instanceof Object ) { - µMatrix.saveRawSettings(userData.rawSettings, onCountdown); + ηMatrix.saveRawSettings(userData.rawSettings, onCountdown); } }; // If we are going to restore all, might as well wipe out clean local // storage - µm.XAL.keyvalRemoveAll(onAllRemoved); + ηm.XAL.keyvalRemoveAll(onAllRemoved); }; /******************************************************************************/ @@ -834,7 +834,7 @@ var resetUserData = function() { var onAllRemoved = function() { vAPI.app.restart(); }; - µm.XAL.keyvalRemoveAll(onAllRemoved); + ηm.XAL.keyvalRemoveAll(onAllRemoved); }; /******************************************************************************/ @@ -855,17 +855,17 @@ var onMessage = function(request, sender, callback) { app: vAPI.app.name, version: vAPI.app.version, when: Date.now(), - settings: µm.userSettings, - rules: µm.pMatrix.toString(), - hostsFiles: µm.liveHostsFiles, - rawSettings: µm.rawSettings + settings: ηm.userSettings, + rules: ηm.pMatrix.toString(), + hostsFiles: ηm.liveHostsFiles, + rawSettings: ηm.rawSettings }; break; case 'getSomeStats': response = { version: vAPI.app.version, - storageUsed: µm.storageUsed + storageUsed: ηm.storageUsed }; break; @@ -895,7 +895,7 @@ vAPI.messaging.listen('about.js', onMessage); /******************************************************************************/ -var µm = µMatrix, +var ηm = ηMatrix, loggerURL = vAPI.getURL('logger-ui.html'); /******************************************************************************/ @@ -913,32 +913,32 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'readMany': if ( - µm.logger.ownerId !== undefined && - request.ownerId !== µm.logger.ownerId + ηm.logger.ownerId !== undefined && + request.ownerId !== ηm.logger.ownerId ) { response = { unavailable: true }; break; } var tabIds = {}; - for ( var tabId in µm.pageStores ) { - var pageStore = µm.pageStoreFromTabId(tabId); + for ( var tabId in ηm.pageStores ) { + var pageStore = ηm.pageStoreFromTabId(tabId); if ( pageStore === null ) { continue; } if ( pageStore.rawUrl.startsWith(loggerURL) ) { continue; } tabIds[tabId] = pageStore.title || pageStore.rawUrl; } response = { colorBlind: false, - entries: µm.logger.readAll(request.ownerId), - maxLoggedRequests: µm.userSettings.maxLoggedRequests, + entries: ηm.logger.readAll(request.ownerId), + maxLoggedRequests: ηm.userSettings.maxLoggedRequests, noTabId: vAPI.noTabId, tabIds: tabIds, - tabIdsToken: µm.pageStoresToken + tabIdsToken: ηm.pageStoresToken }; break; case 'releaseView': - if ( request.ownerId === µm.logger.ownerId ) { - µm.logger.ownerId = undefined; + if ( request.ownerId === ηm.logger.ownerId ) { + ηm.logger.ownerId = undefined; } break; |