diff --git a/src/css/popup.css b/src/css/popup.css index 3560732..5a9c8bd 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -340,7 +340,7 @@ body.tScopeNarrow #scopeCell { .matrix .matGroup.g0 .matSection:first-child { margin-top: 0; } -.matrix .matGroup.g3 .matSection:first-child { +.matrix .matGroup.g4 .matSection:first-child { margin-top: 0; } /* Collapsing of domains */ @@ -358,7 +358,7 @@ body.tScopeNarrow #scopeCell { } /* Collapsing of blacklisted */ -.matrix .g3Meta { +.matrix .g4Meta { margin: 0; padding: 0; border: 0; @@ -368,29 +368,29 @@ body.tScopeNarrow #scopeCell { opacity: 0.2; cursor: pointer; } -.matrix .g3Meta:hover { +.matrix .g4Meta:hover { opacity: 0.4; } -.matrix .g3Meta.g3Collapsed { +.matrix .g4Meta.g4Collapsed { background: url('/img/matrix-group-show.png') no-repeat center top, url('/img/matrix-group-hline.png') repeat-x center top 3px; } -.matrix .g3Meta.g3Collapsed ~ .matSection { +.matrix .g4Meta.g4Collapsed ~ .matSection { display: none; } -body.powerOff .matrix .g3Meta.g3Collapsed ~ .matSection { +body.powerOff .matrix .g4Meta.g4Collapsed ~ .matSection { display: block; } -.matrix .g3Meta ~ .matRow.ro { +.matrix .g4Meta ~ .matRow.ro { display: none; } -.matrix .g3Meta.g3Collapsed ~ .matRow.ro { +.matrix .g4Meta.g4Collapsed ~ .matRow.ro { display: block; } -body.powerOff .matrix .g3Meta.g3Collapsed ~ .matRow.ro { +body.powerOff .matrix .g4Meta.g4Collapsed ~ .matRow.ro { display: none; } -.matrix .matGroup .g3Meta + *,.matrix .matGroup .g3Meta + * + * { +.matrix .matGroup .g4Meta + *,.matrix .matGroup .g4Meta + * + * { margin-top: 0; padding-top: 0; } diff --git a/src/js/background.js b/src/js/background.js index 576c4cf..e6b663a 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -45,7 +45,6 @@ return { manifest: chrome.runtime.getManifest(), userSettings: { - autoWhitelistPageDomain: false, clearBrowserCache: true, clearBrowserCacheAfter: 60, colorBlindFriendly: false, @@ -67,7 +66,6 @@ return { spoofUserAgentEvery: 5, spoofUserAgentWith: getDefaultUserAgentStrings(), statsFilters: {}, - strictBlocking: true, subframeColor: '#cc0000', subframeOpacity: 100 }, diff --git a/src/js/commands.js b/src/js/commands.js index c880d50..0fbcbbf 100644 --- a/src/js/commands.js +++ b/src/js/commands.js @@ -25,22 +25,6 @@ /******************************************************************************/ -var whitelistPageDomain = function(tabs) { - if ( tabs.length === 0 ) { - return; - } - var tab = tabs[0]; - if ( !tab.url ) { - return; - } - var µm = µMatrix; - if ( µm.autoWhitelist1stPartyTemporarily(tab.url) ) { - µm.smartReloadTab(tab.id); - } -}; - -/******************************************************************************/ - var whitelistAll = function(tabs) { if ( tabs.length === 0 ) { return; @@ -62,9 +46,6 @@ var onCommand = function(command) { case 'revert-all': µMatrix.revertAllRules(); break; - case 'whitelist-page-domain': - chrome.tabs.query({ active: true }, whitelistPageDomain); - break; case 'whitelist-all': chrome.tabs.query({ active: true }, whitelistAll); break; diff --git a/src/js/httpsb.js b/src/js/httpsb.js index b572946..89af978 100644 --- a/src/js/httpsb.js +++ b/src/js/httpsb.js @@ -26,6 +26,7 @@ (function() { var µm = µMatrix; µm.pMatrix = new µm.Matrix(); + µm.pMatrix.setSwitch('localhost', false); µm.pMatrix.setSwitch('chrome-extension-scheme', false); µm.pMatrix.setSwitch('chrome-scheme', false); µm.pMatrix.setSwitch(µm.behindTheSceneScope, false); @@ -34,6 +35,8 @@ µm.pMatrix.setCell('*', '*', 'css', µm.Matrix.Green); µm.pMatrix.setCell('*', '*', 'image', µm.Matrix.Green); µm.pMatrix.setCell('*', '*', 'frame', µm.Matrix.Red); + µm.pMatrix.setCell('*', '1st-party', '*', µm.Matrix.Green); + µm.pMatrix.setCell('*', '1st-party', 'frame', µm.Matrix.Green); µm.tMatrix = new µm.Matrix(); µm.tMatrix.assign(µm.pMatrix); @@ -90,15 +93,6 @@ } }; -µMatrix.autoWhitelist1stPartyTemporarily = function(pageURL) { - var srcDomain = this.URI.domainFromURI(pageURL); - if ( this.tMatrix.evaluateCellZXY(srcDomain, srcDomain, '*') !== this.Matrix.RedIndirect ) { - return false; - } - this.tMatrix.whitelistCell(srcDomain, srcDomain, '*'); - return true; -}; - /******************************************************************************/ // Auto-whitelisting the `all` cell is a serious action, hence this will be diff --git a/src/js/matrix.js b/src/js/matrix.js index 3878378..841d132 100644 --- a/src/js/matrix.js +++ b/src/js/matrix.js @@ -122,6 +122,36 @@ Matrix.toBroaderHostname = toBroaderHostname; /******************************************************************************/ +// Find out src-des relationship, using coarse-to-fine grained tests for +// speed. If desHostname is 1st-party to srcHostname, the domain is returned, +// otherwise the empty string. + +var extractFirstPartyDesDomain = function(srcHostname, desHostname) { + if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) { + return ''; + } + var srcLength = srcHostname.length; + var desLength = desHostname.length; + var len = srcLength < desLength ? srcLength : desLength; + if ( srcHostname.slice(-len) !== desHostname.slice(-len) ) { + return ''; + } + var desDomain = µm.URI.domainFromHostname(desHostname); + if ( desDomain === '' ) { + return ''; + } + var pos = srcLength - desDomain.length; + if ( pos < 0 || srcHostname.slice(pos) !== desDomain ) { + return ''; + } + if ( pos !== 0 && srcHostname.charAt(pos - 1) !== '.' ) { + return ''; + } + return desDomain; +}; + +/******************************************************************************/ + Matrix.prototype.reset = function() { this.switchedOn = {}; this.rules = {}; @@ -274,12 +304,9 @@ Matrix.prototype.evaluateCell = function(srcHostname, desHostname, type) { /******************************************************************************/ Matrix.prototype.evaluateCellZ = function(srcHostname, desHostname, type) { - if ( this.evaluateSwitchZ(srcHostname) !== true ) { - return Matrix.Transparent; - } var bitOffset = typeBitOffsets[type]; var s = srcHostname; - var v, pos; + var v; for (;;) { v = this.rules[s + ' ' + desHostname]; if ( v !== undefined ) { @@ -304,37 +331,91 @@ Matrix.prototype.evaluateCellZ = function(srcHostname, desHostname, type) { /******************************************************************************/ Matrix.prototype.evaluateCellZXY = function(srcHostname, desHostname, type) { + // Matrix filtering switch + if ( this.evaluateSwitchZ(srcHostname) !== true ) { + return Matrix.GreenIndirect; + } + + // Specific-hostname specific-type cell var r = this.evaluateCellZ(srcHostname, desHostname, type); if ( r === 1 ) { return Matrix.RedDirect; } if ( r === 2 ) { return Matrix.GreenDirect; } + + // Specific-hostname any-type cell var rl = this.evaluateCellZ(srcHostname, desHostname, '*'); if ( rl === 1 ) { return Matrix.RedIndirect; } - var d = desHostname; + var pos; + var d = desHostname; + var firstPartDesDomain = extractFirstPartyDesDomain(srcHostname, desHostname); + + // Ancestor cells, up to 1st-party destination domain + if ( firstPartDesDomain !== '' ) { + for (;;) { + if ( d === firstPartDesDomain ) { + break; + } + d = d.slice(d.indexOf('.') + 1); + + // specific-hostname specific-type cell + r = this.evaluateCellZ(srcHostname, d, type); + if ( r === 1 ) { return Matrix.RedIndirect; } + if ( r === 2 ) { return Matrix.GreenIndirect; } + // Do not override narrower rule + if ( rl !== 2 ) { + rl = this.evaluateCellZ(srcHostname, d, '*'); + if ( rl === 1 ) { return Matrix.RedIndirect; } + } + } + + // 1st-party specific-type cell: it's a special row, it exists only in + // global scope. + r = this.evaluateCellZ('*', '1st-party', type); + if ( r === 1 ) { return Matrix.RedIndirect; } + if ( r === 2 ) { return Matrix.GreenIndirect; } + // Do not override narrower rule + if ( rl !== 2 ) { + rl = this.evaluateCellZ('*', '1st-party', '*'); + if ( rl === 1 ) { return Matrix.RedIndirect; } + } + } + + // Keep going, up to root for (;;) { pos = d.indexOf('.'); if ( pos === -1 ) { break; } d = d.slice(pos + 1); + + // specific-hostname specific-type cell r = this.evaluateCellZ(srcHostname, d, type); if ( r === 1 ) { return Matrix.RedIndirect; } if ( r === 2 ) { return Matrix.GreenIndirect; } + // Do not override narrower rule if ( rl !== 2 ) { rl = this.evaluateCellZ(srcHostname, d, '*'); if ( rl === 1 ) { return Matrix.RedIndirect; } } } + + // Any-hostname specific-type cells r = this.evaluateCellZ(srcHostname, '*', type); + // Line below is strict-blocking if ( r === 1 ) { return Matrix.RedIndirect; } + // Narrower rule wins if ( rl === 2 ) { return Matrix.GreenIndirect; } if ( r === 2 ) { return Matrix.GreenIndirect; } + + // Any-hostname any-type cell r = this.evaluateCellZ(srcHostname, '*', '*'); if ( r === 1 ) { return Matrix.RedIndirect; } if ( r === 2 ) { return Matrix.GreenIndirect; } return this.rootValue; }; +// https://www.youtube.com/watch?v=4C5ZkwrnVfM + /******************************************************************************/ Matrix.prototype.evaluateRowZXY = function(srcHostname, desHostname) { @@ -368,24 +449,6 @@ Matrix.prototype.desHostnameFromRule = function(rule) { /******************************************************************************/ -Matrix.prototype.extractZRules = function(srcHostname, desHostname, out) { - var s = srcHostname; - var rule, bitmap, pos; - for (;;) { - rule = s + ' ' + desHostname; - bitmap = this.rules[rule]; - if ( bitmap !== undefined ) { - out[rule] = bitmap; - } - s = toBroaderHostname(s); - if ( s === '' ) { - break; - } - } -}; - -/******************************************************************************/ - Matrix.prototype.toggleSwitch = function(srcHostname, newState) { if ( newState === undefined ) { newState = !this.evaluateSwitchZ(srcHostname); @@ -414,7 +477,6 @@ Matrix.prototype.evaluateSwitch = function(srcHostname) { Matrix.prototype.evaluateSwitchZ = function(srcHostname) { var b; var s = srcHostname; - var pos; for (;;) { b = this.switchedOn[s]; if ( b !== undefined ) { @@ -639,7 +701,7 @@ Matrix.prototype.fromSelfie = function(selfie) { Matrix.prototype.diff = function(other, srcHostname, desHostnames) { var out = []; var desHostname, type; - var i, pos, thisVal, otherVal; + var i, thisVal, otherVal; for (;;) { thisVal = this.evaluateSwitch(srcHostname); otherVal = other.evaluateSwitch(srcHostname); diff --git a/src/js/messaging-handlers.js b/src/js/messaging-handlers.js index 0a725a3..9f12d22 100644 --- a/src/js/messaging-handlers.js +++ b/src/js/messaging-handlers.js @@ -118,8 +118,9 @@ var matrixSnapshot = function(details) { r.tSwitch = µm.tMatrix.evaluateSwitchZ(r.scope); r.pSwitch = µm.pMatrix.evaluateSwitchZ(r.scope); - // This one always exist + // These rows always exist r.rows['*'] = new RowSnapshot(r.scope, '*', '*'); + r.rows['1st-party'] = new RowSnapshot('*', '1st-party', '1st-party'); r.rowCount += 1; var µmuri = µm.URI; diff --git a/src/js/popup.js b/src/js/popup.js index ef42e90..4a3959f 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -111,6 +111,7 @@ function updateMatrixSnapshot() { /******************************************************************************/ // For display purpose, create four distinct groups of rows: +// 0th: literal "1st-party" row // 1st: page domain's related // 2nd: whitelisted // 3rd: graylisted @@ -147,36 +148,41 @@ function getGroupStats() { } row = rows[hostname]; domain = row.domain; - // 1st-party always into group 0 - if ( domain === pageDomain ) { + // literal "1st-party" row always into group 0 + if ( hostname === '1st-party' ) { domainToGroupMap[domain] = 0; continue; } + // 1st-party hostnames always into group 1 + if ( domain === pageDomain ) { + domainToGroupMap[domain] = 1; + continue; + } color = row.temporary[anyTypeOffset]; - groupIndex = domainToGroupMap[domain] || 2; // anything overrides 2 - // group 1: whitelisted (does not override 0) + groupIndex = domainToGroupMap[domain] || 3; // anything overrides 3 + // group 2: whitelisted (does not override 0, 1) if ( color === DarkGreen ) { - domainToGroupMap[domain] = 1; + domainToGroupMap[domain] = 2; continue; } - // group 3: blacklisted (does not override 0, 1) + // group 4: blacklisted (does not override 0, 1, 2) if ( color === DarkRed ) { - if ( groupIndex === 2 ) { - domainToGroupMap[domain] = 3; + if ( groupIndex === 3 ) { + domainToGroupMap[domain] = 4; } continue; } - // group 2: graylisted (does not override 0, 1, 3) - if ( groupIndex !== 2 ) { + // group 3: graylisted (does not override 0, 1, 2, 4) + if ( groupIndex !== 3 ) { continue; } - domainToGroupMap[domain] = 2; + domainToGroupMap[domain] = 3; } // Second pass: put each domain in a group - var groups = [ {}, {}, {}, {} ]; + var groups = [ {}, {}, {}, {}, {} ]; var group; for ( hostname in rows ) { if ( rows.hasOwnProperty(hostname) === false ) { @@ -305,7 +311,7 @@ function updateMatrixBehavior() { var section, subdomainRows, j, subdomainRow; while ( i-- ) { section = sections.at(i); - subdomainRows = section.descendants('.l2:not(.g3)'); + subdomainRows = section.descendants('.l2:not(.g4)'); j = subdomainRows.length; while ( j-- ) { subdomainRow = subdomainRows.at(j); @@ -338,11 +344,12 @@ function handleFilter(button, leaning) { // our parent cell knows who we are var cell = button.ancestors('div.matCell'); var type = cell.prop('reqType'); - var hostname = cell.prop('hostname'); + var desHostname = cell.prop('hostname'); + var srcHostname = desHostname !== '1st-party' ? matrixSnapshot.scope : '*'; var request = { - what: getCellAction(hostname, type, leaning), - srcHostname: matrixSnapshot.scope, - desHostname: hostname, + what: getCellAction(desHostname, type, leaning), + srcHostname: srcHostname, + desHostname: desHostname, type: type }; messaging.ask(request, updateMatrixSnapshot); @@ -614,50 +621,20 @@ function hostnameCompare(a,b) { /******************************************************************************/ -function makeMatrixGroup0SectionDomain(domain) { - return makeMatrixRowDomain(domain) - .addClass('g0 l1'); -} - -function makeMatrixGroup0SectionSubomain(domain, subdomain) { - return makeMatrixRowSubdomain(domain, subdomain) - .addClass('g0 l2'); -} - -function makeMatrixGroup0SectionMetaDomain(domain) { - return makeMatrixMetaRowDomain(domain).addClass('g0 l1 meta'); +function makeMatrixGroup0SectionDomain() { + return makeMatrixRowDomain('1st-party').addClass('g0 l1'); } function makeMatrixGroup0Section(hostnames) { - var domain = hostnames[0]; - var domainDiv = createMatrixSection() - .toggleClass('collapsed', getCollapseState(domain)) - .prop('domain', domain); - if ( hostnames.length > 1 ) { - makeMatrixGroup0SectionMetaDomain(domain) - .appendTo(domainDiv); - } - makeMatrixGroup0SectionDomain(domain) - .appendTo(domainDiv); - for ( var i = 1; i < hostnames.length; i++ ) { - makeMatrixGroup0SectionSubomain(domain, hostnames[i]) - .appendTo(domainDiv); - } + var domainDiv = createMatrixSection().prop('domain', '1st-party'); + makeMatrixGroup0SectionDomain().appendTo(domainDiv); return domainDiv; } function makeMatrixGroup0(group) { - var domains = Object.keys(group).sort(hostnameCompare); - if ( domains.length ) { - var groupDiv = createMatrixGroup().addClass('g0'); - makeMatrixGroup0Section(Object.keys(group[domains[0]]).sort(hostnameCompare)) - .appendTo(groupDiv); - for ( var i = 1; i < domains.length; i++ ) { - makeMatrixGroup0Section(Object.keys(group[domains[i]]).sort(hostnameCompare)) - .appendTo(groupDiv); - } - groupDiv.appendTo(matrixList); - } + var groupDiv = createMatrixGroup().addClass('g0'); + makeMatrixGroup0Section().appendTo(groupDiv); + groupDiv.appendTo(matrixList); } /******************************************************************************/ @@ -682,7 +659,8 @@ function makeMatrixGroup1Section(hostnames) { .toggleClass('collapsed', getCollapseState(domain)) .prop('domain', domain); if ( hostnames.length > 1 ) { - makeMatrixGroup1SectionMetaDomain(domain).appendTo(domainDiv); + makeMatrixGroup1SectionMetaDomain(domain) + .appendTo(domainDiv); } makeMatrixGroup1SectionDomain(domain) .appendTo(domainDiv); @@ -695,9 +673,8 @@ function makeMatrixGroup1Section(hostnames) { function makeMatrixGroup1(group) { var domains = Object.keys(group).sort(hostnameCompare); - if ( domains.length) { - var groupDiv = createMatrixGroup() - .addClass('g1'); + if ( domains.length ) { + var groupDiv = createMatrixGroup().addClass('g1'); makeMatrixGroup1Section(Object.keys(group[domains[0]]).sort(hostnameCompare)) .appendTo(groupDiv); for ( var i = 1; i < domains.length; i++ ) { @@ -768,10 +745,18 @@ function makeMatrixGroup3SectionSubomain(domain, subdomain) { .addClass('g3 l2'); } +function makeMatrixGroup3SectionMetaDomain(domain) { + return makeMatrixMetaRowDomain(domain).addClass('g3 l1 meta'); +} + function makeMatrixGroup3Section(hostnames) { var domain = hostnames[0]; var domainDiv = createMatrixSection() + .toggleClass('collapsed', getCollapseState(domain)) .prop('domain', domain); + if ( hostnames.length > 1 ) { + makeMatrixGroup3SectionMetaDomain(domain).appendTo(domainDiv); + } makeMatrixGroup3SectionDomain(domain) .appendTo(domainDiv); for ( var i = 1; i < hostnames.length; i++ ) { @@ -782,21 +767,61 @@ function makeMatrixGroup3Section(hostnames) { } function makeMatrixGroup3(group) { + var domains = Object.keys(group).sort(hostnameCompare); + if ( domains.length) { + var groupDiv = createMatrixGroup() + .addClass('g3'); + makeMatrixGroup3Section(Object.keys(group[domains[0]]).sort(hostnameCompare)) + .appendTo(groupDiv); + for ( var i = 1; i < domains.length; i++ ) { + makeMatrixGroup3Section(Object.keys(group[domains[i]]).sort(hostnameCompare)) + .appendTo(groupDiv); + } + groupDiv.appendTo(matrixList); + } +} + +/******************************************************************************/ + +function makeMatrixGroup4SectionDomain(domain) { + return makeMatrixRowDomain(domain) + .addClass('g4 l1'); +} + +function makeMatrixGroup4SectionSubomain(domain, subdomain) { + return makeMatrixRowSubdomain(domain, subdomain) + .addClass('g4 l2'); +} + +function makeMatrixGroup4Section(hostnames) { + var domain = hostnames[0]; + var domainDiv = createMatrixSection() + .prop('domain', domain); + makeMatrixGroup4SectionDomain(domain) + .appendTo(domainDiv); + for ( var i = 1; i < hostnames.length; i++ ) { + makeMatrixGroup4SectionSubomain(domain, hostnames[i]) + .appendTo(domainDiv); + } + return domainDiv; +} + +function makeMatrixGroup4(group) { var domains = Object.keys(group).sort(hostnameCompare); if ( domains.length === 0 ) { return; } - var groupDiv = createMatrixGroup().addClass('g3'); + var groupDiv = createMatrixGroup().addClass('g4'); createMatrixSection() - .addClass('g3Meta') - .toggleClass('g3Collapsed', !!getUserSetting('popupHideBlacklisted')) + .addClass('g4Meta') + .toggleClass('g4Collapsed', !!getUserSetting('popupHideBlacklisted')) .appendTo(groupDiv); - makeMatrixMetaRow(computeMatrixGroupMetaStats(group), 'g3') + makeMatrixMetaRow(computeMatrixGroupMetaStats(group), 'g4') .appendTo(groupDiv); - makeMatrixGroup3Section(Object.keys(group[domains[0]]).sort(hostnameCompare)) + makeMatrixGroup4Section(Object.keys(group[domains[0]]).sort(hostnameCompare)) .appendTo(groupDiv); for ( var i = 1; i < domains.length; i++ ) { - makeMatrixGroup3Section(Object.keys(group[domains[i]]).sort(hostnameCompare)) + makeMatrixGroup4Section(Object.keys(group[domains[i]]).sort(hostnameCompare)) .appendTo(groupDiv); } groupDiv.appendTo(matrixList); @@ -823,6 +848,7 @@ var makeMenu = function() { makeMatrixGroup1(groupStats[1]); makeMatrixGroup2(groupStats[2]); makeMatrixGroup3(groupStats[3]); + makeMatrixGroup4(groupStats[4]); endMatrixUpdate(); initScopeCell(); @@ -1120,10 +1146,10 @@ uDom.onLoad(function() { uDom('body').on('click', '.dropdown-menu-button', dropDownMenuShow); uDom('body').on('click', '.dropdown-menu-capture', dropDownMenuHide); - uDom('#matList').on('click', '.g3Meta', function() { + uDom('#matList').on('click', '.g4Meta', function() { var collapsed = uDom(this) - .toggleClass('g3Collapsed') - .hasClassName('g3Collapsed'); + .toggleClass('g4Collapsed') + .hasClassName('g4Collapsed'); setUserSetting('popupHideBlacklisted', collapsed); }); }); diff --git a/src/js/profiler.js b/src/js/profiler.js index 6fd3e29..8e66771 100644 --- a/src/js/profiler.js +++ b/src/js/profiler.js @@ -22,61 +22,41 @@ /******************************************************************************/ var quickProfiler = (function() { - -/******************************************************************************/ - -var timer = performance; -var time = 0; -var count = -3; -var tstart = 0; -var lastlog = timer.now(); -var prompt = ''; - -/******************************************************************************/ - -var reset = function() { - time = 0; - count = -3; - tstart = 0; -}; - -/******************************************************************************/ - -var avg = function() { - return count > 0 ? time / count : 0; -}; - -/******************************************************************************/ - -var start = function(s) { - prompt = s || ''; - tstart = timer.now(); -}; - -/******************************************************************************/ - -var stop = function() { - count += 1; - if ( count > 0 ) { + var timer = performance; + var time = 0; + var count = 0; + var tstart = 0; + var lastlog = timer.now(); + var prompt = ''; + var reset = function() { + time = 0; + count = 0; + tstart = 0; + }; + var avg = function() { + return count > 0 ? time / count : 0; + }; + var start = function(s) { + prompt = s || ''; + tstart = timer.now(); + }; + var stop = function(period) { + if ( period === undefined ) { + period = 10000; + } var now = timer.now(); + count += 1; time += (now - tstart); - if ( (now - lastlog) > 10000 ) { - console.log('HTTP Switchboard() > %s: %s ms', prompt, avg().toFixed(3)); + if ( (now - lastlog) >= period ) { + console.log('µMatrix> %s: %s ms (%d samples)', prompt, avg().toFixed(3), count); lastlog = now; } - } -}; - -/******************************************************************************/ - -return { - reset: reset, - start: start, - stop: stop -}; - -/******************************************************************************/ - + }; + return { + reset: reset, + start: start, + stop: stop + }; })(); /******************************************************************************/ diff --git a/src/js/traffic.js b/src/js/traffic.js index 69dfd57..c886431 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -227,7 +227,6 @@ var onBeforeRootFrameRequestHandler = function(details) { if ( tabId !== µm.behindTheSceneTabId ) { µm.cookieHunter.recordPageCookies(pageStats); } - // quickProfiler.stop(); return; } @@ -250,8 +249,6 @@ var onBeforeRootFrameRequestHandler = function(details) { html = html.replace('{{now}}', String(Date.now())); var dataURI = 'data:text/html;base64,' + btoa(html); - // quickProfiler.stop(); - return { 'redirectUrl': dataURI }; }; @@ -342,8 +339,6 @@ var onBeforeRequestHandler = function(details) { return; } - // quickProfiler.start('onBeforeRequest'); - // console.debug('onBeforeRequestHandler()> "%s": %o', details.url, details); var requestType = requestTypeNormalizer[details.type]; @@ -699,14 +694,9 @@ var onMainDocHeadersReceived = function(details) { // console.debug('onMainDocHeadersReceived()> redirect "%s" to "%s"', requestURL, headers[i].value); } - // rhill 2014-01-11: Auto-scope and/or auto-whitelist only when the - // `main_frame` object is really received (status = 200 OK), i.e. avoid - // redirection, because the final URL might differ. This ensures proper - // scope is looked-up before auto-site-scoping and/or auto-whitelisting. - // https://github.com/gorhill/httpswitchboard/issues/119 + // rhill 2014-01-15: Report redirects if any. + // https://github.com/gorhill/httpswitchboard/issues/112 if ( details.statusLine.indexOf(' 200') > 0 ) { - // rhill 2014-01-15: Report redirects if any. - // https://github.com/gorhill/httpswitchboard/issues/112 var mainFrameStack = [requestURL]; var destinationURL = requestURL; var sourceURL; @@ -719,11 +709,6 @@ var onMainDocHeadersReceived = function(details) { while ( destinationURL = mainFrameStack.pop() ) { pageStats.recordRequest('doc', destinationURL, false); } - - // rhill 2013-12-23: Auto-whitelist page domain? - if ( µm.userSettings.autoWhitelistPageDomain ) { - µm.autoWhitelist1stPartyTemporarily(requestURL); - } } // Evaluate @@ -871,6 +856,12 @@ var requestTypeNormalizer = { /******************************************************************************/ chrome.webRequest.onBeforeRequest.addListener( + //function(details) { + // quickProfiler.start('onBeforeRequest'); + // var r = onBeforeRequestHandler(details); + // quickProfiler.stop(); + // return r; + //}, onBeforeRequestHandler, { "urls": [ diff --git a/src/settings.html b/src/settings.html index 3c88921..46bcd95 100644 --- a/src/settings.html +++ b/src/settings.html @@ -52,23 +52,6 @@ ul > li { -
-Striktes\nBlockieren,\neingeführt in version 0.3.6,\nbedeutet: Selbst\nwenn du einen spezifischen Hostnamen auf die Whitelist setzt, bleiben die Arten von Anfragen, die standardmäßig blockiert sind (Plugins,\nFrames, etc.), weiterhin auf der Blacklist. Für einige Benutzer ist das möglicherweise\nzu lästig, daher dieser Schalter.
\nStriktes Blockieren an: blockierte Arten von Anfragen (falls vorhanden)\nfür einen Hostnamen auf der Whitelist bleiben weiterhin auf der Blacklist (sofern du diese Arten von Anfragen für diesen Hostnamen nicht ausdrücklich erlaubst.)
\nStriktes Blockieren aus: blockierte Arten von Anfragen (falls vorhanden)\nfür einen Hostnamen auf der Whitelist sind erlaubt (sofern du diese Arten von Anfragen für diesen Hostnamen nicht ausdrücklich verbietest.)
", - "description": "To help user understand the purpose of strict blocking" - }, - "settingsAutoCreateScopePrompt1": { - "message": "Automatisches Erzeugen eines temporären Geltungsbereichs auf ", - "description": "English: Auto create temporary" - }, - "settingsAutoCreateDomainScope": { - "message": "Domain-Ebene", - "description": "English: domain-level" - }, - "settingsAutoCreateSiteScope": { - "message": "Webseiten-Ebene", - "description": "English: site-level" - }, - "settingsAutoCreateScopePrompt2": { - "message": " ", - "description": "English: scope" - }, - "settingsAutoCreateScopeInfo": { - "message": "Diese Option ermöglicht das automatische Erzeugen eines temporären Geltungsbereichs für eine besuchte Webseite, falls für diese noch kein Geltungsbereich definiert ist.
Das Benutzen von Domain- oder Webseiten-spezifischen Regeln hat viele Vorteile, vor allem der, dass diese Regeln in einer Art Sandbox eingesperrt werden - eine gute Angewohnheit für mehr Sicherheit.
Beispiel: Wenn du “alles” auf einer Webseite (www.example.com) erlaubst (also auf die Whitelist setzt), hat die Benutzung eines Geltungsbereichs auf Domain-Ebene zur Folge, dass diese extrem freizügige Regel tatsächlich nur für Webseiten dieser spezifischen Domain (example.com) gültig ist; hättest du stattdessen einen Globalen Geltungsbereich (“∗”) benutzt, würde diese extrem freizügige Regel für alle Webseiten gelten, d.h. du würdest damit das ganze Internet auf die Whitelist setzen.
", - "description": "English: see relevant messages.json file" - }, "settingsMatrixLessSecurityHeader" : { "message": "Weniger Sicherheit", "description": "..." }, - "settingsAutoWhitelistPrompt": { - "message": "Auto-Whitelist: automatisches Hinzufügen von Domänen zur Whitelist.", - "description": "" - }, - "settingsAutoWhitelistHelp": { - "message": "Einige Benutzer möchten nicht andauernd Webseiten auf die Whitelist setzen müssen. Daher ermöglicht diese Einstellung, dass Domänen temporär automatisch zur Whitelist hinzugefügt werden. Dieses temporäre Auto-Whitelisting findet nur statt, wenn die Domäne auf der “Greylist” (=hellrote Zellen) ist, d.h. nicht explizit auf die Blacklist gesetzt wurde oder sich auf einer der externen Listen blockierter Hostnamen befindet.
Obwohl diese Einstellung unter Sicherheitsaspekten nicht empfehlenswert ist, wurde sie aufgrund entsprechender Benutzerwünsche hinzu gefügt -- lieber gebe ich Benutzern diese Option, als dass sie ganz auf die Benutzung dieser Erweiterung verzichten.
Sofern du diese Option benutzen willst, rate ich dazu, zumindest frame auf die Blacklist zu setzen und Striktes Blockieren zu aktivieren.
", - "description": "To help user understand the purpose of auto-whitelist" - }, "settingsMatrixConvenienceHeader" : { "message": "Komforteinstellungen", "description": "English: Convenience" @@ -327,22 +291,6 @@ "message": "Immer wenn du Änderungen in der Matrix durchführst, die die Anzeige und /oder das Verhalten einer oder mehrerer Seiten beeinflusst, wird µMatrix die betroffenen Seiten automatisch neu laden, sobald du die Matrix schließt.", "description": "..." }, - "settingsMatrixCopyGlobalRulesIntoNewScopePrompt" : { - "message": "Kopiere alle Regeln aus dem Globalen Geltungsbereich in neu erstellte lokale Geltungsbereiche (d. h. auf Domain- oder Webseiten-Ebene).", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixCopyGlobalRulesIntoNewScopeHelp" : { - "message": "Geltungsbereiche existieren in einer Art Sandbox, d. h. sie teilen keine Regeln untereinander, und das gilt auch für den Globalen Geltungsbereich: enger gefasste Geltungsbereiche sehen nicht die Regeln im Globalen Geltungsbereich.
Von einigen Benutzern wird dies aber als Hindernis angesehen, da sie möchten, dass ihre globalen Regeln auch von enger gefassten Geltungsbereichen erkannt werden. Diese Option behebt dieses “Manko” indem sie erzwingt, dass alle globalen Regeln in neu erstellte enger gefasste Geltungsbereiche hineinkopiert werden.
Bedenke aber, dass alle Regeln aus dem Globalen Geltungsbereich kopiert werden, einschließlich der Regeln, die möglicherweise irrelevant sind für die Webseite, für die der enger gefasste Geltungsbereich erstellt wurde. Dies kann daher zu “aufgeblähten Regelwerken” führen, falls im Globalen Geltungsbereich viele Regeln angelegt wurden.
", - "description": "English: ..." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt1" : { - "message": "Automatisches Löschen unbenutzter temporärer Geltungsbereiche.", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt2" : { - "message": "", - "description": "English:" - }, "settingsSubframeColor" : { "message": "Farbe blockierter Frames:", "description": "English: Blocked frames: Color" diff --git a/tools/_locales/en/messages.json b/tools/_locales/en/messages.json index a9d6ec6..7459ff1 100644 --- a/tools/_locales/en/messages.json +++ b/tools/_locales/en/messages.json @@ -263,46 +263,10 @@ "message": "More security", "description": "..." }, - "settingsStrictBlockingPrompt": { - "message": "Enable strict blocking.", - "description": "" - }, - "settingsStrictBlockingInfo": { - "message": "Strict\nblocking,\nintroduced in version 0.3.6,\nmeans that even\nif you whitelist a specific hostname, blacklisted type of requests (plugins,\nframes, etc.) will remain blacklisted. For some users this maybe\ntoo bothersome, hence this switch.
\nStrict blocking on: blacklisted types of request (if any)\nfor a whitelisted hostname are blocked (unless you explicitly whitelist\nspecifically these types of request for the whitelisted hostname.)
\nStrict blocking off: blacklisted types of request (if any)\nfor a whitelisted hostname are allowed (unless you explicitly blacklist\nspecifically these types of request for the whitelisted hostname.)
", - "description": "To help the user understand the purpose of strict blocking" - }, - "settingsAutoCreateScopePrompt1": { - "message": "Auto create temporary", - "description": "English: Auto create temporary" - }, - "settingsAutoCreateDomainScope": { - "message": "domain-level", - "description": "English: domain-level" - }, - "settingsAutoCreateSiteScope": { - "message": "site-level", - "description": "English: site-level" - }, - "settingsAutoCreateScopePrompt2": { - "message": "scope.", - "description": "English: scope" - }, - "settingsAutoCreateScopeInfo": { - "message": "This option enables the automatic creation of a temporary scope if no scope exists for a web site you visit.
There are many advantages to using domain- or site-scoped rules, one of them being the sandboxing of rules, a good habit for enhanced security.
For example, should you want to whitelist “all” for a web site (www.example.com), using a domain-level scope will limit this extremely permissive rule to only pages on that specific domain (example.com), while if used in the global scope (“∗”) the extremely permissive rule would apply to all pages on all web sites, i.e. the whitelisting of the whole internet.
", - "description": "English: see relevant messages.json file" - }, "settingsMatrixLessSecurityHeader" : { "message": "Less security", "description": "..." }, - "settingsAutoWhitelistPrompt": { - "message": "Auto whitelist page domain.", - "description": "" - }, - "settingsAutoWhitelistHelp": { - "message": "Some users do not like to constantly whitelist the domain of the page by default. This feature enables automatic temporary whitelisting of a page's whole domain whenever it is first loaded in the browser. The temporary auto-whitelisting will occur only if the page domain is currently graylisted.
Although it is not a recommended feature from a security perspective, it has been included due to popular demand -- I would rather give users this feature than see them give up completely on a blocker.
If you use this feature, I advise that you at least blacklist frame requests and turn on strict blocking.
", - "description": "To help user understand the purpose of auto-whitelist" - }, "settingsMatrixConvenienceHeader" : { "message": "Convenience", "description": "English: Convenience" @@ -327,22 +291,6 @@ "message": "Whenever you make changes in the matrix which can affect the display and/or behavior of one or more pages, µMatrix will reload affected pages automatically when you close the matrix.", "description": "..." }, - "settingsMatrixCopyGlobalRulesIntoNewScopePrompt" : { - "message": "Copy all rules from global scope into newly created local scopes.", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixCopyGlobalRulesIntoNewScopeHelp" : { - "message": "Scopes are sandboxed, i.e. they do not share rules, and this also applies to the global scope: narrower scopes do not see rules in the global scope.
Some users see this as an impediment, as they wish their global rules were seen by narrower scopes. This option allows to mitigate this “shortcoming” by forcing a copy of all global rules into a newly created narrower scope.
Be mindful that all rules from the global scope are copied, including rules which could be irrelevant to the web site for which the scope was created. This could lead to “rules bloat” when there are many rules in the global scope.
", - "description": "English: ..." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt1" : { - "message": "Auto delete unused temporary scopes.", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt2" : { - "message": "", - "description": "English:" - }, "settingsSubframeColor" : { "message": "Blocked frames: Color", "description": "English: Blocked frames: Color" diff --git a/tools/_locales/fr/messages.json b/tools/_locales/fr/messages.json index d67341b..3b464d7 100644 --- a/tools/_locales/fr/messages.json +++ b/tools/_locales/fr/messages.json @@ -263,46 +263,10 @@ "message": "Sécurité renforcée", "description": "..." }, - "settingsStrictBlockingPrompt": { - "message": "Activer le blocage strict", - "description": "" - }, - "settingsStrictBlockingInfo": { - "message": "Introduit dans la version 0.3.6, le Blocage strict signifie que même si vous allouez un nom d'hôte spécifique, une requête restera bloquée si le type d'objet en question (plugins, iframes, etc) est lui-même bloqué; en d'autres termes, le blocage d'éléments de colonnes prime sur l'autorisation d'éléments de lignes. Le choix vous est proposé de l'activer ou non, car cela peut se montrer trop restrictif aux yeux de certains utilisateurs. Si l'option est activée, la requête est autorisée à condition que les nom d'hôte ET le type de requête soient autorisés. Si l'option n'est pas cochée, le nom d'hôte alloué suffit à autoriser la requête.", - "description": "To help user understand the purpose of strict blocking" - }, - "settingsAutoCreateScopePrompt1": { - "message": "Créer automatiquement des contextes de règles à portée", - "description": "English: Auto create temporary" - }, - "settingsAutoCreateDomainScope": { - "message": "domaine", - "description": "English: domain-level" - }, - "settingsAutoCreateSiteScope": { - "message": "site", - "description": "English: site-level" - }, - "settingsAutoCreateScopePrompt2": { - "message": "temporaires", - "description": "English: scope" - }, - "settingsAutoCreateScopeInfo": { - "message": "Cette option active la création automatique de contextes de règles à portée non globale si aucune règle n'existe pour le site web que vous visitez. Ainsi, les règles que vous définissez pour ce site ne s'appliqueront pas universellement, mais uniquement au domaine/site précis (selon votre choix).
Si cela peut se révéler légèrement contraignant dans certains cas, c'est également un bon moyen de renforcer votre sécurité.
Par exemple, si vous désirez mettre en liste blanche TOUS les éléments d'un site web (www.exemple.com), employer une règle à portée domaine/site limiterait cette règle trop permissive uniquement aux pages web en provenance du domaine/site exemple.com, tandis que si c'était employé à portée globale (“∗”), elle s'appliquerait partout, ce qui pourrait réduire votre sécurité.
", - "description": "..." - }, "settingsMatrixLessSecurityHeader" : { "message": "Sécurité réduite", "description": "..." }, - "settingsAutoWhitelistPrompt": { - "message": "Mise en liste blanche automatique du domaine de la page visitée", - "description": "" - }, - "settingsAutoWhitelistHelp": { - "message": "Certains utilisateurs n'aiment pas devoir constamment mettre en liste blanche le domaine de la page visitée. Cette option permet de mettre automatiquement en liste blanche tout le domaine d'une page lors de son premier chargement dans le navigateur. Cette procédure automatique ne se produira que si le domaine de la page visitée est actuellement sur liste grise (c'est-à-dire ni sur liste blanche, ni sur liste noire).
Bien que d'un point de vue sécurité, il n'est pas recommandé d'utiliser cette fonctionnalité, elle a été incluse suite à une forte demande (il m'a paru plus pertinent de leur donner cette possibilité que d'abandonner l'utilisation de mon extension).
Si vous activez cette option, je vous recommande d'au moins mettre sur la liste noire du contexte global les requêtes de type frame et d'activer le blocage strict.
", - "description": "To help user understand the purpose of auto-whitelist" - }, "settingsMatrixConvenienceHeader" : { "message": "Ergonomie", "description": "English: Convenience" @@ -327,22 +291,6 @@ "message": "Lorsque vous avez modifié des permissions susceptibles d'affecter l'apparence et/ou le comportement d'une page Web, l'extension rechargera automatiquement une ou plusieurs pages Web concernées (selon votre choix) en fermant la matrice. Si l'option Aucune page est sélectionnée, vous devrez actualiser la page Web vous-même pour appliquer les modifications", "description": "..." }, - "settingsMatrixCopyGlobalRulesIntoNewScopePrompt" : { - "message": "Copier toutes les règles du contexte global vers les nouveaux contextes à portée non globale", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixCopyGlobalRulesIntoNewScopeHelp" : { - "message": "Chaque contexte est sandboxé, c'est-à-dire qu'elle ne partage pas ses règles avec les autres contextes, et cela vaut également pour le contexte global. Ainsi, un contexte restreint n'applique pas les règles du contexte global.
Certaines personnes voient cela comme un obstacle, souhaitant que leurs règles du contexte global soient prises en compte dans des contextes restreints. Cette option permet d'atténuer ce “défaut” en forçant la copie de toutes les règles du contexte global dans un nouveau contexte restreint.
Prenez conscience que toutes les règles du contexte global sont copiés, y compris des règles n'ayant pas de rapport avec le site Web pour lequel un nouveau contexte restreint a été créé. Cela pourrait conduire à un “ballonnement de règles” lorsqu'il a beaucoup de règles dans le contexte global.
", - "description": "English: ..." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt1" : { - "message": "Effacer automatiquement les règles de contextes non globaux inutilisées", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt2" : { - "message": "", - "description": "English:" - }, "settingsSubframeColor" : { "message": "Couleur pour les <iframe> bloquées :", "description": "English: Blocked frames: Color" diff --git a/tools/_locales/ru/messages.json b/tools/_locales/ru/messages.json index 10bb295..68c672d 100644 --- a/tools/_locales/ru/messages.json +++ b/tools/_locales/ru/messages.json @@ -263,46 +263,10 @@ "message": "Больше защиты", "description": "..." }, - "settingsStrictBlockingPrompt": { - "message": "Включить строгую блокировку.", - "description": "" - }, - "settingsStrictBlockingInfo": { - "message": "Строгое\nблокирование,\nознокомиться на версии 0.3.6,\nозначает, что\nесли вы внесли сайт в белый список, заблокированые запросы: (плагинов,\nфреймов, и т.д.) будут в черном списке. Для некоторых пользователей это может быть\nнадоедливым, следовательно, нужен этот переключатель.
\nСтрогие блокировки ВКЛ.: в черный список типов запросов (если любой)\nдля сайтов из белого списка будет блокированы (если явно не белый список\nспециально эти запросы для сайтов из белого списка.)
\nСтрогие блокировки ВЫКЛ.: попавшие в черный список запросы (если любой)\nдля сайтов из белого списка разрешены (если вы явно не внесли эти запросы в ченый список для сайтов из белого списка.)
", - "description": "To help user understand the purpose of strict blocking" - }, - "settingsAutoCreateScopePrompt1": { - "message": "Автоматически создавать временные", - "description": "English: Auto create temporary" - }, - "settingsAutoCreateDomainScope": { - "message": "на уровне домена", - "description": "English: domain-level" - }, - "settingsAutoCreateSiteScope": { - "message": "на уровне сайта", - "description": "English: site-level" - }, - "settingsAutoCreateScopePrompt2": { - "message": "области.", - "description": "English: scope" - }, - "settingsAutoCreateScopeInfo": { - "message": "Эта опция позволяет автоматически создавать временные правила для новых сайтов.
There are many advantages to using domain- or site-scoped rules, one of them being the sandboxing of rules, a good habit for enhanced security.
For example, should you want to whitelist “all” for a web site (www.example.com), using a domain-level scope will limit this extremely permissive rule to only pages on that specific domain (example.com), while if used in the global scope (“∗”) the extremely permissive rule would apply to all pages on all web sites, i.e. the whitelisting of the whole internet.
", - "description": "English: see relevant messages.json file" - }, "settingsMatrixLessSecurityHeader" : { "message": "Меньше защиты", "description": "..." }, - "settingsAutoWhitelistPrompt": { - "message": "Автосоздание белых списков для домена.", - "description": "" - }, - "settingsAutoWhitelistHelp": { - "message": "Некоторые пользователи не любят добавлять домен текущей страницы в белый список по-умолчанию. Эта функция позволяет автоматически создавать временные белые списки из всей области страницы, когда она впервые загружается в браузере. The temporary auto-whitelisting will occur only если страница домена в серых списках.
Хотя включать эту опцию не рекомендуется, она была включена из-за удобства — я лучше включу её, нежели потеряю пользователей.
Если опция включена, рекомендуется включить блокировку frame запросов и строгую блокировку.
", - "description": "To help user understand the purpose of auto-whitelist" - }, "settingsMatrixConvenienceHeader" : { "message": "Удобство", "description": "English: Convenience" @@ -327,22 +291,6 @@ "message": "Каждый раз, когда вы вносите изменения в матрицу, которые могут повлиять на отображение и/или поведение одной или нескольких страниц, µMatrix перезагрузит все затронутые страницы автоматически, после закрытия матрицы.", "description": "..." }, - "settingsMatrixCopyGlobalRulesIntoNewScopePrompt" : { - "message": "Копировать все правила из глобальной области во вновь создаваемые локальные области.", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixCopyGlobalRulesIntoNewScopeHelp" : { - "message": "Области являются изолированными, т.е. они не придерживаются правил, и это также относится и к глобальной области видимости: более узкие области “не видят” правил в глобальной области.
Некоторые пользователи видят в этом препятствие, как они хотят, чтобы их глобальные правила были замечены более узкие области. Эта опция позволяет смягчить этот “недостаток”, позволяя копировать правила глобальных областей, в новую созданную узкую область.
Помните, что все правила, копируемые из глобальной области видимости могут иметь предназначение для веб-сайта, для которых область была создана. Это может привести к “Правилам наворотов”, когда есть много правил в глобальной области видимости.
", - "description": "English: ..." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt1" : { - "message": "Автоматически удалять временные области.", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt2" : { - "message": "", - "description": "English:" - }, "settingsSubframeColor" : { "message": "Цвет заблокированного фрейма:", "description": "English: Blocked frames: Color" diff --git a/tools/_locales/zh_CN/messages.json b/tools/_locales/zh_CN/messages.json index e742b09..65bb7af 100644 --- a/tools/_locales/zh_CN/messages.json +++ b/tools/_locales/zh_CN/messages.json @@ -263,46 +263,10 @@ "message": "增强安全性设置", "description": "..." }, - "settingsStrictBlockingPrompt": { - "message": "启用严格屏蔽", - "description": "" - }, - "settingsStrictBlockingInfo": { - "message": "严格屏蔽,导入于0.3.6版,意味着即使您把一个站点名加入了白名单,被加入黑名单的请求类型(插件、子文档等等)仍会保持被黑名单的状态。对部分用户来说这可能有点太麻烦,于是有了这个开关选项。
开启严格屏蔽:对一个白名单中的站点名,被添加到黑名单的请求类型(如果有的话)将被屏蔽(除非您,为白名单中的站点名,明确地把这些特殊的请求类型加入到白名单中。)
关闭严格屏蔽:对一个白名单中的站点名,被添加到黑名单的请求类型(如果有的话)将被允许(除非您,为白名单中的站点名,明确地把这些特殊的请求类型加入到黑名单中。)
", - "description": "To help the user understand the purpose of strict blocking" - }, - "settingsAutoCreateScopePrompt1": { - "message": "自动添加临时", - "description": "English: Auto create temporary" - }, - "settingsAutoCreateDomainScope": { - "message": "域名级", - "description": "English: domain-level" - }, - "settingsAutoCreateSiteScope": { - "message": "站点级", - "description": "English: site-level" - }, - "settingsAutoCreateScopePrompt2": { - "message": "作用域。", - "description": "English: scope" - }, - "settingsAutoCreateScopeInfo": { - "message": "这个选项开启临时作用域的自动创建,如果不存在适用于您访问的网站的作用域。
使用域名或站点级作用域的规则有许多的好处,其中之一是规则的沙盒化,这是一个增强安全性的好习惯。
例如,如果您想添加一个站点的“全部”请求到白名单(如www.example.com),使用一个域名级的作用域会把这条极其宽容的规则限制到那个特殊域名(example.com)的网页上。而如果运用到全局作用域(“*”)上,这条极其宽容的规则将被运用到所有网站的所有页面上,也就是说把整个互联网添加到白名单中。
", - "description": "English: see relevant messages.json file" - }, "settingsMatrixLessSecurityHeader" : { "message": "减弱安全性设置", "description": "..." }, - "settingsAutoWhitelistPrompt": { - "message": "自动添加页面域名至白名单。", - "description": "" - }, - "settingsAutoWhitelistHelp": { - "message": "有些用户不喜欢要一直把页面的域名添加到默认的白名单。这项功能开启页面上所有域名的临时白名单自动添加,只要这个页面是第一次加载到浏览器。临时白名单自动添加只会发生在页面的域名当前处在灰名单里的情况下。
虽然从安全性的角度来说,这不是一项被推荐的功能,但它还是因为广泛的需求而被加入————比起看到他们完全放弃一个屏蔽工具,我更倾向于给予用户这项功能。
如果您使用这项功能,我建议您至少把子文档类型的请求添加到黑名单中,并且开启严格屏蔽。
", - "description": "To help user understand the purpose of auto-whitelist" - }, "settingsMatrixConvenienceHeader" : { "message": "便利设置", "description": "English: Convenience" @@ -327,22 +291,6 @@ "message": "当您对过滤矩阵作出任何会影响一个或多个页面的显示或行为的变更时,µMatrix 会在您关闭过滤矩阵的显示后,自动重载受影响的页面。", "description": "..." }, - "settingsMatrixCopyGlobalRulesIntoNewScopePrompt" : { - "message": "拷贝所有全局作用域中的规则到新创建的局部作用域中。", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixCopyGlobalRulesIntoNewScopeHelp" : { - "message": "作用域是沙盒化相互隔离的,即它们不共享规则,这对全局作用域来说也是适用的:局部作用域无法看到全局作用域中的规则。
有些用户把这视为一种阻碍,因为他们希望他们的全局作用规则能被局部作用域所看到。这个选项使这个“短处”能得以缓和,通过强制把所以全局作用规则拷贝到一个新创建的局部作用域中来实现。
请特别注意:所有来自全局作用域的规则都会被拷贝,包括那些可能和新创建作用域对应网站无关的规则。当全局作用域中有非常多的规则时,这可能会导致“规则膨胀”。
", - "description": "English: ..." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt1" : { - "message": "自动删除未使用的临时作用域。", - "description": "English: Auto delete unused temporary scopes." - }, - "settingsMatrixDeleteUnusedTemporaryScopesPrompt2" : { - "message": "", - "description": "English:" - }, "settingsSubframeColor" : { "message": "被屏蔽子文档:颜色", "description": "English: Blocked frames: Color"