2021-02-12 13:44:17 +01:00
|
|
|
var Port;
|
2021-02-28 13:22:00 +01:00
|
|
|
var FunCookie;
|
2021-02-12 13:44:17 +01:00
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
2021-02-28 13:22:00 +01:00
|
|
|
document.getElementById("btn_add_mass_funimation").hidden = true;
|
2021-02-12 13:44:17 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-02-20 18:25:49 +01:00
|
|
|
browser.storage.local.get("CRD_Port")
|
|
|
|
.then(gotPort, NoPort);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-02-20 18:25:49 +01:00
|
|
|
function getServerValue(request, sender, sendResponse) {
|
|
|
|
if (request.Server == "CRD 1.0") {
|
|
|
|
document.getElementById("CRD-Webserver").hidden = false;
|
|
|
|
document.getElementById("txtOutput").remove();
|
|
|
|
document.getElementById("txtInput").hidden = true;
|
|
|
|
document.getElementById("btn_set_port").hidden = true;
|
|
|
|
browser.tabs.query({
|
|
|
|
currentWindow: true,
|
|
|
|
active: true
|
|
|
|
}).then((tabs) => {
|
|
|
|
|
|
|
|
let tab = tabs[0]; // Safe to assume there will only be one resultconsole.log(tab.url);
|
|
|
|
console.log(tab.url);
|
|
|
|
if (tab.url.includes('crunchyroll.com')) {
|
|
|
|
var crunchyroll = browser.tabs.executeScript({
|
|
|
|
code: 'document.getElementsByClassName("episode")[0].href;'
|
|
|
|
});
|
|
|
|
|
|
|
|
crunchyroll.then(onExecuted, onError);
|
|
|
|
|
|
|
|
} else if (tab.url.includes('funimation.com')) {
|
|
|
|
|
|
|
|
var funimation = browser.tabs.executeScript({
|
|
|
|
|
|
|
|
code: 'document.getElementsByClassName("trackVideo")[0].href'
|
|
|
|
});
|
|
|
|
funimation.then(FunimationSuccess, FunimationError);
|
|
|
|
} else if (tab.url.includes('anime-on-demand.de/anime/')) {
|
|
|
|
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_add_AoD").hidden = true; //false if implemented
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
|
|
|
}
|
|
|
|
}, console.error)
|
|
|
|
} else {}
|
|
|
|
|
|
|
|
}
|
|
|
|
browser.runtime.onMessage.addListener(getServerValue);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-02-12 13:44:17 +01:00
|
|
|
function setItem() {
|
|
|
|
console.log("OK");
|
|
|
|
}
|
|
|
|
function notsetItem() {
|
|
|
|
console.log("Not OK");
|
|
|
|
}
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-02-12 13:44:17 +01:00
|
|
|
function gotPort(result) {
|
|
|
|
try {
|
|
|
|
onStartup(result.CRD_Port.value);
|
|
|
|
console.log("Port: " + result.CRD_Port.value)
|
|
|
|
} catch (e) {
|
|
|
|
onStartup(80);
|
|
|
|
console.log("no port")
|
|
|
|
}
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-02-12 13:44:17 +01:00
|
|
|
}
|
2021-01-16 14:08:33 +01:00
|
|
|
|
2021-02-12 13:44:17 +01:00
|
|
|
function NoPort(result) {
|
2021-02-20 18:25:49 +01:00
|
|
|
onStartup(80);
|
2021-02-12 13:44:17 +01:00
|
|
|
console.log("no port")
|
|
|
|
}
|
|
|
|
|
|
|
|
function onStartup(result) {
|
|
|
|
Port = result;
|
2021-02-20 18:25:49 +01:00
|
|
|
var ifrm = document.createElement("iframe");
|
|
|
|
ifrm.src = "http://127.0.0.1:" + Port;
|
|
|
|
ifrm.style = "border:0px solid black;";
|
|
|
|
ifrm.style.width = "760px";
|
|
|
|
ifrm.style.height = "320px";
|
|
|
|
ifrm.id = "CRD-Webserver";
|
|
|
|
ifrm.hidden = true;
|
|
|
|
document.body.appendChild(ifrm);
|
|
|
|
|
2021-02-12 13:44:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
document.getElementById('btn_set_port').addEventListener('click', () => {
|
2021-02-20 18:25:49 +01:00
|
|
|
let CRD_Port = {
|
|
|
|
value: document.getElementById('txtInput').value
|
|
|
|
}
|
2021-02-12 13:44:17 +01:00
|
|
|
|
2021-02-20 18:25:49 +01:00
|
|
|
browser.storage.local.set({
|
|
|
|
CRD_Port
|
|
|
|
})
|
|
|
|
.then(setItem, notsetItem);
|
2021-02-12 13:44:17 +01:00
|
|
|
|
2021-02-20 18:25:49 +01:00
|
|
|
window.close();
|
2021-02-12 13:44:17 +01:00
|
|
|
});
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2020-11-04 19:11:38 +01:00
|
|
|
document.getElementById('btn_add_AoD').addEventListener('click', () => {
|
2021-01-16 14:08:33 +01:00
|
|
|
//browser.cookies.getAllCookieStores().then((cookie) => {
|
|
|
|
// browser.cookies.getAll({
|
|
|
|
// name: "_aod_session"
|
|
|
|
// }).then((cookie) => {
|
|
|
|
//console.log(cookie)
|
|
|
|
|
|
|
|
//}, console.error)
|
|
|
|
|
|
|
|
var cookies = {};
|
|
|
|
|
|
|
|
cookies.all = url => new Promise(resolve => chrome.cookies.getAll({
|
|
|
|
url
|
|
|
|
}, resolve));
|
|
|
|
|
|
|
|
console.log(cookies)
|
2020-11-04 19:11:38 +01:00
|
|
|
});
|
|
|
|
|
2020-08-16 23:27:48 +02:00
|
|
|
document.getElementById('btn_enable_select').addEventListener('click', () => {
|
|
|
|
browser.tabs.executeScript({
|
2021-02-20 18:25:49 +01:00
|
|
|
code: 'var script=document.createElement("script");script.type="text/javascript",script.src="http://127.0.0.1:' + Port + '/inject.js",document.head.appendChild(script);'
|
2020-08-16 23:27:48 +02:00
|
|
|
}); //load script from local CRD Server included in https://github.com/hama3254/Crunchyroll-Downloader-v3.0
|
|
|
|
|
|
|
|
document.getElementById("btn_add_mass").hidden = false;
|
|
|
|
document.getElementById("btn_select_all").hidden = false;
|
|
|
|
document.getElementById("btn_select_none").hidden = false;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById('btn_select_all').addEventListener('click', () => {
|
|
|
|
browser.tabs.query({
|
|
|
|
currentWindow: true,
|
|
|
|
active: true
|
|
|
|
}).then((tabs) => {
|
|
|
|
|
|
|
|
let tab = tabs[0];
|
|
|
|
|
|
|
|
if (tab.url.includes('crunchyroll.com')) {
|
|
|
|
|
|
|
|
browser.tabs.executeScript({
|
|
|
|
code: 'var i,episodeCount=document.getElementsByClassName("episode").length;for(i=0;i<episodeCount;i++)document.getElementsByClassName("episode")[i].style.background="#f78c25",document.getElementsByClassName("episode")[i].classList.add("CRD-Selected");'
|
|
|
|
});
|
|
|
|
|
|
|
|
} else if (tab.url.includes('funimation.com')) {
|
|
|
|
|
|
|
|
browser.tabs.executeScript({
|
|
|
|
code: 'var i,episodeCount=document.getElementsByClassName("fullEpisodeThumbs").length;for(i=0;i<episodeCount;i++)document.getElementsByClassName("fullEpisodeThumbs")[i].style.background="#f78c25",document.getElementsByClassName("fullEpisodeThumbs")[i].classList.add("CRD-Selected");'
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {}
|
|
|
|
}, console.error)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById('btn_select_none').addEventListener('click', () => {
|
|
|
|
browser.tabs.query({
|
|
|
|
currentWindow: true,
|
|
|
|
active: true
|
|
|
|
}).then((tabs) => {
|
|
|
|
|
|
|
|
let tab = tabs[0];
|
|
|
|
if (tab.url.includes('crunchyroll.com')) {
|
|
|
|
|
|
|
|
browser.tabs.executeScript({
|
|
|
|
code: 'var i,episodeCount=document.getElementsByClassName("episode").length;for(i=0;i<episodeCount;i++)document.getElementsByClassName("episode")[i].style.background="#ffffff",document.getElementsByClassName("episode")[i].classList.remove("CRD-Selected");'
|
|
|
|
});
|
|
|
|
|
|
|
|
} else if (tab.url.includes('funimation.com')) {
|
|
|
|
|
|
|
|
browser.tabs.executeScript({
|
|
|
|
code: 'var i,episodeCount=document.getElementsByClassName("fullEpisodeThumbs").length;for(i=0;i<episodeCount;i++)document.getElementsByClassName("fullEpisodeThumbs")[i].style.background="#ffffff",document.getElementsByClassName("fullEpisodeThumbs")[i].classList.remove("CRD-Selected");'
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {}
|
|
|
|
}, console.error)
|
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById('btn_add').addEventListener('click', () => {
|
|
|
|
var add_one = browser.tabs.executeScript({
|
|
|
|
code: "document.getElementsByClassName('no-js')[0].innerHTML;"
|
|
|
|
});
|
|
|
|
add_one.then(add_one_ok, add_one_error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById('btn_add_funimation').addEventListener('click', () => {
|
2021-02-28 13:22:00 +01:00
|
|
|
|
2020-08-16 23:27:48 +02:00
|
|
|
var add_fun = browser.tabs.executeScript({
|
2021-02-28 13:22:00 +01:00
|
|
|
code: "document.cookie" //"document.getElementsByClassName('show-details')[0].innerHTML;"
|
2020-08-16 23:27:48 +02:00
|
|
|
});
|
|
|
|
add_fun.then(add_fun_ok, add_one_error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById('btn_add_mass').addEventListener('click', () => {
|
|
|
|
|
|
|
|
var add_mass = browser.tabs.executeScript({
|
|
|
|
code: 'var i,URLList="";for(i=0;i<document.getElementsByClassName("CRD-Selected").length;i++)URLList+=document.getElementsByClassName("CRD-Selected")[i].getAttribute("href");URLList;'
|
|
|
|
});
|
|
|
|
add_mass.then(add_mass_ok, add_mass_error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2021-02-28 13:22:00 +01:00
|
|
|
document.getElementById('btn_add_mass_funimation').addEventListener('click', () => {
|
|
|
|
|
|
|
|
var add_mass = browser.tabs.executeScript({
|
|
|
|
code: 'var i,URLList="";for(i=0;i<document.getElementsByClassName("CRD-Selected").length;i++)URLList+=document.getElementsByClassName("CRD-Selected")[i].getAttribute("href");URLList;'
|
|
|
|
});
|
|
|
|
add_mass.then(add_mass_fun_ok, add_mass_error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-08-16 23:27:48 +02:00
|
|
|
function onExecuted(result) {
|
|
|
|
console.log(result[0]);
|
|
|
|
|
|
|
|
if (result[0].includes('javascript:')) {
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = false;
|
|
|
|
document.getElementById("btn_select_all").hidden = false;
|
|
|
|
document.getElementById("btn_select_none").hidden = false;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
console.log(true);
|
|
|
|
} else {
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = false;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
console.log(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onError(error) {
|
|
|
|
console.log(`Error: ${error}`);
|
|
|
|
|
|
|
|
document.getElementById("btn_add").hidden = false;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
function add_fun_ok(result) {
|
|
|
|
browser.tabs.query({
|
|
|
|
currentWindow: true,
|
|
|
|
active: true
|
|
|
|
}).then((tabs) => {
|
|
|
|
let tab = tabs[0]; // Safe to assume there will only be one resultconsole.log(tab.url);
|
|
|
|
console.log(tab.url);
|
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_funimation").disabled = true;
|
|
|
|
document.getElementById("btn_add_funimation").style.background = "#c9c9c9"
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
var xhttp = new XMLHttpRequest();
|
2021-02-20 18:25:49 +01:00
|
|
|
xhttp.open("POST", "http://127.0.0.1:" + Port + "/post", true);
|
2021-01-16 14:08:33 +01:00
|
|
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
2021-02-28 13:22:00 +01:00
|
|
|
xhttp.send("FunimationURL=" + tab.url + "&FunimationCookie=" + result);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_funimation").style.background = "#ff8000"
|
|
|
|
}, 10000);
|
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_funimation").disabled = false;
|
|
|
|
}, 10000);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
}, console.error)
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_one_ok(result) {
|
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add").disabled = true;
|
|
|
|
document.getElementById("btn_add").style.background = "#c9c9c9"
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
var xhttp = new XMLHttpRequest();
|
2021-02-20 18:25:49 +01:00
|
|
|
xhttp.open("POST", "http://127.0.0.1:" + Port + "/post", true);
|
2021-01-16 14:08:33 +01:00
|
|
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
xhttp.send("HTMLSingle=" + result);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add").style.background = "#ff8000"
|
|
|
|
}, 10000);
|
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add").disabled = false;
|
|
|
|
}, 10000);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_one_error(error) {
|
|
|
|
console.log(`Error: ${error}`);
|
|
|
|
}
|
|
|
|
function add_mass_ok(result) {
|
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_mass").disabled = true;
|
|
|
|
document.getElementById("btn_add_mass").style.background = "#c9c9c9"
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
var xhttp = new XMLHttpRequest();
|
2021-02-20 18:25:49 +01:00
|
|
|
xhttp.open("POST", "http://127.0.0.1:" + Port + "/post", true);
|
2021-01-16 14:08:33 +01:00
|
|
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
xhttp.send("HTMLMass=" + result);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
2021-01-16 14:08:33 +01:00
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_mass").style.background = "#ff8000"
|
|
|
|
}, 10000);
|
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_mass").disabled = false;
|
|
|
|
}, 10000);
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-02-28 13:22:00 +01:00
|
|
|
function add_mass_fun_ok(result) {
|
|
|
|
|
|
|
|
document.getElementById("btn_add_mass_funimation").disabled = true;
|
|
|
|
document.getElementById("btn_add_mass_funimation").style.background = "#c9c9c9"
|
|
|
|
|
|
|
|
var postdata = result + "&FunimationCookie=" + FunCookie
|
|
|
|
|
|
|
|
var xhttp = new XMLHttpRequest();
|
|
|
|
xhttp.open("POST", "http://127.0.0.1:" + Port + "/post", true);
|
|
|
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
xhttp.send("FunimationMass=" + postdata);
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_mass_funimation").style.background = "#ff8000"
|
|
|
|
}, 10000);
|
|
|
|
setTimeout(function () {
|
|
|
|
document.getElementById("btn_add_mass_funimation").disabled = false;
|
|
|
|
}, 10000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-08-16 23:27:48 +02:00
|
|
|
function add_mass_error(error) {
|
|
|
|
console.log(`Error: ${error}`);
|
|
|
|
}
|
|
|
|
//funimation
|
|
|
|
|
|
|
|
document.getElementById('btn_enable_funimation_select').addEventListener('click', () => {
|
|
|
|
|
|
|
|
browser.tabs.executeScript({
|
2021-02-20 18:25:49 +01:00
|
|
|
code: 'var script=document.createElement("script");script.type="text/javascript",script.src="http://127.0.0.1:' + Port + '/inject_funimation.js",document.head.appendChild(script);'
|
2020-08-16 23:27:48 +02:00
|
|
|
}); //load script from local CRD Server included in https://github.com/hama3254/Crunchyroll-Downloader-v3.0
|
|
|
|
|
2021-02-28 13:22:00 +01:00
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass_funimation").hidden = false;
|
2020-08-16 23:27:48 +02:00
|
|
|
document.getElementById("btn_select_all").hidden = false;
|
|
|
|
document.getElementById("btn_select_none").hidden = false;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2021-02-28 13:22:00 +01:00
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2021-02-28 13:22:00 +01:00
|
|
|
function fun_cookie_ok(result) {
|
|
|
|
|
|
|
|
FunCookie = result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-08-16 23:27:48 +02:00
|
|
|
function FunimationSuccess(result) {
|
|
|
|
console.log(result[0]);
|
|
|
|
|
|
|
|
if (result[0].includes('javascript:')) {
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
2021-02-28 13:22:00 +01:00
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass_funimation").hidden = false;
|
2020-08-16 23:27:48 +02:00
|
|
|
document.getElementById("btn_select_all").hidden = false;
|
|
|
|
document.getElementById("btn_select_none").hidden = false;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2021-02-28 13:22:00 +01:00
|
|
|
var SaveFunimationCookie = browser.tabs.executeScript({
|
|
|
|
code: "document.cookie"
|
|
|
|
});
|
|
|
|
SaveFunimationCookie.then(fun_cookie_ok, add_mass_error);
|
2020-08-16 23:27:48 +02:00
|
|
|
console.log(true);
|
|
|
|
} else {
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = false;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2021-02-28 13:22:00 +01:00
|
|
|
var SaveFunimationCookie = browser.tabs.executeScript({
|
|
|
|
code: "document.cookie"
|
|
|
|
});
|
|
|
|
SaveFunimationCookie.then(fun_cookie_ok, add_mass_error);
|
2020-08-16 23:27:48 +02:00
|
|
|
console.log(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function FunimationError(error) {
|
|
|
|
console.log(`Error: ${error}`);
|
|
|
|
|
|
|
|
document.getElementById("btn_add").hidden = true;
|
|
|
|
document.getElementById("btn_add_mass").hidden = true;
|
|
|
|
document.getElementById("btn_select_all").hidden = true;
|
|
|
|
document.getElementById("btn_select_none").hidden = true;
|
|
|
|
document.getElementById("btn_enable_select").hidden = true;
|
|
|
|
document.getElementById("btn_add_funimation").hidden = false;
|
|
|
|
document.getElementById("btn_enable_funimation_select").hidden = true;
|
2021-01-16 14:08:33 +01:00
|
|
|
document.getElementById("btn_add_AoD").hidden = true;
|
2020-08-16 23:27:48 +02:00
|
|
|
|
|
|
|
}
|