|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
chrome.contextMenus.onClicked.addListener(addToStammTV);
|
|
|
|
|
|
|
|
|
|
let WEBSOCKET_URL = "";
|
|
|
|
|
let websocket;
|
|
|
|
|
const CONTEXT_MENU_ID = "STAMMTV_ADD_URL_TO_PLAYLIST";
|
|
|
|
@ -5,7 +7,7 @@ const CONTEXT_MENU_ID = "STAMMTV_ADD_URL_TO_PLAYLIST";
|
|
|
|
|
chrome.storage.local.get('firstRun', function (result) {
|
|
|
|
|
if (result.firstRun === false) {
|
|
|
|
|
chrome.storage.local.set({'firstRun': false}, function (result) {
|
|
|
|
|
openSettings();
|
|
|
|
|
chrome.runtime.openOptionsPage();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
chrome.storage.local.get(['baseURL', 'wssURL'], function (items) {
|
|
|
|
@ -13,19 +15,12 @@ chrome.storage.local.get('firstRun', function (result) {
|
|
|
|
|
WEBSOCKET_URL = items.wssURL;
|
|
|
|
|
init();
|
|
|
|
|
} else {
|
|
|
|
|
openSettings();
|
|
|
|
|
chrome.runtime.openOptionsPage();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function openSettings() {
|
|
|
|
|
chrome.tabs.create({
|
|
|
|
|
active: true,
|
|
|
|
|
url: 'settings/settings.html'
|
|
|
|
|
}, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
chrome.contextMenus.removeAll(function() {
|
|
|
|
|
chrome.contextMenus.create({
|
|
|
|
@ -34,8 +29,6 @@ function init() {
|
|
|
|
|
id: CONTEXT_MENU_ID
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chrome.contextMenus.onClicked.addListener(addToStammTV);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseYoutubeURL(url) {
|
|
|
|
|