зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 5 changesets (bug 1582751, bug 1575785, bug 1592616) for failing at browser_protections_UI.js on a CLOSED TREE.
Backed out changeset ee2ba98f5a17 (bug 1592616) Backed out changeset 1f665fb32bff (bug 1592616) Backed out changeset dde543f12c83 (bug 1575785) Backed out changeset fadcc9e29ffd (bug 1582751) Backed out changeset e86703d8db17 (bug 1592616)
This commit is contained in:
Родитель
313e11b7ae
Коммит
a48236e296
|
@ -1236,12 +1236,6 @@ var gProtectionsHandler = {
|
||||||
"protections-popup-siteNotWorking-tp-switch"
|
"protections-popup-siteNotWorking-tp-switch"
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
get _protectionsPopupSiteNotWorkingReportError() {
|
|
||||||
delete this._protectionsPopupSiteNotWorkingReportError;
|
|
||||||
return (this._protectionsPopupSiteNotWorkingReportError = document.getElementById(
|
|
||||||
"protections-popup-sendReportView-report-error"
|
|
||||||
));
|
|
||||||
},
|
|
||||||
get _protectionsPopupSendReportLearnMore() {
|
get _protectionsPopupSendReportLearnMore() {
|
||||||
delete this._protectionsPopupSendReportLearnMore;
|
delete this._protectionsPopupSendReportLearnMore;
|
||||||
return (this._protectionsPopupSendReportLearnMore = document.getElementById(
|
return (this._protectionsPopupSendReportLearnMore = document.getElementById(
|
||||||
|
@ -1254,12 +1248,6 @@ var gProtectionsHandler = {
|
||||||
"protections-popup-sendReportView-collection-url"
|
"protections-popup-sendReportView-collection-url"
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
get _protectionsPopupSendReportButton() {
|
|
||||||
delete this._protectionsPopupSendReportButton;
|
|
||||||
return (this._protectionsPopupSendReportButton = document.getElementById(
|
|
||||||
"protections-popup-sendReportView-submit"
|
|
||||||
));
|
|
||||||
},
|
|
||||||
get _trackingProtectionIconTooltipLabel() {
|
get _trackingProtectionIconTooltipLabel() {
|
||||||
delete this._trackingProtectionIconTooltipLabel;
|
delete this._trackingProtectionIconTooltipLabel;
|
||||||
return (this._trackingProtectionIconTooltipLabel = document.getElementById(
|
return (this._trackingProtectionIconTooltipLabel = document.getElementById(
|
||||||
|
@ -2186,12 +2174,7 @@ var gProtectionsHandler = {
|
||||||
"?" + this.reportURI.query,
|
"?" + this.reportURI.query,
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
let commentsTextarea = document.getElementById(
|
|
||||||
"protections-popup-sendReportView-collection-comments"
|
|
||||||
);
|
|
||||||
commentsTextarea.value = "";
|
|
||||||
this._protectionsPopupSendReportURL.value = urlWithoutQuery;
|
this._protectionsPopupSendReportURL.value = urlWithoutQuery;
|
||||||
this._protectionsPopupSiteNotWorkingReportError.hidden = true;
|
|
||||||
this._protectionsPopupMultiView.showSubView(
|
this._protectionsPopupMultiView.showSubView(
|
||||||
"protections-popup-sendReportView"
|
"protections-popup-sendReportView"
|
||||||
);
|
);
|
||||||
|
@ -2209,7 +2192,6 @@ var gProtectionsHandler = {
|
||||||
// ContentBlockingAllowList here.
|
// ContentBlockingAllowList here.
|
||||||
this._protectionsPopupTPSwitchBreakageLink.hidden =
|
this._protectionsPopupTPSwitchBreakageLink.hidden =
|
||||||
ContentBlockingAllowList.includes(gBrowser.selectedBrowser) ||
|
ContentBlockingAllowList.includes(gBrowser.selectedBrowser) ||
|
||||||
!this._protectionsPopup.hasAttribute("blocking") ||
|
|
||||||
!this._protectionsPopupTPSwitch.hasAttribute("enabled");
|
!this._protectionsPopupTPSwitch.hasAttribute("enabled");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2287,31 +2269,28 @@ var gProtectionsHandler = {
|
||||||
formData.set("labels", activatedBlockers.join(","));
|
formData.set("labels", activatedBlockers.join(","));
|
||||||
}
|
}
|
||||||
|
|
||||||
this._protectionsPopupSendReportButton.disabled = true;
|
|
||||||
|
|
||||||
fetch(reportEndpoint, {
|
fetch(reportEndpoint, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
credentials: "omit",
|
credentials: "omit",
|
||||||
body: formData,
|
body: formData,
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(function(response) {
|
||||||
this._protectionsPopupSendReportButton.disabled = false;
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
Cu.reportError(
|
Cu.reportError(
|
||||||
`Content Blocking report to ${reportEndpoint} failed with status ${
|
`Content Blocking report to ${reportEndpoint} failed with status ${
|
||||||
response.status
|
response.status
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
this._protectionsPopupSiteNotWorkingReportError.hidden = false;
|
|
||||||
} else {
|
} else {
|
||||||
this._protectionsPopup.hidePopup();
|
// Clear the textarea value when the report is submitted
|
||||||
ConfirmationHint.show(this.iconBox, "breakageReport");
|
commentsTextarea.value = "";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(Cu.reportError);
|
.catch(Cu.reportError);
|
||||||
},
|
},
|
||||||
|
|
||||||
onSendReportClicked() {
|
onSendReportClicked() {
|
||||||
|
this._protectionsPopup.hidePopup();
|
||||||
this.submitBreakageReport(this.reportURI);
|
this.submitBreakageReport(this.reportURI);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
<html:link rel="localization" href="browser/branding/sync-brand.ftl"/>
|
<html:link rel="localization" href="browser/branding/sync-brand.ftl"/>
|
||||||
<html:link rel="localization" href="browser/browser.ftl"/>
|
<html:link rel="localization" href="browser/browser.ftl"/>
|
||||||
<html:link rel="localization" href="browser/menubar.ftl"/>
|
<html:link rel="localization" href="browser/menubar.ftl"/>
|
||||||
<html:link rel="localization" href="browser/protectionsPanel.ftl"/>
|
|
||||||
<html:link rel="localization" href="browser/appmenu.ftl"/>
|
<html:link rel="localization" href="browser/appmenu.ftl"/>
|
||||||
<html:link rel="localization" href="browser/readerView.ftl"/>
|
<html:link rel="localization" href="browser/readerView.ftl"/>
|
||||||
</linkset>
|
</linkset>
|
||||||
|
|
|
@ -3,11 +3,6 @@
|
||||||
|
|
||||||
/* Basic UI tests for the protections panel */
|
/* Basic UI tests for the protections panel */
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const TRACKING_PAGE =
|
|
||||||
"http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
|
|
||||||
|
|
||||||
ChromeUtils.defineModuleGetter(
|
ChromeUtils.defineModuleGetter(
|
||||||
this,
|
this,
|
||||||
"ContentBlockingAllowList",
|
"ContentBlockingAllowList",
|
||||||
|
@ -24,7 +19,6 @@ add_task(async function setup() {
|
||||||
["browser.contentblocking.report.monitor.enabled", false],
|
["browser.contentblocking.report.monitor.enabled", false],
|
||||||
["browser.contentblocking.report.lockwise.enabled", false],
|
["browser.contentblocking.report.lockwise.enabled", false],
|
||||||
["browser.contentblocking.report.proxy.enabled", false],
|
["browser.contentblocking.report.proxy.enabled", false],
|
||||||
["privacy.trackingprotection.enabled", true],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||||
|
@ -40,13 +34,8 @@ add_task(async function setup() {
|
||||||
add_task(async function testToggleSwitch() {
|
add_task(async function testToggleSwitch() {
|
||||||
let tab = await BrowserTestUtils.openNewForegroundTab(
|
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||||
gBrowser,
|
gBrowser,
|
||||||
TRACKING_PAGE
|
"https://example.com"
|
||||||
);
|
);
|
||||||
|
|
||||||
await TestUtils.waitForCondition(() => {
|
|
||||||
return gProtectionsHandler._protectionsPopup.hasAttribute("blocking");
|
|
||||||
});
|
|
||||||
|
|
||||||
await openProtectionsPanel();
|
await openProtectionsPanel();
|
||||||
let events = Services.telemetry.snapshotEvents(
|
let events = Services.telemetry.snapshotEvents(
|
||||||
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS
|
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS
|
||||||
|
|
|
@ -9,7 +9,6 @@ add_task(async function setup() {
|
||||||
["browser.contentblocking.report.monitor.enabled", false],
|
["browser.contentblocking.report.monitor.enabled", false],
|
||||||
["browser.contentblocking.report.lockwise.enabled", false],
|
["browser.contentblocking.report.lockwise.enabled", false],
|
||||||
["browser.contentblocking.report.proxy.enabled", false],
|
["browser.contentblocking.report.proxy.enabled", false],
|
||||||
["browser.contentblocking.cfr-milestone.update-interval", 0],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -108,31 +108,6 @@ add_task(async function testReportBreakageCancel() {
|
||||||
Services.prefs.clearUserPref(TP_PREF);
|
Services.prefs.clearUserPref(TP_PREF);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function testNoTracking() {
|
|
||||||
await BrowserTestUtils.withNewTab(BENIGN_PAGE, async function() {
|
|
||||||
await openProtectionsPopup();
|
|
||||||
|
|
||||||
let siteNotWorkingButton = document.getElementById(
|
|
||||||
"protections-popup-tp-switch-breakage-link"
|
|
||||||
);
|
|
||||||
ok(
|
|
||||||
BrowserTestUtils.is_hidden(siteNotWorkingButton),
|
|
||||||
"site not working button is not visible"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
add_task(async function testReportBreakageError() {
|
|
||||||
Services.prefs.setBoolPref(TP_PREF, true);
|
|
||||||
// Make sure that we correctly strip the query.
|
|
||||||
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
|
|
||||||
await BrowserTestUtils.withNewTab(url, async function() {
|
|
||||||
await testReportBreakage(TRACKING_PAGE, "trackingprotection", true);
|
|
||||||
});
|
|
||||||
|
|
||||||
Services.prefs.clearUserPref(TP_PREF);
|
|
||||||
});
|
|
||||||
|
|
||||||
add_task(async function testTP() {
|
add_task(async function testTP() {
|
||||||
Services.prefs.setBoolPref(TP_PREF, true);
|
Services.prefs.setBoolPref(TP_PREF, true);
|
||||||
// Make sure that we correctly strip the query.
|
// Make sure that we correctly strip the query.
|
||||||
|
@ -164,11 +139,9 @@ add_task(async function testFP() {
|
||||||
// Make sure that we correctly strip the query.
|
// Make sure that we correctly strip the query.
|
||||||
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
|
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
|
||||||
await BrowserTestUtils.withNewTab(url, async function(browser) {
|
await BrowserTestUtils.withNewTab(url, async function(browser) {
|
||||||
let promise = waitForContentBlockingEvent();
|
|
||||||
await SpecialPowers.spawn(browser, [], function() {
|
await SpecialPowers.spawn(browser, [], function() {
|
||||||
content.postMessage("fingerprinting", "*");
|
content.postMessage("fingerprinting", "*");
|
||||||
});
|
});
|
||||||
await promise;
|
|
||||||
|
|
||||||
await testReportBreakage(TRACKING_PAGE, "fingerprinting");
|
await testReportBreakage(TRACKING_PAGE, "fingerprinting");
|
||||||
});
|
});
|
||||||
|
@ -183,11 +156,9 @@ add_task(async function testCM() {
|
||||||
// Make sure that we correctly strip the query.
|
// Make sure that we correctly strip the query.
|
||||||
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
|
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
|
||||||
await BrowserTestUtils.withNewTab(url, async function(browser) {
|
await BrowserTestUtils.withNewTab(url, async function(browser) {
|
||||||
let promise = waitForContentBlockingEvent();
|
|
||||||
await SpecialPowers.spawn(browser, [], function() {
|
await SpecialPowers.spawn(browser, [], function() {
|
||||||
content.postMessage("cryptomining", "*");
|
content.postMessage("cryptomining", "*");
|
||||||
});
|
});
|
||||||
await promise;
|
|
||||||
|
|
||||||
await testReportBreakage(TRACKING_PAGE, "cryptomining");
|
await testReportBreakage(TRACKING_PAGE, "cryptomining");
|
||||||
});
|
});
|
||||||
|
@ -196,7 +167,7 @@ add_task(async function testCM() {
|
||||||
Services.prefs.clearUserPref(CB_PREF);
|
Services.prefs.clearUserPref(CB_PREF);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function testReportBreakage(url, tags, error = false) {
|
async function testReportBreakage(url, tags) {
|
||||||
// Setup a mock server for receiving breakage reports.
|
// Setup a mock server for receiving breakage reports.
|
||||||
let server = new HttpServer();
|
let server = new HttpServer();
|
||||||
server.start(-1);
|
server.start(-1);
|
||||||
|
@ -310,12 +281,6 @@ async function testReportBreakage(url, tags, error = false) {
|
||||||
"Should send the correct form data"
|
"Should send the correct form data"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (error) {
|
|
||||||
response.setStatusLine(request.httpVersion, 500, "Request failed");
|
|
||||||
} else {
|
|
||||||
response.setStatusLine(request.httpVersion, 201, "Entry created");
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -323,23 +288,6 @@ async function testReportBreakage(url, tags, error = false) {
|
||||||
submitButton.click();
|
submitButton.click();
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorMessage = document.getElementById(
|
|
||||||
"protections-popup-sendReportView-report-error"
|
|
||||||
);
|
|
||||||
if (error) {
|
|
||||||
await BrowserTestUtils.waitForCondition(() =>
|
|
||||||
BrowserTestUtils.is_visible(errorMessage)
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
comments.value,
|
|
||||||
"This is a comment",
|
|
||||||
"Comment not cleared in case of an error"
|
|
||||||
);
|
|
||||||
gProtectionsHandler._protectionsPopup.hidePopup();
|
|
||||||
} else {
|
|
||||||
ok(BrowserTestUtils.is_hidden(errorMessage), "Error message not shown");
|
|
||||||
}
|
|
||||||
|
|
||||||
await popuphidden;
|
await popuphidden;
|
||||||
|
|
||||||
// Stop the server.
|
// Stop the server.
|
||||||
|
|
|
@ -310,9 +310,6 @@
|
||||||
<label control="protections-popup-sendReportView-collection-comments">&contentBlocking.breakageReportView2.collection.comments.label;</label>
|
<label control="protections-popup-sendReportView-collection-comments">&contentBlocking.breakageReportView2.collection.comments.label;</label>
|
||||||
<html:textarea id="protections-popup-sendReportView-collection-comments" aria-label="&contentBlocking.breakageReportView2.collection.comments.label;"/>
|
<html:textarea id="protections-popup-sendReportView-collection-comments" aria-label="&contentBlocking.breakageReportView2.collection.comments.label;"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
<label id="protections-popup-sendReportView-report-error"
|
|
||||||
data-l10n-id="protections-panel-sendreportview-error"
|
|
||||||
hidden="true" role="alert"></label>
|
|
||||||
</vbox>
|
</vbox>
|
||||||
<vbox id="protections-popup-sendReportView-footer"
|
<vbox id="protections-popup-sendReportView-footer"
|
||||||
class="panel-footer">
|
class="panel-footer">
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
protections-panel-sendreportview-error = There was an error sending the report. Please try again later.
|
|
|
@ -1020,7 +1020,6 @@ confirmationHint.addSearchEngine.label = Search engine added!
|
||||||
confirmationHint.pinTab.label = Pinned!
|
confirmationHint.pinTab.label = Pinned!
|
||||||
confirmationHint.pinTab.description = Right-click the tab to unpin it.
|
confirmationHint.pinTab.description = Right-click the tab to unpin it.
|
||||||
confirmationHint.passwordSaved.label = Password saved!
|
confirmationHint.passwordSaved.label = Password saved!
|
||||||
confirmationHint.breakageReport.label = Report sent. Thank you!
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (livebookmarkMigration.title):
|
# LOCALIZATION NOTE (livebookmarkMigration.title):
|
||||||
# Used by the export of user's live bookmarks to an OPML file as a title for the file.
|
# Used by the export of user's live bookmarks to an OPML file as a title for the file.
|
||||||
|
|
|
@ -479,11 +479,6 @@ description#identity-popup-content-verifier,
|
||||||
margin-inline-start: 0;
|
margin-inline-start: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#protections-popup-sendReportView-report-error {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
color: #d74345;
|
|
||||||
}
|
|
||||||
|
|
||||||
.protections-popup-category {
|
.protections-popup-category {
|
||||||
/* Overwrite toolbarbutton styles */
|
/* Overwrite toolbarbutton styles */
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче