Use moz-message-bar instead of message-bar in notificationbox.js
Categories
(Toolkit :: UI Widgets, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: hjones, Assigned: hjones)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(8 files, 1 obsolete file)
24.77 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The code in notificationbox.js
handles creating info bars that are displayed at the top of web pages in the chrome when certain events occur. Currently the NotificationMessage
element extends the message-bar
element: https://searchfox.org/mozilla-central/source/toolkit/content/widgets/notificationbox.js#611-614
Now that moz-mesage-bar
is available we should us it as the base class for NotificationMessage
instead of message-bar
. This will solve the issue of in-content/common-shared.css
getting pulled into the chrome, which has been a side effect of the current NotificationMessage
setup.
There will likely be changes that need to be made to reflect the fact that moz-message-bar
has a different API from message-bar
- it's more controlled and no longer based around having a single <slot>
. Also notificationbox.js
adds a number of classes to the message bar element. These styles currently live in message-bar.css
, but we removed them from moz-message-bar.css
so we may have to add a new stylesheet that gets pulled in to Notificationmessage
s only.
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
Notification can be triggered locally via this snippet:
BrowserSearch.removalOfSearchEngineNotificationBox("Google", "Foogle")
Depends on D189872
Assignee | ||
Comment 4•1 year ago
|
||
There are some tests you can run to see how this looks, but I've also been verifying things locally by running this snippet in the browser toolbox:
const { InfoBar } = ChromeUtils.import(
"resource://activity-stream/lib/InfoBar.jsm"
);
const { CFRMessageProvider } = ChromeUtils.importESModule(
"resource://activity-stream/lib/CFRMessageProvider.sys.mjs"
);
let message = (await CFRMessageProvider.getMessages()).find(
m => m.id === "INFOBAR_ACTION_86"
);
InfoBar.showInfoBarMessage(
BrowserWindowTracker.getTopWindow().gBrowser.selectedBrowser,
{
...message,
content: {
priority: window.gNotificationBox.PRIORITY_WARNING_HIGH,
...message.content,
},
},
{}
);
Depends on D194312
Assignee | ||
Comment 5•1 year ago
|
||
Can be tested locally by running this code in the browser toolbox:
gBrowser.selectedBrowser.ownerGlobal.CaptivePortalWatcher._showNotification();
Depends on D194313
Assignee | ||
Comment 6•1 year ago
|
||
I've been testing locally with these snippets in the browser toolbox:
const { TabCrashHandler } = ChromeUtils.importESModule("resource:///modules/ContentCrashHandlers.sys.mjs");
TabCrashHandler.showSubFrameNotification(gBrowser.selectedBrowser, "foo", "bar");
const { UnsubmittedCrashHandler } = ChromeUtils.importESModule("resource:///modules/ContentCrashHandlers.sys.mjs");
UnsubmittedCrashHandler.show({ notificationId: "foo", reportIDs: [], onAction: () => {}});
Depends on D194314
Assignee | ||
Comment 7•1 year ago
|
||
Can be tested locally using this snippet (which I think I took from a test...):
let addonId = "test";
let policy = new WebExtensionPolicy({
name: "Scapegoat",
id: addonId,
mozExtensionHostname: Services.uuid.generateUUID().number.slice(1, -1),
baseURL: "file:///",
allowedOrigins: new MatchPatternSet([]),
localizeCallback() {},
});
policy.active = true;
ProcessHangMonitor.showNotification(window, { addonId, scriptBrowser: { browsingContext: { watchedByDevTools: false }} });
Depends on D194315
Assignee | ||
Comment 8•1 year ago
|
||
Can be tested locally with this snippet:
const { Heartbeat } = ChromeUtils.importESModule(
"resource://normandy/lib/Heartbeat.sys.mjs"
);
new Heartbeat(window, {
testing: true,
flowId: "test",
message: "This is a test message!",
engagementButtonLabel: undefined,
learnMoreMessage: "Learn More",
learnMoreUrl: "https://example.org/learnmore",
});
Depends on D194316
Assignee | ||
Comment 9•1 year ago
|
||
This is only sort of related to the rest of the patches in the stack, but when using the .footer-button
class in the info-bar I realized the styles don't change in HCM, which seemed worth fixing. These styles can be seen in action in the ETP panel or in the customize mode screen.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•11 months ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:hjones, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Comment 11•11 months ago
|
||
Not sure why I was selected for needinfo. Maybe because I reviewed a tiny bit of a patch as last person? Clearing...
Comment 12•11 months ago
|
||
Comment 13•11 months ago
|
||
Backed out for causing dt failures on browser_screenshot_button_warning.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=442161412&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/45416e4c25092dbc29cd07d468894e8e9689516b
Comment 14•11 months ago
|
||
Comment 15•11 months ago
|
||
Backed out for causing failures on browser_datachoices_notification.js
Comment 16•11 months ago
|
||
Comment 17•11 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/598874fd4b8e
https://hg.mozilla.org/mozilla-central/rev/1a3e1eda40b0
https://hg.mozilla.org/mozilla-central/rev/9ae523de438c
https://hg.mozilla.org/mozilla-central/rev/18b04346d36c
https://hg.mozilla.org/mozilla-central/rev/e5876a299cdd
https://hg.mozilla.org/mozilla-central/rev/e0beffc85b9b
https://hg.mozilla.org/mozilla-central/rev/fe54bf7adef0
Assignee | ||
Updated•11 months ago
|
Updated•9 months ago
|
Description
•