Ky sajt do të funksionojë me kufizime, teksa bëjmë mirëmbajtjen e tij për të përmirësuar punën tuaj. Nëse një artikull nuk e zgjidh problemin tuaj dhe dëshironi të bëni një pyetje, kemi bashkësinë tonë të asistencës, e gatshme për t’ju ndihmuar, te @FirefoxSupport në Twitter dhe/r/firefox në Reddit.

Kërkoni te Asistenca

Shmangni karremëzime gjoja asistence. S’do t’ju kërkojmë kurrë të bëni një thirrje apo të dërgoni tekst te një numër telefoni, apo të na jepni të dhëna personale. Ju lutemi, raportoni veprimtari të dyshimtë duke përdorur mundësinë “Raportoni Abuzim”.

Mësoni Më Tepër

Showing non-modal popup in overlay of browser.xul - on Windows

more options

Hi. I've got a custom Firefox add-on in plain Javascript. It to overlays Firefox's browser.xul (via chrome.manifest) by an XUL file, where I would like to show a non-modal popup (or some kind of non-intrusive notification).

I've tried following three options from https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications:

1.

               Components.classes['@mozilla.org/alerts-service;1'].
                   getService(Components.interfaces.nsIAlertsService).
                   showAlertNotification(null, 'Some title', 'Some message', false, , null);

2.

               var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1'].
                   getService(Components.interfaces.nsIWindowWatcher).
                   openWindow(null, 'chrome://global/content/alerts/alert.xul',
                     '_blank', 'chrome,titlebar=no,popup=yes', null);
               win.arguments = [null, 'Some title', 'Some message', false, ];

3. var message = 'Another pop-up blocked'; var nb = gBrowser.getNotificationBox(); var n = nb.getNotificationWithValue('popup-blocked'); if(n) {

   n.label = message;

} else {

   var buttons = [{
       label: 'Button',
       accessKey: 'B',
       popup: 'blockedPopupOptions',
       callback: null
   }];

Neither of them works on Windows. The first two work on Linux (Fedora 20 x64). Neither of them generates any error either.

Please, suggest how/where to do that, or how to 'schedule it' (as an even handler to a system event, I suppose) from my overlay of browser.xul.

Hi. I've got a custom Firefox add-on in plain Javascript. It to overlays Firefox's browser.xul (via chrome.manifest) by an XUL file, where I would like to show a non-modal popup (or some kind of non-intrusive notification). I've tried following three options from https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications: 1. Components.classes['@mozilla.org/alerts-service;1']. getService(Components.interfaces.nsIAlertsService). showAlertNotification(null, 'Some title', 'Some message', false, '', null); 2. var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1']. getService(Components.interfaces.nsIWindowWatcher). openWindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.arguments = [null, 'Some title', 'Some message', false, '']; 3. var message = 'Another pop-up blocked'; var nb = gBrowser.getNotificationBox(); var n = nb.getNotificationWithValue('popup-blocked'); if(n) { n.label = message; } else { var buttons = [{ label: 'Button', accessKey: 'B', popup: 'blockedPopupOptions', callback: null }]; Neither of them works on Windows. The first two work on Linux (Fedora 20 x64). Neither of them generates any error either. Please, suggest how/where to do that, or how to 'schedule it' (as an even handler to a system event, I suppose) from my overlay of browser.xul.

Krejt Përgjigjet (2)

more options

By Windows I mean Windows 7 Professional x64, Service Pack 1.

more options

I think you would have a better chance of getting comments from experienced add-on developers on one of these sites: