Я пытаюсь получить google chrome, чтобы открыть вкладку, которая содержит информацию о расширении при обнаружении моего расширения.Расширение Google Chrome javascript
Вот что я до сих пор, хотя, но не кажется, что это будет работать
chrome.runtime.onInstalled.addListener(function(details){
if(details.reason == "install"){
alert('This is the first run!');
chrome.extension.onRequest.addListener(function(request, sender) {
chrome.tabs.update(sender.tab.id, {url: request.redirect});
});
}else if(details.reason == "update"){
var thisVersion = chrome.runtime.getManifest().version;
alert('This is the update!');
}
});
Благодаря передовой!
/// /// РЕШЕНИЕ
не имеют достаточно высокую репутацию, чтобы разместить свой ответ так вот она ...
мне удалось решить проблему.
chrome.runtime.onInstalled.addListener(function(details){
if(details.reason == "install"){
alert('This is the first run!');
window.open("firstrun.html");
}else if(details.reason == "update"){
var thisVersion = chrome.runtime.getManifest().version;
alert('This is the update!');
}
});
Использование window.open("firstrun.html");
открывает новую вкладку в Google Chrome, когда ваше расширение устанавливается в первый раз.
Надеюсь, что это поможет другим!
ли работу оповещения? – Lee