Bug 1646286 - Allow ToolbarPanel messages to specify how to open about pages r=nanj

Differential Revision: https://phabricator.services.mozilla.com/D79989
This commit is contained in:
Andrei Oprea 2020-06-17 13:50:12 +00:00
Родитель 4369f0e6c8
Коммит e15823a204
3 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -71,7 +71,11 @@
},
"cta_type": {
"description": "Type of url open action",
"enum": ["OPEN_URL", "OPEN_ABOUT_PAGE"]
"enum": ["OPEN_URL", "OPEN_ABOUT_PAGE", "OPEN_PROTECTION_REPORT"]
},
"cta_where": {
"description": "How to open the cta: new window, tab, focused, unfocused.",
"enum": ["current", "tabshifted", "tab", "save", "window"]
},
"icon_url": {
"description": "(optional) URL for the What's New message icon.",

Просмотреть файл

@ -154,8 +154,8 @@ const MESSAGES = () => [
icon_alt: "",
body: { string_id: "cfr-whatsnew-fingerprinter-counter-body" },
link_text: { string_id: "cfr-whatsnew-tracking-blocked-link-text" },
cta_url: "protections",
cta_type: "OPEN_ABOUT_PAGE",
cta_url: "",
cta_type: "OPEN_PROTECTION_REPORT",
},
targeting: `firefoxVersion >= 72`,
trigger: { id: "whatsNewPanelOpened" },
@ -173,8 +173,8 @@ const MESSAGES = () => [
icon_alt: "",
body: { string_id: "cfr-whatsnew-fingerprinter-counter-body-alt" },
link_text: { string_id: "cfr-whatsnew-tracking-blocked-link-text" },
cta_url: "protections",
cta_type: "OPEN_ABOUT_PAGE",
cta_url: "",
cta_type: "OPEN_PROTECTION_REPORT",
},
targeting: `firefoxVersion >= 72`,
trigger: { id: "whatsNewPanelOpened" },
@ -248,8 +248,8 @@ const MESSAGES = () => [
icon_alt: "Protection Report icon",
body: { string_id: "cfr-whatsnew-tracking-protect-body" },
link_text: { string_id: "cfr-whatsnew-tracking-blocked-link-text" },
cta_url: "protections",
cta_type: "OPEN_ABOUT_PAGE",
cta_url: "",
cta_type: "OPEN_PROTECTION_REPORT",
},
targeting: `firefoxVersion > 69 && totalBlockedCount > 0`,
trigger: { id: "whatsNewPanelOpened" },

Просмотреть файл

@ -240,7 +240,7 @@ class _ToolbarPanelHub {
type: message.content.cta_type,
data: {
args: url,
where: "tabshifted",
where: message.content.cta_where || "tabshifted",
},
},
win.browser