/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** *Displaysanotificationeitheratthebrowserortoolboxlevel,dependingonwhether *atoolboxiscurrentlyopenforthistab. * *@paramwindow *Themainbrowserchromewindow. *@paramtab *Thebrowsertab. *@paramoptions *Otheroptionsassociatedwithopening.Currentlyincludes: *-`toolbox`:Whetherinitiatedviatoolboxbutton *-`msg`:Stringtoshowinthenotification *-`priority`:Prioritylevelforthenotification,whichaffectstheiconand *overallappearance.
*/
async function showNotification(
window,
tab,
{ toolboxButton, msg, priority } = {}
) { // Default to using the browser's per-tab notification box
let nbox = window.gBrowser.getNotificationBox(tab.linkedBrowser);
// If opening was initiated by a toolbox button, check for an open // toolbox for the tab. If one exists, use the toolbox's notification box so that the // message is placed closer to the action taken by the user. if (toolboxButton) { const toolbox = gDevTools.getToolboxForTab(tab); if (toolbox) {
nbox = toolbox.notificationBox;
}
}
const value = "devtools-responsive"; if (nbox.getNotificationWithValue(value)) { // Notification already displayed return;
}
if (!priority) {
priority = nbox.PRIORITY_INFO_MEDIUM;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.