Basic extension setup and basic downlading capability

This commit is contained in:
Leonetienne
2021-03-13 16:24:16 +01:00
parent 2914c3762b
commit 43a779f6ec
9 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
function Queue(info) {
// Select either the current page location, or the target of a href (if the user clicked on one)
urlToDownload = typeof(info.linkUrl) != 'undefined' ? info.linkUrl : info.pageUrl;
axios.post("http://tub.io/api", {
request: "queue_download",
video_url: urlToDownload,
mode: "video",
quality: "best"
}).then(function(response){
console.log("Queued successfully...");
}).catch(function(response){
console.log("Something went wrong...");
console.log(response);
});
}
chrome.contextMenus.create({
"title" : "Queue in Tubio",
"contexts": ["all"],
"type" : "normal",
"onclick" : Queue
});