Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

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.

모든 댓글 (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: