Confirmed users
514
edits
| Line 11: | Line 11: | ||
If the Helper is installed hitting '''Test''' add-on should be simply installed | If the Helper is installed hitting '''Test''' add-on should be simply installed | ||
if (window.mozFlightDeck) { | |||
FD->createAndDownloadXPI // using currently displayed content | |||
window.mozFlightDeck.send({cmd:"install",contents: downloadedXPI} | |||
FD->displayNotification | |||
} | |||
Else display the warning with ability to install the Helper. Listen for the event fired after its installation and try to install add-on again. The listening for the event should be cancelled after some time or after certain action. | Else display the warning with ability to install the Helper. Listen for the event fired after its installation and try to install add-on again. The listening for the event should be cancelled after some time or after certain action. | ||
if (!window.mozFlightDeck) { | |||
FD->displayWarning | |||
// listen for the event | |||
$(document.body).addEvent('addonbuilderhelperstart', function() { | |||
FD->displayNotification | |||
FD->installAddOn | |||
}); | |||
// stop listening after some time | |||
(function() { | |||
$(document.body).removeEvents('addonbuilderhelperstart'); | |||
}).delay(someTime); | |||
} | |||
If browser's version is < 4.0 event will not be fired, but user has to restart the browser. Warning should be displayed that user will loose all unsaved data. '''Check if there it will be possible to display the warning on restarting or if it should be displayed before installing the Helper'''. | If browser's version is < 4.0 event will not be fired, but user has to restart the browser. Warning should be displayed that user will loose all unsaved data. '''Check if there it will be possible to display the warning on restarting or if it should be displayed before installing the Helper'''. | ||