raymak / contextualfeaturerecommender

Mozilla Public License 2.0
4 stars 2 forks source link

tabs.open("[url to amo xpi file]") does not work on aurora and nightly #227

Closed raymak closed 8 years ago

raymak commented 8 years ago

alternatives: use AddonManager to install and addon directly (and silently) -> the user experience is bad a workaround:

exports.installAddonFromAmo = function(url){
function ready(tab){
let worker = tab.attach({
contentScript: 'document.querySelector("a.button.installer").click();'
});
worker.destroy();
tab.off("ready", ready);
}
require('sdk/tabs').open({
url: url,
inBackground: true,
onReady: ready
});
}