mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-29 22:00:56 +03:00
Get ID from storage API
This commit is contained in:
10
popup.js
10
popup.js
@@ -221,16 +221,18 @@ function runThePopup() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
}, loadTabData);
|
}, loadTabData);
|
||||||
|
|
||||||
|
function OnTabs(tabs) {
|
||||||
|
chrome.storage.sync.get(['videoid'], function(result) {
|
||||||
|
loadTabData(tabs, result.videoid);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function loadTabData(tabs) {
|
function loadTabData(tabs, currentVideoID) {
|
||||||
//set current videoID
|
|
||||||
currentVideoID = getYouTubeVideoID(tabs[0].url);
|
|
||||||
|
|
||||||
if (!currentVideoID) {
|
if (!currentVideoID) {
|
||||||
//this isn't a YouTube video then
|
//this isn't a YouTube video then
|
||||||
|
|||||||
Reference in New Issue
Block a user