// ==UserScript== // @name MAL-Sync // @namespace https://greasyfork.org/users/92233 // @description Integrates MyAnimeList into various sites, with auto episode tracking. // @version 0.3.6 // @author lolamtisch@gmail.com // @license GPL-3.0 // @iconURL https://raw.githubusercontent.com/lolamtisch/MALSync/master/assets/icons/icon128.png // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_listValues // @grant GM_addStyle // @grant GM_getResourceText // @grant GM.xmlHttpRequest // @grant GM.getValue // @grant GM.setValue // @noframes // @match *://myanimelist.net/anime/* // @match *://myanimelist.net/manga/* // @match *://myanimelist.net/animelist/* // @match *://myanimelist.net/mangalist/* // @match *://myanimelist.net/anime.php?id=* // @match *://myanimelist.net/manga.php?id=* // @match *://myanimelist.net/character/* // @match *://myanimelist.net/people/* // @match *://myanimelist.net/search/* // @match *://kissanime.ru/Anime/* // @match *://kissanime.to/Anime/* // @match *://kissmanga.com/Manga/* // @match *://*.9anime.to/watch/* // @match *://*.9anime.is/watch/* // @match *://*.9anime.ru/watch/* // @match *://*.9anime.ch/watch/* // @match *://*.crunchyroll.com/* // @match *://www.masterani.me/anime/info/* // @match *://www.masterani.me/anime/watch/* // @match *://*.mangadex.org/manga/* // @match *://*.mangadex.org/title/* // @match *://*.mangadex.org/chapter/* // @match *://mangarock.com/* // @match *://*.gogoanime.tv/* // @match *://*.gogoanime.io/* // @match *://*.gogoanime.in/* // @match *://*.gogoanime.se/* // @match *://*.gogoanime.sh/* // @match *://*.gogoanimes.co/* // @match *://*.anime4you.one/show/1/aid/* // @match *://branitube.org/assistir/* // @match *://branitube.org/animes/* // @match *://*.www.turkanime.tv/video/* // @match *://*.www.turkanime.tv/anime/* // @match *://twist.moe/* // @exclude *crunchyroll.com/ // @exclude *crunchyroll.com // @exclude *crunchyroll.com/acct* // @exclude *crunchyroll.com/anime* // @exclude *crunchyroll.com/comics* // @exclude *crunchyroll.com/edit* // @exclude *crunchyroll.com/email* // @exclude *crunchyroll.com/forum* // @exclude *crunchyroll.com/home* // @exclude *crunchyroll.com/inbox* // @exclude *crunchyroll.com/library* // @exclude *crunchyroll.com/login* // @exclude *crunchyroll.com/manga* // @exclude *crunchyroll.com/newprivate* // @exclude *crunchyroll.com/news* // @exclude *crunchyroll.com/notifications* // @exclude *crunchyroll.com/order* // @exclude *crunchyroll.com/outbox* // @exclude *crunchyroll.com/pm* // @exclude *crunchyroll.com/search* // @exclude *crunchyroll.com/store* // @exclude *crunchyroll.com/user* // @exclude *crunchyroll.com/videos* // @exclude *crunchyroll.com/affiliate_iframeplayer* // @exclude *gogoanime*.*/ // @exclude *gogoanime*.*/*.html // @exclude *gogoanime*.*/anime-List* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @resource material.css https://code.getmdl.io/1.3.0/material.indigo-pink.min.css // @resource materialFont.css https://fonts.googleapis.com/icon?family=Material+Icons // @resource material.js https://code.getmdl.io/1.3.0/material.min.js // @resource simpleBar.css https://unpkg.com/simplebar@3.0.0-beta.4/dist/simplebar.css // @resource simpleBar.js https://unpkg.com/simplebar@3.0.0-beta.4/dist/simplebar.js // @run-at document_start // @connect myanimelist.net // @connect kissanimelist.firebaseio.com // @connect * // @downloadURL none // ==/UserScript== /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 28); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./src/api/storage/userscriptLegacy.ts var userscriptLegacy = __webpack_require__(7); // CONCATENATED MODULE: ./src/api/request/requestUserscriptLegacy.ts var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const requestUserscriptLegacy = { xhr(method, url) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { var request = { method: method, url: url, synchronous: false, headers: [], data: null, onload: function (response) { console.log(response); var responseObj = { finalUrl: response.finalUrl, responseText: response.responseText, status: response.status }; resolve(responseObj); } }; if (typeof url === 'object') { request.url = url.url; request.headers = url.headers; request.data = url.data; } GM_xmlhttpRequest(request); }); }); }, }; // EXTERNAL MODULE: ./src/api/settings.ts var settings = __webpack_require__(8); // CONCATENATED MODULE: ./src/api/userscript.ts /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "storage", function() { return storage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "request", function() { return request; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return userscript_settings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "type", function() { return type; }); var storage = userscriptLegacy["a" /* userscriptLegacy */]; var request = requestUserscriptLegacy; var userscript_settings = settings["a" /* settingsObj */]; var type = 'userscript'; /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$", function() { return $; }); var $ = jQuery; /***/ }), /* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(api, j, con, utils) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlPart", function() { return urlPart; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlParam", function() { return urlParam; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "favicon", function() { return favicon; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "watching", function() { return watching; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "planTo", function() { return planTo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "episode", function() { return episode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "syncRegex", function() { return syncRegex; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "status", function() { return status; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getselect", function() { return getselect; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "absoluteLink", function() { return absoluteLink; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlChangeDetect", function() { return urlChangeDetect; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilTrue", function() { return waitUntilTrue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUrlFromTags", function() { return getUrlFromTags; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setUrlInTags", function() { return setUrlInTags; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setResumeWaching", function() { return setResumeWaching; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getResumeWaching", function() { return getResumeWaching; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setContinueWaching", function() { return setContinueWaching; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getContinueWaching", function() { return getContinueWaching; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleMalImages", function() { return handleMalImages; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMalToKissArray", function() { return getMalToKissArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTooltip", function() { return getTooltip; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epPredictionUI", function() { return epPredictionUI; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canHideTabs", function() { return canHideTabs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epPrediction", function() { return epPrediction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "statusTag", function() { return statusTag; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notifications", function() { return notifications; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUserList", function() { return getUserList; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMalUserName", function() { return getMalUserName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flashm", function() { return flashm; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flashConfirm", function() { return flashConfirm; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazyload", function() { return lazyload; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementInViewport", function() { return elementInViewport; }); var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function urlPart(url, part) { try { return url.split("/")[part].split("?")[0]; } catch (e) { return undefined; } } function urlParam(url, name) { var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(url); if (results == null) { return null; } else { return decodeURI(results[1]) || 0; } } function favicon(domain) { if (domain.indexOf('animeheaven') !== -1) return 'http://animeheaven.eu/favicon.ico'; return 'https://www.google.com/s2/favicons?domain=' + domain; } function watching(type) { if (type == "manga") return 'Reading'; return 'Watching'; } function planTo(type) { if (type == "manga") return 'Plan to Read'; return 'Plan to Watch'; } function episode(type) { if (type == "manga") return 'Chapter'; return 'Episode'; } var syncRegex = /(^settings\/.*|^resume\/.*|^continue\/.*|^.*\/Offset$|^updateCheckTime$|^tempVersion$)/; var status; (function (status) { status[status["watching"] = 1] = "watching"; status[status["completed"] = 2] = "completed"; status[status["onhold"] = 3] = "onhold"; status[status["dropped"] = 4] = "dropped"; status[status["planToWatch"] = 6] = "planToWatch"; })(status || (status = {})); function getselect(data, name) { var temp = data.split('name="' + name + '"')[1].split('')[0]; if (temp.indexOf('selected="selected"') > -1) { temp = temp.split(' -1) { return temp[i].split('value="')[1].split('"')[0]; } } } else { return ''; } } function absoluteLink(url, domain) { if (typeof url === "undefined") { return url; } if (!url.startsWith("http")) { if (url.charAt(0) !== '/') url = '/' + url; url = domain + url; } return url; } ; function urlChangeDetect(callback) { var currentPage = window.location.href; return setInterval(function () { if (currentPage != window.location.href) { currentPage = window.location.href; callback(); } }, 1000); } function waitUntilTrue(condition, callback) { var Interval = null; Interval = setInterval(function () { if (condition()) { clearInterval(Interval); callback(); } }, 1000); return Interval; } function getUrlFromTags(tags) { if (!api.settings.get('malTags')) return undefined; if (/malSync::[\d\D]+::/.test(tags)) { return atobURL(tags.split("malSync::")[1].split("::")[0]); } if (/last::[\d\D]+::/.test(tags)) { return atobURL(tags.split("last::")[1].split("::")[0]); } return undefined; function atobURL(encoded) { try { return atob(encoded); } catch (e) { return encoded; } } } function setUrlInTags(url, tags) { if (!api.settings.get('malTags')) return tags; var addition = "malSync::" + btoa(url) + "::"; if (/(last|malSync)::[\d\D]+::/.test(tags)) { tags = tags.replace(/(last|malSync)::[^\^]*?::/, addition); } else { tags = tags + ',' + addition; } return tags; } function setResumeWaching(url, ep, type, id) { return __awaiter(this, void 0, void 0, function* () { return api.storage.set('resume/' + type + '/' + id, { url: url, ep: ep }); }); } function getResumeWaching(type, id) { return __awaiter(this, void 0, void 0, function* () { //@ts-ignore if (!api.settings.get('malResume')) return undefined; return api.storage.get('resume/' + type + '/' + id); }); } function setContinueWaching(url, ep, type, id) { return __awaiter(this, void 0, void 0, function* () { return api.storage.set('continue/' + type + '/' + id, { url: url, ep: ep }); }); } function getContinueWaching(type, id) { return __awaiter(this, void 0, void 0, function* () { return api.storage.get('continue/' + type + '/' + id); }); } function handleMalImages(url) { if (url.indexOf('questionmark') !== -1) return api.storage.assetUrl('questionmark.gif'); return url; } function getMalToKissArray(type, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { var url = 'https://kissanimelist.firebaseio.com/Data2/Mal' + type + '/' + id + '/Sites.json'; api.request.xhr('GET', url).then((response) => __awaiter(this, void 0, void 0, function* () { var json = j.$.parseJSON(response.responseText); for (var pageKey in json) { var page = json[pageKey]; if (!api.settings.get(pageKey)) { con.log(pageKey + ' is deactivated'); delete json[pageKey]; continue; } for (var streamKey in page) { var stream = page[streamKey]; var streamUrl = 'https://kissanimelist.firebaseio.com/Data2/' + stream + '/' + encodeURIComponent(streamKey) + '.json'; var cache = yield api.storage.get('MalToKiss/' + stream + '/' + encodeURIComponent(streamKey), null); if (typeof (cache) != "undefined") { var streamJson = cache; } else { var streamRespose = yield api.request.xhr('GET', streamUrl); var streamJson = j.$.parseJSON(streamRespose.responseText); api.storage.set('MalToKiss/' + stream + '/' + encodeURIComponent(streamKey), streamJson); } if (pageKey == 'Crunchyroll') { streamJson['url'] = streamJson['url'] + '?season=' + streamKey; } json[pageKey][streamKey] = streamJson; } } con.log('Mal2Kiss', json); resolve(json); })); }); }); } function getTooltip(text, style = '', direction = 'top') { var rNumber = Math.floor((Math.random() * 1000) + 1); return '
contact_support
\
' + text + '
'; } function epPredictionUI(malid, type = 'anime', callback) { return __awaiter(this, void 0, void 0, function* () { utils.epPrediction(malid, function (pre) { return __awaiter(this, void 0, void 0, function* () { var updateCheckTime = yield api.storage.get("updateCheckTime"); var elCache = undefined; if (typeof updateCheckTime != 'undefined' && updateCheckTime && updateCheckTime != '0') { elCache = yield api.storage.get('updateCheck/' + type + '/' + malid); } if (pre === false && typeof elCache == 'undefined') return; var UI = { tag: '', text: '', color: '', colorStyle: '', tagEpisode: false, prediction: pre, elCache: elCache }; // var airing = pre.airing; var episode = pre.episode; if (typeof elCache != 'undefined' && typeof elCache.error == 'undefined') { if (!elCache.finished) { airing = true; } if (elCache.newestEp && elCache.newestEp != '' && typeof elCache.newestEp != 'undefined') { episode = elCache.newestEp; UI.color = 'red'; } } if (UI.color != '') { //UI.colorStyle = 'text-decoration: underline overline !important; text-decoration-color: '+UI.color+' !important;' UI.colorStyle = 'background-color: #00ff0057 !important;'; } // if (airing) { if (pre.airing) { UI.text = 'Next episode estimated in ' + pre.diffDays + 'd ' + pre.diffHours + 'h ' + pre.diffMinutes + 'm'; } if (episode) { UI.tag = '[' + episode + ']'; UI.tagEpisode = episode; } } else { if (pre) { UI.text = 'Airing in ' + ((pre.diffWeeks * 7) + pre.diffDays) + 'd ' + pre.diffHours + 'h ' + pre.diffMinutes + 'm '; } } callback(UI); }); }); }); } function canHideTabs() { if (typeof browser != 'undefined' && typeof browser.tabs.hide != 'undefined') { return true; } return false; } function epPrediction(malId, callback) { return __awaiter(this, void 0, void 0, function* () { if (!api.settings.get('epPredictions')) return; var timestamp = yield api.storage.get('mal/' + malId + '/release'); if (typeof (timestamp) != "undefined") { var airing = 1; var episode = 0; if (Date.now() < timestamp) airing = 0; if (airing) { var delta = Math.abs(Date.now() - timestamp) / 1000; } else { var delta = Math.abs(timestamp - Date.now()) / 1000; } var diffWeeks = Math.floor(delta / (86400 * 7)); delta -= diffWeeks * (86400 * 7); if (airing) { //We need the time until the week is complete delta = (86400 * 7) - delta; } var diffDays = Math.floor(delta / 86400); delta -= diffDays * 86400; var diffHours = Math.floor(delta / 3600) % 24; delta -= diffHours * 3600; var diffMinutes = Math.floor(delta / 60) % 60; delta -= diffMinutes * 60; if (airing) { episode = diffWeeks - (new Date().getFullYear() - new Date(timestamp).getFullYear()); //Remove 1 week between years episode++; if (episode > 50) { episode = 0; } } var maxEp = yield api.storage.get('mal/' + malId + '/release'); if (typeof (maxEp) === "undefined" || episode < maxEp) { callback({ timestamp: timestamp, airing: airing, diffWeeks: diffWeeks, diffDays: diffDays, diffHours: diffHours, diffMinutes: diffMinutes, episode: episode }); return; } } callback(false); }); } function statusTag(status, type, id) { var info = { anime: { 1: { class: 'watching', text: 'CW', title: 'Watching' }, 2: { class: 'completed', text: 'CMPL', title: 'Completed' }, 3: { class: 'on-hold', text: ' HOLD', title: 'On-Hold' }, 4: { class: 'dropped', text: 'DROP', title: 'Dropped' }, 6: { class: 'plantowatch', text: 'PTW', title: 'Plan to Watch' } }, manga: { 1: { class: 'reading', text: 'CR', title: 'Reading' }, 2: { class: 'completed', text: 'CMPL', title: 'Completed' }, 3: { class: 'on-hold', text: ' HOLD', title: 'On-Hold' }, 4: { class: 'dropped', text: 'DROP', title: 'Dropped' }, 6: { class: 'plantoread', text: 'PTR', title: 'Plan to Read' } } }; $.each([1, 2, 3, 4, 6], function (i, el) { info.anime[info.anime[el].title] = info.anime[el]; info.manga[info.manga[el].title] = info.manga[el]; }); if (status) { var tempInfo = info[type][status]; return ` ${tempInfo.text}`; } return false; } function notifications(url, title, message, iconUrl = '') { var messageObj = { type: 'basic', title: title, message: message, iconUrl: iconUrl, }; con.log('Notification', url, messageObj); try { return chrome.notifications.create(url, messageObj); } catch (e) { con.error(e); } } //Status: 1 = watching | 2 = completed | 3 = onhold | 4 = dropped | 6 = plan to watch | 7 = all function getUserList(status = 1, localListType = 'anime', singleCallback = null, finishCallback = null, fullListCallback = null, continueCall = null, username = null, offset = 0, templist = []) { con.log('[UserList]', 'username: ' + username, 'status: ' + status, 'offset: ' + offset); if (username == null) { getMalUserName(function (usernameTemp) { if (usernameTemp == false) { flashm("Please log in on MyAnimeList!"); // @ts-ignore if (fullListCallback) fullListCallback([]); // @ts-ignore if (finishCallback) finishCallback(); } else { getUserList(status, localListType, singleCallback, finishCallback, fullListCallback, continueCall, usernameTemp, offset, templist); } }); return; } var url = 'https://myanimelist.net/' + localListType + 'list/' + username + '/load.json?offset=' + offset + '&status=' + status; api.request.xhr('GET', url).then((response) => { var data = JSON.parse(response.responseText); if (singleCallback) { // @ts-ignore if (!data.length) singleCallback(false, 0, 0); for (var i = 0; i < data.length; i++) { // @ts-ignore singleCallback(data[i], i + offset + 1, data.length + offset); } } if (fullListCallback) { templist = templist.concat(data); } if (data.length > 299) { if (continueCall) { // @ts-ignore continueCall(function () { getUserList(status, localListType, singleCallback, finishCallback, fullListCallback, continueCall, username, offset + 300, templist); }); } else { getUserList(status, localListType, singleCallback, finishCallback, fullListCallback, continueCall, username, offset + 300, templist); } } else { // @ts-ignore if (fullListCallback) fullListCallback(templist); // @ts-ignore if (finishCallback) finishCallback(); } }); } function getMalUserName(callback) { var url = 'https://myanimelist.net/editlist.php?hideLayout'; api.request.xhr('GET', url).then((response) => { var username = false; try { username = response.responseText.split('USER_NAME = "')[1].split('"')[0]; } catch (e) { } con.log('[Username]', username); callback(username); }); } //flashm function flashm(text, options) { if (!j.$('#flash-div-top').length) { initflashm(); } con.log("[Flash] Message:", text); var colorF = "#323232"; if (typeof options !== 'undefined' && typeof options.error !== 'undefined' && options.error) { var colorF = "#3e0808"; } var flashdiv = '#flash-div-bottom'; if (typeof options !== 'undefined' && typeof options.position !== 'undefined' && options.position) { flashdiv = '#flash-div-' + options.position; } var messClass = "flash"; if (typeof options !== 'undefined' && typeof options.type !== 'undefined' && options.type) { var tempClass = "type-" + options.type; j.$(flashdiv + ' .' + tempClass + ', #flashinfo-div .' + tempClass) .removeClass(tempClass) .fadeOut({ duration: 1000, queue: false, complete: function () { j.$(this).remove(); } }); messClass += " " + tempClass; } var mess = ''; if (typeof options !== 'undefined' && typeof options.hoverInfo !== 'undefined' && options.hoverInfo) { messClass += " flashinfo"; mess = ''; j.$('#flashinfo-div').addClass('hover'); var flashm = j.$(mess).appendTo('#flashinfo-div'); } else { var flashm = j.$(mess).appendTo(flashdiv); } if (typeof options !== 'undefined' && typeof options.permanent !== 'undefined' && options.permanent) { flashm.slideDown(800); } else if (typeof options !== 'undefined' && typeof options.hoverInfo !== 'undefined' && options.hoverInfo) { flashm.slideDown(800).delay(4000).queue(function () { j.$('#flashinfo-div').removeClass('hover'); flashm.css('max-height', '8px'); }); } else { flashm.slideDown(800).delay(4000).slideUp(800, () => { // @ts-ignore j.$(this).remove(); }); } return flashm; } function flashConfirm(message, type, yesCall = () => { }, cancelCall = () => { }) { return __awaiter(this, void 0, void 0, function* () { return new Promise(function (resolve, reject) { message = '
' + message + '
'; var flasmessage = flashm(message, { permanent: true, position: "top", type: type }); flasmessage.find('.Yes').click(function (evt) { j.$(evt.target).parentsUntil('.flash').remove(); resolve(true); yesCall(); }); flasmessage.find('.Cancel').click(function (evt) { j.$(evt.target).parentsUntil('.flash').remove(); resolve(false); cancelCall(); }); }); }); } function initflashm() { api.storage.addStyle('.flashinfo{\ transition: max-height 2s;\ }\ .flashinfo:hover{\ max-height:5000px !important;\ z-index: 2147483647;\ }\ .flashinfo .synopsis{\ transition: max-height 2s, max-width 2s ease 2s;\ }\ .flashinfo:hover .synopsis{\ max-height:9999px !important;\ max-width: 500px !important;\ transition: max-height 2s;\ }\ #flashinfo-div{\ z-index: 2;\ transition: 2s;\ }\ #flashinfo-div:hover, #flashinfo-div.hover{\ z-index: 2147483647;\ }\ \ #flash-div-top, #flash-div-bottom, #flashinfo-div{\ font-family: "Helvetica","Arial",sans-serif;\ color: white;\ font-size: 14px;\ font-weight: 400;\ line-height: 17px;\ }\ #flash-div-top h2, #flash-div-bottom h2, #flashinfo-div h2{\ font-family: "Helvetica","Arial",sans-serif;\ color: white;\ font-size: 14px;\ font-weight: 700;\ line-height: 17px;\ padding: 0;\ margin: 0;\ }\ #flash-div-top a, #flash-div-bottom a, #flashinfo-div a{\ color: #DF6300;\ }'); j.$('body').after('
\
\
'); } var lazyloaded = false; var lazyimages = new Array(); function lazyload(doc, scrollElement = '.simplebar-scroll-content') { /* lazyload.js (c) Lorenzo Giuliani * MIT License (http://www.opensource.org/licenses/mit-license.html) * * expects a list of: * `` */ processScroll = function () { for (var i = 0; i < lazyimages.length; i++) { if (elementInViewport(lazyimages[i])) { loadImage(lazyimages[i], function () { lazyimages.splice(i, i); }); } if (!$(lazyimages[i]).length) { lazyimages.splice(i, i); } } ; }; function loadImage(el, fn) { if (!j.$(el).is(':visible')) return false; if (j.$(el).hasClass('lazyBack')) { j.$(el).css('background-image', 'url(' + el.getAttribute('data-src') + ')').removeClass('lazyBack'); } else { var img = new Image(), src = el.getAttribute('data-src'); img.onload = function () { if (!!el.parent) el.parent.replaceChild(img, el); else el.src = src; fn ? fn() : null; }; img.src = src; } } for (var i = 0; i < lazyimages.length; i++) { $(lazyimages[i]).addClass('init'); } ; lazyimages = new Array(); var query = doc.find('img.lazy.init, .lazyBack.init'), processScroll = function () { for (var i = 0; i < lazyimages.length; i++) { if (utils.elementInViewport(lazyimages[i], 600)) { loadImage(lazyimages[i], function () { lazyimages.splice(i, i); }); } } ; }; // Array.prototype.slice.call is not callable under our lovely IE8 for (var i = 0; i < query.length; i++) { lazyimages.push(query[i]); $(query[i]).removeClass('init'); } ; processScroll(); if (!lazyloaded) { lazyloaded = true; doc.find(scrollElement).scroll(function () { processScroll(); }); } } function elementInViewport(el, horizontalOffset = 0) { var rect = el.getBoundingClientRect(); return (rect.top >= 0 && rect.left >= 0 // @ts-ignore && (rect.top - horizontalOffset) <= (window.innerHeight || document.documentElement.clientHeight)); } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(1), __webpack_require__(3), __webpack_require__(2))) /***/ }), /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "error", function() { return error; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "info", function() { return info; }); var log = function () { return Function.prototype.bind.call(console.log, console, "%cMAL-Sync", "background-color: #2e51a2; color: white; padding: 2px 10px; border-radius: 3px;"); }(); var error = function () { return Function.prototype.bind.call(console.error, console, "%cMAL-Sync", "background-color: #8f0000; color: white; padding: 2px 10px; border-radius: 3px;"); }(); var info = function () { return Function.prototype.bind.call(console.info, console, "%cMAL-Sync", "background-color: wheat; color: black; padding: 2px 10px; border-radius: 3px;"); }(); /***/ }), /* 4 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 5 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(utils, con, api, j) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return mal; }); var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; class mal { constructor(url, miniMAL = false) { this.url = url; this.miniMAL = miniMAL; this.name = ""; this.totalEp = NaN; this.addAnime = false; this.login = false; this.wrong = false; this.id = utils.urlPart(url, 4); this.type = utils.urlPart(url, 3); } init() { return this.update(); } ; update() { var editUrl = 'https://myanimelist.net/ownlist/' + this.type + '/' + this.id + '/edit?hideLayout'; con.log('Update MAL info', editUrl); return api.request.xhr('GET', editUrl).then((response) => { if (response.finalUrl.indexOf("myanimelist.net/login.php") > -1 || response.responseText.indexOf("Unauthorized") > -1) { this.login = false; con.error("User not logged in"); return; } this.login = true; this.animeInfo = this.getObject(response.responseText); }); } getEpisode() { if (this.type == "manga") { return this.animeInfo[".add_manga[num_read_chapters]"]; } return this.animeInfo[".add_anime[num_watched_episodes]"]; } setEpisode(ep) { if (ep + '' === '') ep = 0; if (this.type == "manga") { this.animeInfo[".add_manga[num_read_chapters]"] = parseInt(ep + ''); } this.animeInfo[".add_anime[num_watched_episodes]"] = parseInt(ep + ''); } getVolume() { if (this.type == "manga") { return this.animeInfo[".add_manga[num_read_volumes]"]; } return false; } setVolume(ep) { if (this.type == "manga") { this.animeInfo[".add_manga[num_read_volumes]"] = ep; return; } con.error('You cant set Volumes for animes'); } getStatus() { if (this.type == "manga") { return this.animeInfo[".add_manga[status]"]; } return this.animeInfo[".add_anime[status]"]; } setStatus(status) { if (this.type == "manga") { this.animeInfo[".add_manga[status]"] = status; } this.animeInfo[".add_anime[status]"] = status; } getScore() { if (this.type == "manga") { return this.animeInfo[".add_manga[score]"]; } return this.animeInfo[".add_anime[score]"]; } setScore(score) { if (this.type == "manga") { this.animeInfo[".add_manga[score]"] = score; } this.animeInfo[".add_anime[score]"] = score; } setCompletionDateToNow() { var Datec = new Date(); if (this.animeInfo['.add_anime[finish_date][day]'] === '' || this.animeInfo['.add_manga[finish_date][day]'] === '') { if (this.type == "manga") { this.animeInfo['.add_manga[finish_date][year]'] = Datec.getFullYear(); this.animeInfo['.add_manga[finish_date][month]'] = Datec.getMonth() + 1; this.animeInfo['.add_manga[finish_date][day]'] = Datec.getDate(); } this.animeInfo['.add_anime[finish_date][year]'] = Datec.getFullYear(); this.animeInfo['.add_anime[finish_date][month]'] = Datec.getMonth() + 1; this.animeInfo['.add_anime[finish_date][day]'] = Datec.getDate(); } else { con.error('Completion date already set'); } } setStartingDateToNow() { var Datec = new Date(); if (this.animeInfo['.add_anime[start_date][day]'] === '' || this.animeInfo['.add_manga[start_date][day]'] === '') { if (this.type == "manga") { this.animeInfo['.add_manga[start_date][year]'] = Datec.getFullYear(); this.animeInfo['.add_manga[start_date][month]'] = Datec.getMonth() + 1; this.animeInfo['.add_manga[start_date][day]'] = Datec.getDate(); } this.animeInfo['.add_anime[start_date][year]'] = Datec.getFullYear(); this.animeInfo['.add_anime[start_date][month]'] = Datec.getMonth() + 1; this.animeInfo['.add_anime[start_date][day]'] = Datec.getDate(); } else { con.info('Start date already set'); } } getStreamingUrl() { var tags = this.animeInfo[".add_anime[tags]"]; if (this.type == "manga") { tags = this.animeInfo[".add_manga[tags]"]; } return utils.getUrlFromTags(tags); } setStreamingUrl(url) { var tags = this.animeInfo[".add_anime[tags]"]; if (this.type == "manga") { tags = this.animeInfo[".add_manga[tags]"]; } tags = utils.setUrlInTags(url, tags); if (this.type == "manga") { this.animeInfo[".add_manga[tags]"] = tags; return; } this.animeInfo[".add_anime[tags]"] = tags; } getRating() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { var url = ''; if (this.type == 'anime') { url = 'https://myanimelist.net/includes/ajax.inc.php?t=64&id=' + this.id; } else { url = 'https://myanimelist.net/includes/ajax.inc.php?t=65&id=' + this.id; } api.request.xhr('GET', url).then((response) => { try { resolve(response.responseText.split('Score:')[1].split('<')[0]); } catch (e) { con.error('Could not get rating', e); reject(); } }); }); }); } setResumeWaching(url, ep) { return __awaiter(this, void 0, void 0, function* () { return utils.setResumeWaching(url, ep, this.type, this.id); }); } getResumeWaching() { return __awaiter(this, void 0, void 0, function* () { return utils.getResumeWaching(this.type, this.id); }); } setContinueWaching(url, ep) { return __awaiter(this, void 0, void 0, function* () { return utils.setContinueWaching(url, ep, this.type, this.id); }); } getContinueWaching() { return __awaiter(this, void 0, void 0, function* () { return utils.getContinueWaching(this.type, this.id); }); } getImage() { return __awaiter(this, void 0, void 0, function* () { return api.request.xhr('GET', this.url).then((response) => { var data = response.responseText; var image = ''; try { image = data.split('js-scrollfix-bottom')[1].split(' { var This = this; var url = "https://myanimelist.net/ownlist/" + this.type + "/" + this.id + "/edit"; if (this.addAnime) { var imgSelector = 'malSyncImg' + this.id; var flashConfirmText = ` Is "${this.name}" correct?

