📜  chrome 扩展检测更新 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:28.509000             🧑  作者: Mango

代码示例1
// Check whether new version is installed
chrome.runtime.onInstalled.addListener(function(details){
    if(details.reason == "install"){
        console.log("This is a first install!");
    }else if(details.reason == "update"){
        var thisVersion = chrome.runtime.getManifest().version;
        console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!");
    }
});