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