Skip to content

Commit

Permalink
#283 Stealth mode - review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Nov 27, 2018
1 parent 67eec1b commit 36ae3d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Extension/lib/filter/filtering-log.js
Expand Up @@ -367,6 +367,7 @@ adguard.filteringLog = (function (adguard) {
}

const filteringEvent = {
stealthEvent: true,
headerName: headerName,
headerValue: headerValue,
requestType: requestType,
Expand Down
16 changes: 8 additions & 8 deletions Extension/lib/pages/log.js
Expand Up @@ -518,7 +518,7 @@ PageController.prototype = {
metadata.class += ' yellow';
}

if (event.headerName) {
if (event.stealthEvent) {
metadata.class += ' yellow';
}

Expand All @@ -541,7 +541,7 @@ PageController.prototype = {
requestInfo = this._escapeHTML(event.element);
} else if (event.cookieName) {
requestInfo = `${event.cookieName} = ${event.cookieValue}`;
} else if (event.headerName) {
} else if (event.stealthEvent && event.headerName) {
requestInfo = `${event.headerName} = ${event.headerValue}`;
} else {
requestInfo = event.requestUrl;
Expand Down Expand Up @@ -673,7 +673,7 @@ var RequestWizard = (function () {
patterns = [createExceptionCookieRule(filteringEvent.requestRule, filteringEvent)];
}

if (filteringEvent.headerName) {
if (filteringEvent.stealthEvent) {
patterns = [createExceptionStealthRule(filteringEvent)];
}

Expand Down Expand Up @@ -800,7 +800,7 @@ var RequestWizard = (function () {
}
}

if (filteringEvent.cookieName || filteringEvent.headerName) {
if (filteringEvent.cookieName || filteringEvent.stealthEvent) {
ruleImportantCheckbox.parentNode.style.display = 'none';
ruleMatchCaseCheckbox.parentNode.style.display = 'none';
ruleDomainCheckbox.parentNode.style.display = 'none';
Expand Down Expand Up @@ -831,7 +831,7 @@ var RequestWizard = (function () {
mandatoryOptions = [UrlFilterRule.COOKIE_OPTION];
}

if (filteringEvent.headerName) {
if (filteringEvent.stealthEvent) {
mandatoryOptions = [UrlFilterRule.STEALTH_OPTION];
}

Expand Down Expand Up @@ -1048,7 +1048,7 @@ var RequestWizard = (function () {
}

const headerNode = template.querySelector('[attr-text="header"]');
if (filteringEvent.headerName) {
if (filteringEvent.stealthEvent && filteringEvent.headerName) {
headerNode.textContent = `${filteringEvent.headerName} = ${filteringEvent.headerValue}`;
} else {
headerNode.parentNode.style.display = 'none';
Expand Down Expand Up @@ -1126,7 +1126,7 @@ var RequestWizard = (function () {
openRequestButton.style.display = 'none';
}

if (filteringEvent.headerName) {
if (filteringEvent.stealthEvent) {
openRequestButton.style.display = 'none';
}

Expand Down Expand Up @@ -1165,7 +1165,7 @@ var RequestWizard = (function () {
});

if (!requestRule) {
if (filteringEvent.headerName) {
if (filteringEvent.stealthEvent) {
unblockRequestButton.classList.remove('hidden');
} else {
blockRequestButton.classList.remove('hidden');
Expand Down

0 comments on commit 36ae3d5

Please sign in to comment.