mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Added delayed startup after install.
This commit is contained in:
parent
6790952f86
commit
dfad1a5636
1 changed files with 16 additions and 14 deletions
|
@ -42,22 +42,24 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
|
|||
|
||||
//add help page on install
|
||||
chrome.runtime.onInstalled.addListener(function (object) {
|
||||
chrome.storage.sync.get(["userID", "shownInstallPage"], function(result) {
|
||||
const userID = result.userID;
|
||||
setTimeout(function() {
|
||||
chrome.storage.sync.get(["userID"], function(result) {
|
||||
const userID = result.userID;
|
||||
|
||||
// If there is no userID, then it is the first install.
|
||||
if (!userID){
|
||||
//open up the install page
|
||||
chrome.tabs.create({url: chrome.extension.getURL("/help/"+chrome.i18n.getMessage("helpPage"))});
|
||||
// If there is no userID, then it is the first install.
|
||||
if (!userID){
|
||||
//open up the install page
|
||||
chrome.tabs.create({url: chrome.extension.getURL("/help/index_en.html")});
|
||||
|
||||
//generate a userID
|
||||
const newUserID = generateUserID();
|
||||
//save this UUID
|
||||
chrome.storage.sync.set({
|
||||
"userID": newUserID
|
||||
});
|
||||
}
|
||||
});
|
||||
//generate a userID
|
||||
const newUserID = generateUserID();
|
||||
//save this UUID
|
||||
chrome.storage.sync.set({
|
||||
"userID": newUserID
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
//gets the sponsor times from memory
|
||||
|
|
Loading…
Reference in a new issue