diff --git a/browser/components/uitour/UITour-lib.js b/browser/components/uitour/UITour-lib.js
index 9a32e71b3020..582363993a91 100644
--- a/browser/components/uitour/UITour-lib.js
+++ b/browser/components/uitour/UITour-lib.js
@@ -371,6 +371,14 @@ if (typeof Mozilla == "undefined") {
_sendEvent("showNewTab");
};
+ /**
+ * Loads about:protections in the tour tab.
+ * @since 70
+ */
+ Mozilla.UITour.showProtectionReport = function() {
+ _sendEvent("showProtectionReport");
+ };
+
/**
* @typedef Mozilla.UITour.ConfigurationName
* @description Valid values:
diff --git a/browser/components/uitour/UITour.jsm b/browser/components/uitour/UITour.jsm
index 098501515a85..f11b524e1db8 100644
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -709,6 +709,11 @@ var UITour = {
}
break;
}
+
+ case "showProtectionReport": {
+ this.showProtectionReport(window, browser);
+ break;
+ }
}
// For performance reasons, only call initForBrowser if we did something
@@ -1554,6 +1559,17 @@ var UITour = {
});
},
+ showProtectionReport(aWindow, aBrowser) {
+ let url = "about:protections";
+ aWindow.openLinkIn(url, "current", {
+ targetBrowser: aBrowser,
+ triggeringPrincipal: Services.scriptSecurityManager.createContentPrincipal(
+ Services.io.newURI(url),
+ {}
+ ),
+ });
+ },
+
_hideAnnotationsForPanel(aEvent, aShouldClosePanel, aTargetPositionCallback) {
let win = aEvent.target.ownerGlobal;
let hideHighlightMethod = null;
diff --git a/browser/components/uitour/test/browser.ini b/browser/components/uitour/test/browser.ini
index 90558af05e15..178646b1c10f 100644
--- a/browser/components/uitour/test/browser.ini
+++ b/browser/components/uitour/test/browser.ini
@@ -38,6 +38,8 @@ skip-if = true # Disabled pending removal of pocket UI Tour
skip-if = (verify && !debug && (os == 'linux'))
[browser_UITour_showNewTab.js]
skip-if = (verify && !debug && (os == 'linux'))
+[browser_UITour_showProtectionReport.js]
+skip-if = (verify && !debug && (os == 'linux'))
[browser_UITour_sync.js]
[browser_UITour_toggleReaderMode.js]
skip-if = (verify && !debug && (os == 'linux'))
diff --git a/browser/components/uitour/test/browser_UITour_showProtectionReport.js b/browser/components/uitour/test/browser_UITour_showProtectionReport.js
new file mode 100644
index 000000000000..f807b61d39ad
--- /dev/null
+++ b/browser/components/uitour/test/browser_UITour_showProtectionReport.js
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+add_task(setup_UITourTest);
+
+// Test that we can switch to about:protections
+add_UITour_task(async function test_openProtectionReport() {
+ let aboutProtectionsLoaded = BrowserTestUtils.browserLoaded(
+ gBrowser.selectedBrowser,
+ false,
+ "about:protections"
+ );
+ info("Showing about:protections");
+ await gContentAPI.showProtectionReport();
+ info("Waiting for about:protections to load");
+ await aboutProtectionsLoaded;
+ is(
+ gBrowser.selectedBrowser.currentURI.spec,
+ "about:protections",
+ "Loaded about:protections"
+ );
+});