`; if (This.miniMAL) { flashConfirmText = ` Add "${this.name}" to MAL?`; } if (this.type == 'anime') { url = "https://myanimelist.net/ownlist/anime/add?selected_series_id=" + this.id; utils.flashConfirm(flashConfirmText, 'add', function () { This.setStatus(1); continueCall(); }, function () { wrongCall(); /*if(change['checkIncrease'] == 1){TODO episodeInfo(change['.add_anime[num_watched_episodes]'], actual['malurl']); }*/ }); } else { url = "https://myanimelist.net/ownlist/manga/add?selected_manga_id=" + this.id; utils.flashConfirm(flashConfirmText, 'add', function () { This.setStatus(1); continueCall(); }, function () { wrongCall(); }); } if (!This.miniMAL) { this.getImage().then((image) => { j.$('#' + imgSelector).attr('src', image); }); j.$('.Yes').text('YES'); j.$('.Cancel').text('NO'); } return; } function wrongCall() { This.wrong = true; if (!This.miniMAL) { var miniButton = j.$('button.open-info-popup'); if (miniButton.css('display') != 'none') { miniButton.click(); } else { miniButton.click(); miniButton.click(); } } } continueCall(); function continueCall() { var parameter = ""; j.$.each(This.animeInfo, function (index, value) { if (index.toString().charAt(0) == ".") { if (!((index === '.add_anime[is_rewatching]' || index === '.add_manga[is_rereading]') && parseInt(value) === 0)) { parameter += encodeURIComponent(index.toString().substring(1)) + "=" + encodeURIComponent(value) + "&"; } } }); con.log('[SET] URL:', url); con.log('[SET] Object:', This.animeInfo); api.request.xhr('POST', { url: url, data: parameter, headers: { "Content-Type": "application/x-www-form-urlencoded" } }).then((response) => { if (response.responseText.indexOf('Successfully') >= 0) { con.log('Update Succeeded'); resolve(); } else { con.error('Update failed'); reject(); } //This.animeInfo = This.getObject(response.responseText); }); } }); } getObject(data) { var getselect = utils.getselect; if (typeof data.split('
-1) { this.addAnime = true; } data = data.split('')[1].split('<')[0]); this.name = data.split('')[1].split('<')[0]; anime['.anime_id'] = parseInt(data.split('name="anime_id"')[1].split('value="')[1].split('"')[0]); //input anime['.aeps'] = parseInt(data.split('name="aeps"')[1].split('value="')[1].split('"')[0]); anime['.astatus'] = parseInt(data.split('name="astatus"')[1].split('value="')[1].split('"')[0]); anime['.add_anime[status]'] = parseInt(getselect(data, 'add_anime[status]')); //Rewatching if (data.split('name="add_anime[is_rewatching]"')[1].split('>')[0].indexOf('checked="checked"') >= 0) { anime['.add_anime[is_rewatching]'] = 1; } // anime['.add_anime[num_watched_episodes]'] = parseInt(data.split('name="add_anime[num_watched_episodes]"')[1].split('value="')[1].split('"')[0]); if (isNaN(anime['.add_anime[num_watched_episodes]'])) { anime['.add_anime[num_watched_episodes]'] = ''; } anime['.add_anime[score]'] = getselect(data, 'add_anime[score]'); anime['.add_anime[start_date][month]'] = getselect(data, 'add_anime[start_date][month]'); anime['.add_anime[start_date][day]'] = getselect(data, 'add_anime[start_date][day]'); anime['.add_anime[start_date][year]'] = getselect(data, 'add_anime[start_date][year]'); anime['.add_anime[finish_date][month]'] = getselect(data, 'add_anime[finish_date][month]'); anime['.add_anime[finish_date][day]'] = getselect(data, 'add_anime[finish_date][day]'); anime['.add_anime[finish_date][year]'] = getselect(data, 'add_anime[finish_date][year]'); anime['.add_anime[tags]'] = data.split('name="add_anime[tags]"')[1].split('>')[1].split('<')[0]; //textarea anime['.add_anime[priority]'] = getselect(data, 'add_anime[priority]'); anime['.add_anime[storage_type]'] = getselect(data, 'add_anime[storage_type]'); anime['.add_anime[storage_value]'] = data.split('name="add_anime[storage_value]"')[1].split('value="')[1].split('"')[0]; anime['.add_anime[num_watched_times]'] = data.split('name="add_anime[num_watched_times]"')[1].split('value="')[1].split('"')[0]; anime['.add_anime[rewatch_value]'] = getselect(data, 'add_anime[rewatch_value]'); anime['.add_anime[comments]'] = data.split('name="add_anime[comments]"')[1].split('>')[1].split('<')[0]; anime['.add_anime[is_asked_to_discuss]'] = getselect(data, 'add_anime[is_asked_to_discuss]'); if (anime['.add_anime[is_asked_to_discuss]'] == '') anime['.add_anime[is_asked_to_discuss]'] = 0; //#15 anime['.add_anime[sns_post_type]'] = getselect(data, 'add_anime[sns_post_type]'); anime['.submitIt'] = data.split('name="submitIt"')[1].split('value="')[1].split('"')[0]; con.log('[GET] Object:', anime); return anime; } else { var anime = {}; anime['.csrf_token'] = data.split('\'csrf_token\'')[1].split('\'')[1].split('\'')[0]; if (data.indexOf('Add Manga') > -1) { this.addAnime = true; } data = data.split('')[1].split('<')[0]); this.totalVol = parseInt(data.split('id="totalVol">')[1].split('<')[0]); this.name = data.split('')[1].split('<')[0]; anime['.entry_id'] = parseInt(data.split('name="entry_id"')[1].split('value="')[1].split('"')[0]); anime['.manga_id'] = parseInt(data.split('name="manga_id"')[1].split('value="')[1].split('"')[0]); //input anime['volumes'] = parseInt(data.split('id="volumes"')[1].split('value="')[1].split('"')[0]); anime['mstatus'] = parseInt(data.split('id="mstatus"')[1].split('value="')[1].split('"')[0]); anime['.add_manga[status]'] = parseInt(getselect(data, 'add_manga[status]')); //Rewatching if (data.split('name="add_manga[is_rereading]"')[1].split('>')[0].indexOf('checked="checked"') >= 0) { anime['.add_manga[is_rereading]'] = 1; } // anime['.add_manga[num_read_volumes]'] = parseInt(data.split('name="add_manga[num_read_volumes]"')[1].split('value="')[1].split('"')[0]); if (isNaN(anime['.add_manga[num_read_volumes]'])) { anime['.add_manga[num_read_volumes]'] = ''; } anime['.add_manga[num_read_chapters]'] = parseInt(data.split('name="add_manga[num_read_chapters]"')[1].split('value="')[1].split('"')[0]); if (isNaN(anime['.add_manga[num_read_chapters]'])) { anime['.add_manga[num_read_chapters]'] = ''; } anime['.add_manga[score]'] = getselect(data, 'add_manga[score]'); anime['.add_manga[start_date][month]'] = getselect(data, 'add_manga[start_date][month]'); anime['.add_manga[start_date][day]'] = getselect(data, 'add_manga[start_date][day]'); anime['.add_manga[start_date][year]'] = getselect(data, 'add_manga[start_date][year]'); anime['.add_manga[finish_date][month]'] = getselect(data, 'add_manga[finish_date][month]'); anime['.add_manga[finish_date][day]'] = getselect(data, 'add_manga[finish_date][day]'); anime['.add_manga[finish_date][year]'] = getselect(data, 'add_manga[finish_date][year]'); anime['.add_manga[tags]'] = data.split('name="add_manga[tags]"')[1].split('>')[1].split('<')[0]; //textarea anime['.add_manga[priority]'] = getselect(data, 'add_manga[priority]'); anime['.add_manga[storage_type]'] = getselect(data, 'add_manga[storage_type]'); anime['.add_manga[num_retail_volumes]'] = data.split('name="add_manga[num_retail_volumes]"')[1].split('value="')[1].split('"')[0]; anime['.add_manga[num_read_times]'] = data.split('name="add_manga[num_read_times]"')[1].split('value="')[1].split('"')[0]; anime['.add_manga[reread_value]'] = getselect(data, 'add_manga[reread_value]'); anime['.add_manga[comments]'] = data.split('name="add_manga[comments]"')[1].split('>')[1].split('<')[0]; anime['.add_manga[is_asked_to_discuss]'] = getselect(data, 'add_manga[is_asked_to_discuss]'); if (anime['.add_manga[is_asked_to_discuss]'] == '') anime['.add_manga[is_asked_to_discuss]'] = 0; //#15 anime['.add_manga[sns_post_type]'] = getselect(data, 'add_manga[sns_post_type]'); anime['.submitIt'] = data.split('name="submitIt"')[1].split('value="')[1].split('"')[0]; con.log('[GET] Object:', anime); return anime; } } } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(2), __webpack_require__(3), __webpack_require__(0), __webpack_require__(1))) /***/ }), /* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return pages; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pageSearch; }); /* harmony import */ var _Kissanime_main__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); /* harmony import */ var _Kissmanga_main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11); /* harmony import */ var _nineAnime_main__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12); /* harmony import */ var _Crunchyroll_main__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); /* harmony import */ var _Masterani_main__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14); /* harmony import */ var _Mangadex_main__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15); /* harmony import */ var _Mangarock_main__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); /* harmony import */ var _Gogoanime_main__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17); /* harmony import */ var _Anime4you_main__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18); /* harmony import */ var _Branitube_main__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(19); /* harmony import */ var _Turkanime_main__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(20); /* harmony import */ var _Twistmoe_main__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(21); const pages = { Kissanime: _Kissanime_main__WEBPACK_IMPORTED_MODULE_0__[/* Kissanime */ "a"], Kissmanga: _Kissmanga_main__WEBPACK_IMPORTED_MODULE_1__[/* Kissmanga */ "a"], nineAnime: _nineAnime_main__WEBPACK_IMPORTED_MODULE_2__[/* nineAnime */ "a"], Crunchyroll: _Crunchyroll_main__WEBPACK_IMPORTED_MODULE_3__[/* Crunchyroll */ "a"], Masterani: _Masterani_main__WEBPACK_IMPORTED_MODULE_4__[/* Masterani */ "a"], Mangadex: _Mangadex_main__WEBPACK_IMPORTED_MODULE_5__[/* Mangadex */ "a"], Mangarock: _Mangarock_main__WEBPACK_IMPORTED_MODULE_6__[/* Mangarock */ "a"], Gogoanime: _Gogoanime_main__WEBPACK_IMPORTED_MODULE_7__[/* Gogoanime */ "a"], Anime4you: _Anime4you_main__WEBPACK_IMPORTED_MODULE_8__[/* Anime4you */ "a"], Branitube: _Branitube_main__WEBPACK_IMPORTED_MODULE_9__[/* Branitube */ "a"], Turkanime: _Turkanime_main__WEBPACK_IMPORTED_MODULE_10__[/* Turkanime */ "a"], Twistmoe: _Twistmoe_main__WEBPACK_IMPORTED_MODULE_11__[/* Twistmoe */ "a"], }; const pageSearch = { Kissanime: { name: 'Kissanime', type: 'anime', domain: 'kissanime.ru', searchUrl: (titleEncoded) => { return ''; }, completeSearchTag: (title, linkContent) => { return '' + linkContent + '
'; } }, Kissmanga: { name: 'Kissmanga', type: 'manga', domain: 'kissmanga.com', searchUrl: (titleEncoded) => { return ''; }, completeSearchTag: (title, linkContent) => { return ''; } }, Crunchyroll: { name: 'Crunchyroll', type: 'anime', domain: 'www.crunchyroll.com', searchUrl: (titleEncoded) => { return 'http://www.crunchyroll.com/search?q=' + titleEncoded; } }, nineAnime: { name: '9Anime', type: 'anime', domain: '9anime.to', googleSearchDomain: '9anime.to/watch', searchUrl: (titleEncoded) => { return 'https://www1.9anime.to/search?keyword=' + titleEncoded; } }, MasterAnime: { name: 'MasterAnime', type: 'anime', domain: 'www.masterani.me', googleSearchDomain: 'www.masterani.me/anime/info/', searchUrl: (titleEncoded) => { return 'https://www.masterani.me/anime?search=' + titleEncoded; } }, Gogoanime: { name: 'Gogoanime', type: 'anime', domain: 'www.gogoanime.in', searchUrl: (titleEncoded) => { return 'http://gogoanimes.co/search.html?keyword=' + titleEncoded; } }, Mangadex: { name: 'Mangadex', type: 'manga', domain: 'mangadex.org', searchUrl: (titleEncoded) => { return 'https://mangadex.org/quick_search/' + titleEncoded; } }, Mangarock: { name: 'Mangarock', type: 'manga', domain: 'mangarock.com', searchUrl: (titleEncoded) => { return 'https://mangarock.com/search?q=' + titleEncoded; } }, AniList: { name: 'AniList', type: 'anime', domain: 'anilist.co', searchUrl: (titleEncoded) => { return 'https://anilist.co/search/anime?sort=SEARCH_MATCH&search=' + titleEncoded; } }, AniListManga: { name: 'AniList', type: 'manga', domain: 'anilist.co', searchUrl: (titleEncoded) => { return 'https://anilist.co/search/manga?sort=SEARCH_MATCH&search=' + titleEncoded; } }, }; /***/ }), /* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(j) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return userscriptLegacy; }); var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const userscriptLegacy = { set(key, value) { return __awaiter(this, void 0, void 0, function* () { GM_setValue(key, value); }); }, get(key) { return __awaiter(this, void 0, void 0, function* () { const value = GM_getValue(key); return value; }); }, remove(key) { return __awaiter(this, void 0, void 0, function* () { GM_deleteValue(key); }); }, list() { return __awaiter(this, void 0, void 0, function* () { var reverseArray = {}; j.$.each(GM_listValues(), function (index, cache) { reverseArray[cache] = index; }); return reverseArray; }); }, addStyle(css) { return __awaiter(this, void 0, void 0, function* () { GM_addStyle(css); }); }, version() { return GM_info.script.version; }, assetUrl(filename) { return 'https://raw.githubusercontent.com/lolamtisch/MALSync/master/assets/assets/' + filename; }, injectCssResource(res, head) { head.append(j.$('