Bug 1899757 - Allow targeting the trigger tab for feature callouts. r=hanna_a,omc-reviewers
Also add a global `browserIsSelected` context property for all triggers, so you can entirely avoid showing a message if the triggering browser was in the background. You can use the selector and the context property together or separately. Context targeting: `browserIsSelected` Background tab selector: `#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%` Current tab selector: `#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%[visuallyselected]` Child of tab selector: `#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab% .tab-icon-image` Differential Revision: https://phabricator.services.mozilla.com/D212494
This commit is contained in:
@@ -50,6 +50,7 @@ describe("ASRouter", () => {
|
||||
let FakeToolbarBadgeHub;
|
||||
let FakeMomentsPageHub;
|
||||
let ASRouterTargeting;
|
||||
let gBrowser;
|
||||
let screenImpressions;
|
||||
|
||||
function setMessageProviderPref(value) {
|
||||
@@ -171,6 +172,12 @@ describe("ASRouter", () => {
|
||||
userId: "adsf",
|
||||
},
|
||||
};
|
||||
gBrowser = {
|
||||
selectedBrowser: {
|
||||
constructor: { name: "MozBrowser" },
|
||||
getTabBrowser: () => gBrowser,
|
||||
},
|
||||
};
|
||||
|
||||
ASRouterPreferences.specialConditions = {
|
||||
someCondition: true,
|
||||
@@ -236,7 +243,7 @@ describe("ASRouter", () => {
|
||||
ASRouterTargeting,
|
||||
ASRouterTriggerListeners,
|
||||
QueryCache,
|
||||
gBrowser: { selectedBrowser: {} },
|
||||
gBrowser,
|
||||
gURLBar: {},
|
||||
isSeparateAboutWelcome: true,
|
||||
AttributionCode: fakeAttributionCode,
|
||||
@@ -1591,7 +1598,7 @@ describe("ASRouter", () => {
|
||||
|
||||
await Router.sendTriggerMessage({
|
||||
tabId: 0,
|
||||
browser: {},
|
||||
browser: gBrowser.selectedBrowser,
|
||||
id: "firstRun",
|
||||
});
|
||||
|
||||
@@ -1601,7 +1608,7 @@ describe("ASRouter", () => {
|
||||
{
|
||||
id: "firstRun",
|
||||
param: undefined,
|
||||
context: undefined,
|
||||
context: { browserIsSelected: true },
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user