mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Added delayed startup after install.
This commit is contained in:
@@ -42,13 +42,14 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
|
|||||||
|
|
||||||
//add help page on install
|
//add help page on install
|
||||||
chrome.runtime.onInstalled.addListener(function (object) {
|
chrome.runtime.onInstalled.addListener(function (object) {
|
||||||
chrome.storage.sync.get(["userID", "shownInstallPage"], function(result) {
|
setTimeout(function() {
|
||||||
|
chrome.storage.sync.get(["userID"], function(result) {
|
||||||
const userID = result.userID;
|
const userID = result.userID;
|
||||||
|
|
||||||
// If there is no userID, then it is the first install.
|
// If there is no userID, then it is the first install.
|
||||||
if (!userID){
|
if (!userID){
|
||||||
//open up the install page
|
//open up the install page
|
||||||
chrome.tabs.create({url: chrome.extension.getURL("/help/"+chrome.i18n.getMessage("helpPage"))});
|
chrome.tabs.create({url: chrome.extension.getURL("/help/index_en.html")});
|
||||||
|
|
||||||
//generate a userID
|
//generate a userID
|
||||||
const newUserID = generateUserID();
|
const newUserID = generateUserID();
|
||||||
@@ -58,6 +59,7 @@ chrome.runtime.onInstalled.addListener(function (object) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}, 1500);
|
||||||
});
|
});
|
||||||
|
|
||||||
//gets the sponsor times from memory
|
//gets the sponsor times from memory
|
||||||
|
|||||||
Reference in New Issue
Block a user