зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 5 changesets (bug 1555236) for causing browser chrome failures on browser_trackingUI_report_breakage.js CLOSED TREE
Backed out changeset 866ffc49eb11 (bug 1555236) Backed out changeset 24fda9469423 (bug 1555236) Backed out changeset 7b6d88faaab2 (bug 1555236) Backed out changeset 33c1b3a19483 (bug 1555236) Backed out changeset 9f5563adc0de (bug 1555236)
This commit is contained in:
Родитель
176aeab92f
Коммит
42a7e7ac69
|
@ -971,25 +971,19 @@ var ContentBlocking = {
|
|||
this.identityPopupMultiView.goBack();
|
||||
},
|
||||
|
||||
onSubmitBreakageReportClicked() {
|
||||
submitBreakageReport() {
|
||||
this.identityPopup.hidePopup();
|
||||
|
||||
let comments = document.getElementById(
|
||||
"identity-popup-breakageReportView-collection-comments").value;
|
||||
this.submitBreakageReport(this.reportURI, comments);
|
||||
},
|
||||
|
||||
submitBreakageReport(uri, comments) {
|
||||
let reportEndpoint = Services.prefs.getStringPref(this.PREF_REPORT_BREAKAGE_URL);
|
||||
if (!reportEndpoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
formData.set("title", uri.host);
|
||||
formData.set("title", this.reportURI.host);
|
||||
|
||||
// Leave the ? at the end of the URL to signify that this URL had its query stripped.
|
||||
let urlWithoutQuery = uri.asciiSpec.replace(uri.query, "");
|
||||
let urlWithoutQuery = this.reportURI.asciiSpec.replace(this.reportURI.query, "");
|
||||
let body = `Full URL: ${urlWithoutQuery}\n`;
|
||||
body += `userAgent: ${navigator.userAgent}\n`;
|
||||
|
||||
|
@ -1005,7 +999,8 @@ var ContentBlocking = {
|
|||
body += `${Fingerprinting.PREF_ENABLED}: ${Services.prefs.getBoolPref(Fingerprinting.PREF_ENABLED)}\n`;
|
||||
body += `${Cryptomining.PREF_ENABLED}: ${Services.prefs.getBoolPref(Cryptomining.PREF_ENABLED)}\n`;
|
||||
|
||||
body += "\n**Comments**\n" + comments;
|
||||
let comments = document.getElementById("identity-popup-breakageReportView-collection-comments");
|
||||
body += "\n**Comments**\n" + comments.value;
|
||||
|
||||
formData.set("body", body);
|
||||
|
||||
|
|
|
@ -17,11 +17,6 @@ var gProtectionsHandler = {
|
|||
delete this._protectionsIconBox;
|
||||
return this._protectionsIconBox = document.getElementById("tracking-protection-icon-animatable-box");
|
||||
},
|
||||
get _protectionsPopupMultiView() {
|
||||
delete this._protectionsPopupMultiView;
|
||||
return this._protectionsPopupMultiView =
|
||||
document.getElementById("protections-popup-multiView");
|
||||
},
|
||||
get _protectionsPopupMainView() {
|
||||
delete this._protectionsPopupMainView;
|
||||
return this._protectionsPopupMainView =
|
||||
|
@ -57,21 +52,6 @@ var gProtectionsHandler = {
|
|||
return this._protectionPopupTrackersCounterDescription =
|
||||
document.getElementById("protections-popup-trackers-blocked-counter-description");
|
||||
},
|
||||
get _protectionsPopupSiteNotWorkingTPSwitch() {
|
||||
delete this._protectionsPopupSiteNotWorkingTPSwitch;
|
||||
return this._protectionsPopupSiteNotWorkingTPSwitch =
|
||||
document.getElementById("protections-popup-siteNotWorking-tp-switch");
|
||||
},
|
||||
get _protectionsPopupSendReportLearnMore() {
|
||||
delete this._protectionsPopupSendReportLearnMore;
|
||||
return this._protectionsPopupSendReportLearnMore =
|
||||
document.getElementById("protections-popup-sendReportView-learn-more");
|
||||
},
|
||||
get _protectionsPopupSendReportURL() {
|
||||
delete this._protectionsPopupSendReportURL;
|
||||
return this._protectionsPopupSendReportURL =
|
||||
document.getElementById("protections-popup-sendReportView-collection-url");
|
||||
},
|
||||
get _protectionsPopupToastTimeout() {
|
||||
delete this._protectionsPopupToastTimeout;
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "_protectionsPopupToastTimeout",
|
||||
|
@ -148,6 +128,10 @@ var gProtectionsHandler = {
|
|||
},
|
||||
|
||||
refreshProtectionsPopup() {
|
||||
// Refresh the state of the TP toggle switch.
|
||||
this._protectionsPopupTPSwitch.toggleAttribute("enabled",
|
||||
!this._protectionsPopup.hasAttribute("hasException"));
|
||||
|
||||
let host = gIdentityHandler.getHostForDisplay();
|
||||
|
||||
// Push the appropriate strings out to the UI.
|
||||
|
@ -158,10 +142,7 @@ var gProtectionsHandler = {
|
|||
let currentlyEnabled =
|
||||
!this._protectionsPopup.hasAttribute("hasException");
|
||||
|
||||
for (let tpSwitch of [this._protectionsPopupTPSwitch,
|
||||
this._protectionsPopupSiteNotWorkingTPSwitch]) {
|
||||
tpSwitch.toggleAttribute("enabled", currentlyEnabled);
|
||||
}
|
||||
this._protectionsPopupTPSwitch.toggleAttribute("enabled", currentlyEnabled);
|
||||
|
||||
// Display the breakage link according to the current enable state.
|
||||
// The display state of the breakage link will be fixed once the protections
|
||||
|
@ -190,10 +171,7 @@ var gProtectionsHandler = {
|
|||
// styling after toggling the TP switch.
|
||||
let newExceptionState =
|
||||
this._protectionsPopup.toggleAttribute("hasException");
|
||||
for (let tpSwitch of [this._protectionsPopupTPSwitch,
|
||||
this._protectionsPopupSiteNotWorkingTPSwitch]) {
|
||||
tpSwitch.toggleAttribute("enabled", !newExceptionState);
|
||||
}
|
||||
this._protectionsPopupTPSwitch.toggleAttribute("enabled", !newExceptionState);
|
||||
|
||||
// Indicating that we need to show a toast after refreshing the page.
|
||||
// And caching the current URI and window ID in order to only show the mini
|
||||
|
@ -270,27 +248,4 @@ var gProtectionsHandler = {
|
|||
triggerEvent: event,
|
||||
}).catch(Cu.reportError);
|
||||
},
|
||||
|
||||
showSiteNotWorkingView() {
|
||||
this._protectionsPopupMultiView.showSubView("protections-popup-siteNotWorkingView");
|
||||
},
|
||||
|
||||
showSendReportView() {
|
||||
// Save this URI to make sure that the user really only submits the location
|
||||
// they see in the report breakage dialog.
|
||||
this.reportURI = gBrowser.currentURI;
|
||||
let urlWithoutQuery = this.reportURI.asciiSpec.replace("?" + this.reportURI.query, "");
|
||||
this._protectionsPopupSendReportURL.value = urlWithoutQuery;
|
||||
this._protectionsPopupMultiView.showSubView("protections-popup-sendReportView");
|
||||
},
|
||||
|
||||
onSendReportClicked() {
|
||||
this._protectionsPopup.hidePopup();
|
||||
let comments = document.getElementById(
|
||||
"protections-popup-sendReportView-collection-comments").value;
|
||||
ContentBlocking.submitBreakageReport(this.reportURI, comments);
|
||||
},
|
||||
};
|
||||
|
||||
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
gProtectionsHandler._protectionsPopupSendReportLearnMore.href = baseURL + "blocking-breakage";
|
||||
|
|
|
@ -40,22 +40,6 @@ add_task(async function testToggleSwitch() {
|
|||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
add_task(async function testSiteNotWorking() {
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
|
||||
await openProtectionsPanel();
|
||||
let viewShownPromise = BrowserTestUtils.waitForEvent(
|
||||
gProtectionsHandler._protectionsPopupMultiView, "ViewShown");
|
||||
document.getElementById("protections-popup-tp-switch-breakage-link").click();
|
||||
let event = await viewShownPromise;
|
||||
is(event.originalTarget.id, "protections-popup-siteNotWorkingView", "Site Not Working? view should be shown");
|
||||
viewShownPromise = BrowserTestUtils.waitForEvent(
|
||||
gProtectionsHandler._protectionsPopupMultiView, "ViewShown");
|
||||
document.getElementById("protections-popup-siteNotWorkingView-sendReport").click();
|
||||
event = await viewShownPromise;
|
||||
is(event.originalTarget.id, "protections-popup-sendReportView", "Send Report view should be shown");
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
/**
|
||||
* A test for the protection settings button.
|
||||
*/
|
||||
|
|
|
@ -346,7 +346,7 @@
|
|||
<button id="identity-popup-breakageReportView-submit"
|
||||
default="true"
|
||||
label="&contentBlocking.breakageReportView.sendReport.label;"
|
||||
oncommand="ContentBlocking.onSubmitBreakageReportClicked();"/>
|
||||
oncommand="ContentBlocking.submitBreakageReport();"/>
|
||||
</vbox>
|
||||
</panelview>
|
||||
</panelmultiview>
|
||||
|
|
|
@ -25,21 +25,19 @@
|
|||
</hbox>
|
||||
|
||||
<hbox id="protections-popup-tp-switch-section" class="identity-popup-section">
|
||||
<vbox class="protections-popup-tp-switch-label-box" flex="1">
|
||||
<label class="protections-popup-tp-switch-on-header"
|
||||
<vbox id="protections-popup-tp-switch-label-box" flex="1">
|
||||
<label id="protections-popup-tp-switch-on-header"
|
||||
hidden="true">Tracking protection is ON for this site</label>
|
||||
<label class="protections-popup-tp-switch-off-header"
|
||||
<label id="protections-popup-tp-switch-off-header"
|
||||
hidden="true">Tracking protection is OFF for this site</label>
|
||||
<label id="protections-popup-tp-switch-breakage-link"
|
||||
class="text-link"
|
||||
onclick="gProtectionsHandler.showSiteNotWorkingView();"
|
||||
hidden="true">Site not working?</label>
|
||||
</vbox>
|
||||
<vbox class="protections-popup-tp-switch-box">
|
||||
<vbox id="protections-popup-tp-switch-box">
|
||||
<toolbarbutton id="protections-popup-tp-switch"
|
||||
class="protections-popup-tp-switch"
|
||||
enabled="false"
|
||||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
enabled="false"
|
||||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
|
@ -61,77 +59,5 @@
|
|||
href="about:protections">Show Full Report</label>
|
||||
</hbox>
|
||||
</panelview>
|
||||
|
||||
<!-- Site Not Working? SubView -->
|
||||
<panelview id="protections-popup-siteNotWorkingView"
|
||||
title="Site Not Working?"
|
||||
descriptionheightworkaround="true"
|
||||
flex="1">
|
||||
<hbox id="protections-popup-siteNotWorkingView-header">
|
||||
<vbox class="protections-popup-tp-switch-label-box" flex="1">
|
||||
<label class="protections-popup-tp-switch-on-header"
|
||||
hidden="true">Tracking protection is ON for this site</label>
|
||||
<label class="protections-popup-tp-switch-off-header"
|
||||
hidden="true">Tracking protection is OFF for this site</label>
|
||||
</vbox>
|
||||
<vbox class="protections-popup-tp-switch-box">
|
||||
<toolbarbutton id="protections-popup-siteNotWorking-tp-switch"
|
||||
class="protections-popup-tp-switch"
|
||||
enabled="false"
|
||||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox id="protections-popup-siteNotWorkingView-body" flex="1">
|
||||
<label>Turn off Tracking Protection if you're having issues with:</label>
|
||||
<label>
|
||||
<html:ul id="protections-popup-siteNotWorkingView-body-issue-list">
|
||||
<html:li>Log in fields</html:li>
|
||||
<html:li>Forms</html:li>
|
||||
<html:li>Payments</html:li>
|
||||
<html:li>Comments</html:li>
|
||||
<html:li>Videos</html:li>
|
||||
</html:ul>
|
||||
</label>
|
||||
</vbox>
|
||||
<hbox id="protections-popup-siteNotWorkingView-footer"
|
||||
class="panel-footer">
|
||||
<label id="protections-popup-siteNotWorkingView-siteStillBroken" flex="1">Site Still Broken?</label>
|
||||
<label id="protections-popup-siteNotWorkingView-sendReport"
|
||||
onclick="gProtectionsHandler.showSendReportView();"
|
||||
class="text-link">Send Report</label>
|
||||
</hbox>
|
||||
</panelview>
|
||||
|
||||
|
||||
<!-- Send Report SubView -->
|
||||
<panelview id="protections-popup-sendReportView"
|
||||
title="Send Report"
|
||||
descriptionheightworkaround="true">
|
||||
<vbox id="protections-popup-sendReportView-heading">
|
||||
<description>&contentBlocking.breakageReportView2.description;</description>
|
||||
<label id="protections-popup-sendReportView-learn-more"
|
||||
is="text-link">&contentBlocking.breakageReportView.learnMore;</label>
|
||||
</vbox>
|
||||
<vbox id="protections-popup-sendReportView-body" class="panel-view-body-unscrollable">
|
||||
<vbox class="protections-popup-sendReportView-collection-section">
|
||||
<label>&contentBlocking.breakageReportView.collection.url.label;</label>
|
||||
<html:input readonly="readonly" id="protections-popup-sendReportView-collection-url"/>
|
||||
</vbox>
|
||||
<vbox class="protections-popup-sendReportView-collection-section">
|
||||
<label>&contentBlocking.breakageReportView.collection.comments.label;</label>
|
||||
<html:textarea id="protections-popup-sendReportView-collection-comments"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
<vbox id="protections-popup-sendReportView-footer"
|
||||
class="panel-footer">
|
||||
<button id="protections-popup-sendReportView-cancel"
|
||||
label="&contentBlocking.breakageReportView.cancel.label;"
|
||||
oncommand="gProtectionsHandler._protectionsPopupMultiView.goBack();"/>
|
||||
<button id="protections-popup-sendReportView-submit"
|
||||
default="true"
|
||||
label="&contentBlocking.breakageReportView.sendReport.label;"
|
||||
oncommand="gProtectionsHandler.onSendReportClicked();"/>
|
||||
</vbox>
|
||||
</panelview>
|
||||
</panelmultiview>
|
||||
</panel>
|
||||
|
|
|
@ -192,7 +192,6 @@
|
|||
#identity-popup-trackersView > .panel-header,
|
||||
#identity-popup-securityView > .panel-header,
|
||||
#identity-popup-breakageReportView > .panel-header,
|
||||
#protections-popup-sendReportView > .panel-header,
|
||||
#identity-popup-content-blocking-report-breakage,
|
||||
.identity-popup-content-blocking-category-label,
|
||||
.identity-popup-content-blocking-category-state-label,
|
||||
|
@ -211,8 +210,7 @@
|
|||
}
|
||||
|
||||
#identity-popup-mainView-panel-header,
|
||||
#protections-popup-mainView-panel-header,
|
||||
#protections-popup-siteNotWorkingView-footer {
|
||||
#protections-popup-mainView-panel-header {
|
||||
padding: 4px 1em;
|
||||
min-height: 40px;
|
||||
-moz-box-pack: center;
|
||||
|
@ -373,41 +371,33 @@ description#identity-popup-content-verifier,
|
|||
|
||||
/* CONTENT BLOCKING / TRACKING PROTECTION */
|
||||
|
||||
#identity-popup-breakageReportView-footer,
|
||||
#protections-popup-sendReportView-footer {
|
||||
#identity-popup-breakageReportView-footer {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#identity-popup-breakageReportView-footer > button,
|
||||
#protections-popup-sendReportView-footer > button {
|
||||
#identity-popup-breakageReportView-footer > button {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
#identity-popup-breakageReportView-heading,
|
||||
#identity-popup-breakageReportView-body,
|
||||
#protections-popup-sendReportView-heading,
|
||||
#protections-popup-sendReportView-body {
|
||||
#identity-popup-breakageReportView-body {
|
||||
padding: 16px;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
.identity-popup-breakageReportView-collection-section,
|
||||
.protections-popup-sendReportView-collection-section {
|
||||
.identity-popup-breakageReportView-collection-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#identity-popup-breakageReportView-body,
|
||||
#protections-popup-sendReportView-body {
|
||||
#identity-popup-breakageReportView-body {
|
||||
border-top: 1px solid var(--panel-separator-color);
|
||||
}
|
||||
|
||||
#identity-popup-breakageReportView-collection-url,
|
||||
#protections-popup-sendReportView-collection-url {
|
||||
#identity-popup-breakageReportView-collection-url {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
#identity-popup-breakageReportView-collection-comments,
|
||||
#protections-popup-sendReportView-collection-comments {
|
||||
#identity-popup-breakageReportView-collection-comments {
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
|
@ -821,8 +811,8 @@ description#identity-popup-content-verifier,
|
|||
display: none;
|
||||
}
|
||||
|
||||
#protections-popup:not([hasException]) .protections-popup-tp-switch-on-header,
|
||||
#protections-popup[hasException] .protections-popup-tp-switch-off-header,
|
||||
#protections-popup:not([hasException]) #protections-popup-tp-switch-on-header,
|
||||
#protections-popup[hasException] #protections-popup-tp-switch-off-header,
|
||||
#protections-popup:not([hasException])[toast] #protections-popup-toast-panel-tp-on-desc,
|
||||
#protections-popup[hasException][toast] #protections-popup-toast-panel-tp-off-desc {
|
||||
display: unset;
|
||||
|
@ -842,9 +832,8 @@ description#identity-popup-content-verifier,
|
|||
);
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-body,
|
||||
.protections-popup-tp-switch-label-box,
|
||||
.protections-popup-tp-switch-box {
|
||||
#protections-popup-tp-switch-label-box,
|
||||
#protections-popup-tp-switch-box {
|
||||
padding: 4px 1em;
|
||||
min-height: 40px;
|
||||
-moz-box-pack: center;
|
||||
|
@ -853,12 +842,12 @@ description#identity-popup-content-verifier,
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch-on-header,
|
||||
.protections-popup-tp-switch-off-header {
|
||||
#protections-popup-tp-switch-on-header,
|
||||
#protections-popup-tp-switch-off-header {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch {
|
||||
#protections-popup-tp-switch {
|
||||
-moz-appearance: none;
|
||||
box-sizing: border-box;
|
||||
min-width: 26px;
|
||||
|
@ -868,12 +857,12 @@ description#identity-popup-content-verifier,
|
|||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
margin-inline-start: 1px;
|
||||
margin-inline-end: 7px;
|
||||
padding: 2px;
|
||||
padding-inline-end: 0;
|
||||
transition: padding .2s ease;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch::before {
|
||||
#protections-popup-tp-switch::before {
|
||||
position: relative;
|
||||
display: block;
|
||||
content: "";
|
||||
|
@ -883,31 +872,23 @@ description#identity-popup-content-verifier,
|
|||
background: white;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch[enabled] {
|
||||
#protections-popup-tp-switch[enabled] {
|
||||
background-color: #0a84ff;
|
||||
border: 1px solid #0a84ff;
|
||||
/* Push the toggle to the right. */
|
||||
padding-inline-start: 12px;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch:hover,
|
||||
.protections-popup-tp-switch:-moz-focusring {
|
||||
#protections-popup-tp-switch:hover,
|
||||
#protections-popup-tp-switch:-moz-focusring {
|
||||
border: 1px solid var(--panel-separator-color);
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch[enabled=true]:hover,
|
||||
.protections-popup-tp-switch[enabled=true]:-moz-focusring {
|
||||
#protections-popup-tp-switch[enabled=true]:hover,
|
||||
#protections-popup-tp-switch[enabled=true]:-moz-focusring {
|
||||
background-color: #45a1ff;
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-body-issue-list {
|
||||
padding-inline-start: 1em;
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-footer {
|
||||
border-top: 1px solid var(--panel-separator-color);
|
||||
}
|
||||
|
||||
#protections-popup-settings-section {
|
||||
padding: 4px;
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
|
|
Загрузка…
Ссылка в новой задаче