Last active
May 29, 2024 14:17
-
-
Save Querela/bb599d2b0c58d93fcf8e92b1a38c3d6a to your computer and use it in GitHub Desktop.
NovelUpdates Scraper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
localForage -- Offline Storage, Improved | |
Version 1.10.0 | |
https://localforage.github.io/localForage | |
(c) 2013-2017 Mozilla, Apache License 2.0 | |
*/ | |
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.localforage=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){(function(a){"use strict";function c(){k=!0;for(var a,b,c=l.length;c;){for(b=l,l=[],a=-1;++a<c;)b[a]();c=l.length}k=!1}function d(a){1!==l.push(a)||k||e()}var e,f=a.MutationObserver||a.WebKitMutationObserver;if(f){var g=0,h=new f(c),i=a.document.createTextNode("");h.observe(i,{characterData:!0}),e=function(){i.data=g=++g%2}}else if(a.setImmediate||void 0===a.MessageChannel)e="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var b=a.document.createElement("script");b.onreadystatechange=function(){c(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:function(){setTimeout(c,0)};else{var j=new a.MessageChannel;j.port1.onmessage=c,e=function(){j.port2.postMessage(0)}}var k,l=[];b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(a,b,c){"use strict";function d(){}function e(a){if("function"!=typeof a)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,a!==d&&i(this,a)}function f(a,b,c){this.promise=a,"function"==typeof b&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),"function"==typeof c&&(this.onRejected=c,this.callRejected=this.otherCallRejected)}function g(a,b,c){o(function(){var d;try{d=b(c)}catch(b){return p.reject(a,b)}d===a?p.reject(a,new TypeError("Cannot resolve promise with itself")):p.resolve(a,d)})}function h(a){var b=a&&a.then;if(a&&("object"==typeof a||"function"==typeof a)&&"function"==typeof b)return function(){b.apply(a,arguments)}}function i(a,b){function c(b){f||(f=!0,p.reject(a,b))}function d(b){f||(f=!0,p.resolve(a,b))}function e(){b(d,c)}var f=!1,g=j(e);"error"===g.status&&c(g.value)}function j(a,b){var c={};try{c.value=a(b),c.status="success"}catch(a){c.status="error",c.value=a}return c}function k(a){return a instanceof this?a:p.resolve(new this(d),a)}function l(a){var b=new this(d);return p.reject(b,a)}function m(a){function b(a,b){function d(a){g[b]=a,++h!==e||f||(f=!0,p.resolve(j,g))}c.resolve(a).then(d,function(a){f||(f=!0,p.reject(j,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var e=a.length,f=!1;if(!e)return this.resolve([]);for(var g=new Array(e),h=0,i=-1,j=new this(d);++i<e;)b(a[i],i);return j}function n(a){function b(a){c.resolve(a).then(function(a){f||(f=!0,p.resolve(h,a))},function(a){f||(f=!0,p.reject(h,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var e=a.length,f=!1;if(!e)return this.resolve([]);for(var g=-1,h=new this(d);++g<e;)b(a[g]);return h}var o=a(1),p={},q=["REJECTED"],r=["FULFILLED"],s=["PENDING"];b.exports=e,e.prototype.catch=function(a){return this.then(null,a)},e.prototype.then=function(a,b){if("function"!=typeof a&&this.state===r||"function"!=typeof b&&this.state===q)return this;var c=new this.constructor(d);if(this.state!==s){g(c,this.state===r?a:b,this.outcome)}else this.queue.push(new f(c,a,b));return c},f.prototype.callFulfilled=function(a){p.resolve(this.promise,a)},f.prototype.otherCallFulfilled=function(a){g(this.promise,this.onFulfilled,a)},f.prototype.callRejected=function(a){p.reject(this.promise,a)},f.prototype.otherCallRejected=function(a){g(this.promise,this.onRejected,a)},p.resolve=function(a,b){var c=j(h,b);if("error"===c.status)return p.reject(a,c.value);var d=c.value;if(d)i(a,d);else{a.state=r,a.outcome=b;for(var e=-1,f=a.queue.length;++e<f;)a.queue[e].callFulfilled(b)}return a},p.reject=function(a,b){a.state=q,a.outcome=b;for(var c=-1,d=a.queue.length;++c<d;)a.queue[c].callRejected(b);return a},e.resolve=k,e.reject=l,e.all=m,e.race=n},{1:1}],3:[function(a,b,c){(function(b){"use strict";"function"!=typeof b.Promise&&(b.Promise=a(2))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(a){return}}function f(){try{if(!ua||!ua.open)return!1;var a="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),b="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!a||b)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(a){return!1}}function g(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(f){if("TypeError"!==f.name)throw f;for(var c="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,d=new c,e=0;e<a.length;e+=1)d.append(a[e]);return d.getBlob(b.type)}}function h(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}function i(a,b,c){"function"==typeof b&&a.then(b),"function"==typeof c&&a.catch(c)}function j(a){return"string"!=typeof a&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function k(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function l(a){for(var b=a.length,c=new ArrayBuffer(b),d=new Uint8Array(c),e=0;e<b;e++)d[e]=a.charCodeAt(e);return c}function m(a){return new va(function(b){var c=a.transaction(wa,Ba),d=g([""]);c.objectStore(wa).put(d,"key"),c.onabort=function(a){a.preventDefault(),a.stopPropagation(),b(!1)},c.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),c=navigator.userAgent.match(/Edge\//);b(c||!a||parseInt(a[1],10)>=43)}}).catch(function(){return!1})}function n(a){return"boolean"==typeof xa?va.resolve(xa):m(a).then(function(a){return xa=a})}function o(a){var b=ya[a.name],c={};c.promise=new va(function(a,b){c.resolve=a,c.reject=b}),b.deferredOperations.push(c),b.dbReady?b.dbReady=b.dbReady.then(function(){return c.promise}):b.dbReady=c.promise}function p(a){var b=ya[a.name],c=b.deferredOperations.pop();if(c)return c.resolve(),c.promise}function q(a,b){var c=ya[a.name],d=c.deferredOperations.pop();if(d)return d.reject(b),d.promise}function r(a,b){return new va(function(c,d){if(ya[a.name]=ya[a.name]||B(),a.db){if(!b)return c(a.db);o(a),a.db.close()}var e=[a.name];b&&e.push(a.version);var f=ua.open.apply(ua,e);b&&(f.onupgradeneeded=function(b){var c=f.result;try{c.createObjectStore(a.storeName),b.oldVersion<=1&&c.createObjectStore(wa)}catch(c){if("ConstraintError"!==c.name)throw c;console.warn('The database "'+a.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),f.onerror=function(a){a.preventDefault(),d(f.error)},f.onsuccess=function(){var b=f.result;b.onversionchange=function(a){a.target.close()},c(b),p(a)}})}function s(a){return r(a,!1)}function t(a){return r(a,!0)}function u(a,b){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),d=a.version<a.db.version,e=a.version>a.db.version;if(d&&(a.version!==b&&console.warn('The database "'+a.name+"\" can't be downgraded from version "+a.db.version+" to version "+a.version+"."),a.version=a.db.version),e||c){if(c){var f=a.db.version+1;f>a.version&&(a.version=f)}return!0}return!1}function v(a){return new va(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function w(a){return g([l(atob(a.data))],{type:a.type})}function x(a){return a&&a.__local_forage_encoded_blob}function y(a){var b=this,c=b._initReady().then(function(){var a=ya[b._dbInfo.name];if(a&&a.dbReady)return a.dbReady});return i(c,a,a),c}function z(a){o(a);for(var b=ya[a.name],c=b.forages,d=0;d<c.length;d++){var e=c[d];e._dbInfo.db&&(e._dbInfo.db.close(),e._dbInfo.db=null)}return a.db=null,s(a).then(function(b){return a.db=b,u(a)?t(a):b}).then(function(d){a.db=b.db=d;for(var e=0;e<c.length;e++)c[e]._dbInfo.db=d}).catch(function(b){throw q(a,b),b})}function A(a,b,c,d){void 0===d&&(d=1);try{var e=a.db.transaction(a.storeName,b);c(null,e)}catch(e){if(d>0&&(!a.db||"InvalidStateError"===e.name||"NotFoundError"===e.name))return va.resolve().then(function(){if(!a.db||"NotFoundError"===e.name&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),t(a)}).then(function(){return z(a).then(function(){A(a,b,c,d-1)})}).catch(c);c(e)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function C(a){function b(){return va.resolve()}var c=this,d={db:null};if(a)for(var e in a)d[e]=a[e];var f=ya[d.name];f||(f=B(),ya[d.name]=f),f.forages.push(c),c._initReady||(c._initReady=c.ready,c.ready=y);for(var g=[],h=0;h<f.forages.length;h++){var i=f.forages[h];i!==c&&g.push(i._initReady().catch(b))}var j=f.forages.slice(0);return va.all(g).then(function(){return d.db=f.db,s(d)}).then(function(a){return d.db=a,u(d,c._defaultConfig.version)?t(d):a}).then(function(a){d.db=f.db=a,c._dbInfo=d;for(var b=0;b<j.length;b++){var e=j[b];e!==c&&(e._dbInfo.db=d.db,e._dbInfo.version=d.version)}})}function D(a,b){var c=this;a=j(a);var d=new va(function(b,d){c.ready().then(function(){A(c._dbInfo,Aa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.get(a);h.onsuccess=function(){var a=h.result;void 0===a&&(a=null),x(a)&&(a=w(a)),b(a)},h.onerror=function(){d(h.error)}}catch(a){d(a)}})}).catch(d)});return h(d,b),d}function E(a,b){var c=this,d=new va(function(b,d){c.ready().then(function(){A(c._dbInfo,Aa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.openCursor(),i=1;h.onsuccess=function(){var c=h.result;if(c){var d=c.value;x(d)&&(d=w(d));var e=a(d,c.key,i++);void 0!==e?b(e):c.continue()}else b()},h.onerror=function(){d(h.error)}}catch(a){d(a)}})}).catch(d)});return h(d,b),d}function F(a,b,c){var d=this;a=j(a);var e=new va(function(c,e){var f;d.ready().then(function(){return f=d._dbInfo,"[object Blob]"===za.call(b)?n(f.db).then(function(a){return a?b:v(b)}):b}).then(function(b){A(d._dbInfo,Ba,function(f,g){if(f)return e(f);try{var h=g.objectStore(d._dbInfo.storeName);null===b&&(b=void 0);var i=h.put(b,a);g.oncomplete=function(){void 0===b&&(b=null),c(b)},g.onabort=g.onerror=function(){var a=i.error?i.error:i.transaction.error;e(a)}}catch(a){e(a)}})}).catch(e)});return h(e,c),e}function G(a,b){var c=this;a=j(a);var d=new va(function(b,d){c.ready().then(function(){A(c._dbInfo,Ba,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.delete(a);f.oncomplete=function(){b()},f.onerror=function(){d(h.error)},f.onabort=function(){var a=h.error?h.error:h.transaction.error;d(a)}}catch(a){d(a)}})}).catch(d)});return h(d,b),d}function H(a){var b=this,c=new va(function(a,c){b.ready().then(function(){A(b._dbInfo,Ba,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.clear();e.oncomplete=function(){a()},e.onabort=e.onerror=function(){var a=g.error?g.error:g.transaction.error;c(a)}}catch(a){c(a)}})}).catch(c)});return h(c,a),c}function I(a){var b=this,c=new va(function(a,c){b.ready().then(function(){A(b._dbInfo,Aa,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.count();g.onsuccess=function(){a(g.result)},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return h(c,a),c}function J(a,b){var c=this,d=new va(function(b,d){if(a<0)return void b(null);c.ready().then(function(){A(c._dbInfo,Aa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=!1,i=g.openKeyCursor();i.onsuccess=function(){var c=i.result;if(!c)return void b(null);0===a?b(c.key):h?b(c.key):(h=!0,c.advance(a))},i.onerror=function(){d(i.error)}}catch(a){d(a)}})}).catch(d)});return h(d,b),d}function K(a){var b=this,c=new va(function(a,c){b.ready().then(function(){A(b._dbInfo,Aa,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.openKeyCursor(),h=[];g.onsuccess=function(){var b=g.result;if(!b)return void a(h);h.push(b.key),b.continue()},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return h(c,a),c}function L(a,b){b=k.apply(this,arguments);var c=this.config();a="function"!=typeof a&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var d,e=this;if(a.name){var f=a.name===c.name&&e._dbInfo.db,g=f?va.resolve(e._dbInfo.db):s(a).then(function(b){var c=ya[a.name],d=c.forages;c.db=b;for(var e=0;e<d.length;e++)d[e]._dbInfo.db=b;return b});d=a.storeName?g.then(function(b){if(b.objectStoreNames.contains(a.storeName)){var c=b.version+1;o(a);var d=ya[a.name],e=d.forages;b.close();for(var f=0;f<e.length;f++){var g=e[f];g._dbInfo.db=null,g._dbInfo.version=c}return new va(function(b,d){var e=ua.open(a.name,c);e.onerror=function(a){e.result.close(),d(a)},e.onupgradeneeded=function(){e.result.deleteObjectStore(a.storeName)},e.onsuccess=function(){var a=e.result;a.close(),b(a)}}).then(function(a){d.db=a;for(var b=0;b<e.length;b++){var c=e[b];c._dbInfo.db=a,p(c._dbInfo)}}).catch(function(b){throw(q(a,b)||va.resolve()).catch(function(){}),b})}}):g.then(function(b){o(a);var c=ya[a.name],d=c.forages;b.close();for(var e=0;e<d.length;e++){d[e]._dbInfo.db=null}return new va(function(b,c){var d=ua.deleteDatabase(a.name);d.onerror=function(){var a=d.result;a&&a.close(),c(d.error)},d.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},d.onsuccess=function(){var a=d.result;a&&a.close(),b(a)}}).then(function(a){c.db=a;for(var b=0;b<d.length;b++)p(d[b]._dbInfo)}).catch(function(b){throw(q(a,b)||va.resolve()).catch(function(){}),b})})}else d=va.reject("Invalid arguments");return h(d,b),d}function M(){return"function"==typeof openDatabase}function N(a){var b,c,d,e,f,g=.75*a.length,h=a.length,i=0;"="===a[a.length-1]&&(g--,"="===a[a.length-2]&&g--);var j=new ArrayBuffer(g),k=new Uint8Array(j);for(b=0;b<h;b+=4)c=Da.indexOf(a[b]),d=Da.indexOf(a[b+1]),e=Da.indexOf(a[b+2]),f=Da.indexOf(a[b+3]),k[i++]=c<<2|d>>4,k[i++]=(15&d)<<4|e>>2,k[i++]=(3&e)<<6|63&f;return j}function O(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=Da[c[b]>>2],d+=Da[(3&c[b])<<4|c[b+1]>>4],d+=Da[(15&c[b+1])<<2|c[b+2]>>6],d+=Da[63&c[b+2]];return c.length%3==2?d=d.substring(0,d.length-1)+"=":c.length%3==1&&(d=d.substring(0,d.length-2)+"=="),d}function P(a,b){var c="";if(a&&(c=Ua.call(a)),a&&("[object ArrayBuffer]"===c||a.buffer&&"[object ArrayBuffer]"===Ua.call(a.buffer))){var d,e=Ga;a instanceof ArrayBuffer?(d=a,e+=Ia):(d=a.buffer,"[object Int8Array]"===c?e+=Ka:"[object Uint8Array]"===c?e+=La:"[object Uint8ClampedArray]"===c?e+=Ma:"[object Int16Array]"===c?e+=Na:"[object Uint16Array]"===c?e+=Pa:"[object Int32Array]"===c?e+=Oa:"[object Uint32Array]"===c?e+=Qa:"[object Float32Array]"===c?e+=Ra:"[object Float64Array]"===c?e+=Sa:b(new Error("Failed to get type for BinaryArray"))),b(e+O(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c=Ea+a.type+"~"+O(this.result);b(Ga+Ja+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(c){console.error("Couldn't convert value into a JSON string: ",a),b(null,c)}}function Q(a){if(a.substring(0,Ha)!==Ga)return JSON.parse(a);var b,c=a.substring(Ta),d=a.substring(Ha,Ta);if(d===Ja&&Fa.test(c)){var e=c.match(Fa);b=e[1],c=c.substring(e[0].length)}var f=N(c);switch(d){case Ia:return f;case Ja:return g([f],{type:b});case Ka:return new Int8Array(f);case La:return new Uint8Array(f);case Ma:return new Uint8ClampedArray(f);case Na:return new Int16Array(f);case Pa:return new Uint16Array(f);case Oa:return new Int32Array(f);case Qa:return new Uint32Array(f);case Ra:return new Float32Array(f);case Sa:return new Float64Array(f);default:throw new Error("Unkown type: "+d)}}function R(a,b,c,d){a.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,d)}function S(a){var b=this,c={db:null};if(a)for(var d in a)c[d]="string"!=typeof a[d]?a[d].toString():a[d];var e=new va(function(a,d){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(a){return d(a)}c.db.transaction(function(e){R(e,c,function(){b._dbInfo=c,a()},function(a,b){d(b)})},d)});return c.serializer=Va,e}function T(a,b,c,d,e,f){a.executeSql(c,d,e,function(a,g){g.code===g.SYNTAX_ERR?a.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function(a,h){h.rows.length?f(a,g):R(a,b,function(){a.executeSql(c,d,e,f)},f)},f):f(a,g)},f)}function U(a,b){var c=this;a=j(a);var d=new va(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){T(c,e,"SELECT * FROM "+e.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var d=c.rows.length?c.rows.item(0).value:null;d&&(d=e.serializer.deserialize(d)),b(d)},function(a,b){d(b)})})}).catch(d)});return h(d,b),d}function V(a,b){var c=this,d=new va(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){T(c,e,"SELECT * FROM "+e.storeName,[],function(c,d){for(var f=d.rows,g=f.length,h=0;h<g;h++){var i=f.item(h),j=i.value;if(j&&(j=e.serializer.deserialize(j)),void 0!==(j=a(j,i.key,h+1)))return void b(j)}b()},function(a,b){d(b)})})}).catch(d)});return h(d,b),d}function W(a,b,c,d){var e=this;a=j(a);var f=new va(function(f,g){e.ready().then(function(){void 0===b&&(b=null);var h=b,i=e._dbInfo;i.serializer.serialize(b,function(b,j){j?g(j):i.db.transaction(function(c){T(c,i,"INSERT OR REPLACE INTO "+i.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){f(h)},function(a,b){g(b)})},function(b){if(b.code===b.QUOTA_ERR){if(d>0)return void f(W.apply(e,[a,h,c,d-1]));g(b)}})})}).catch(g)});return h(f,c),f}function X(a,b,c){return W.apply(this,[a,b,c,1])}function Y(a,b){var c=this;a=j(a);var d=new va(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){T(c,e,"DELETE FROM "+e.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){d(b)})})}).catch(d)});return h(d,b),d}function Z(a){var b=this,c=new va(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){T(b,d,"DELETE FROM "+d.storeName,[],function(){a()},function(a,b){c(b)})})}).catch(c)});return h(c,a),c}function $(a){var b=this,c=new va(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){T(b,d,"SELECT COUNT(key) as c FROM "+d.storeName,[],function(b,c){var d=c.rows.item(0).c;a(d)},function(a,b){c(b)})})}).catch(c)});return h(c,a),c}function _(a,b){var c=this,d=new va(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){T(c,e,"SELECT key FROM "+e.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var d=c.rows.length?c.rows.item(0).key:null;b(d)},function(a,b){d(b)})})}).catch(d)});return h(d,b),d}function aa(a){var b=this,c=new va(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){T(b,d,"SELECT key FROM "+d.storeName,[],function(b,c){for(var d=[],e=0;e<c.rows.length;e++)d.push(c.rows.item(e).key);a(d)},function(a,b){c(b)})})}).catch(c)});return h(c,a),c}function ba(a){return new va(function(b,c){a.transaction(function(d){d.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(c,d){for(var e=[],f=0;f<d.rows.length;f++)e.push(d.rows.item(f).name);b({db:a,storeNames:e})},function(a,b){c(b)})},function(a){c(a)})})}function ca(a,b){b=k.apply(this,arguments);var c=this.config();a="function"!=typeof a&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var d,e=this;return d=a.name?new va(function(b){var d;d=a.name===c.name?e._dbInfo.db:openDatabase(a.name,"","",0),b(a.storeName?{db:d,storeNames:[a.storeName]}:ba(d))}).then(function(a){return new va(function(b,c){a.db.transaction(function(d){function e(a){return new va(function(b,c){d.executeSql("DROP TABLE IF EXISTS "+a,[],function(){b()},function(a,b){c(b)})})}for(var f=[],g=0,h=a.storeNames.length;g<h;g++)f.push(e(a.storeNames[g]));va.all(f).then(function(){b()}).catch(function(a){c(a)})},function(a){c(a)})})}):va.reject("Invalid arguments"),h(d,b),d}function da(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(a){return!1}}function ea(a,b){var c=a.name+"/";return a.storeName!==b.storeName&&(c+=a.storeName+"/"),c}function fa(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch(a){return!0}}function ga(){return!fa()||localStorage.length>0}function ha(a){var b=this,c={};if(a)for(var d in a)c[d]=a[d];return c.keyPrefix=ea(a,b._defaultConfig),ga()?(b._dbInfo=c,c.serializer=Va,va.resolve()):va.reject()}function ia(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=localStorage.length-1;c>=0;c--){var d=localStorage.key(c);0===d.indexOf(a)&&localStorage.removeItem(d)}});return h(c,a),c}function ja(a,b){var c=this;a=j(a);var d=c.ready().then(function(){var b=c._dbInfo,d=localStorage.getItem(b.keyPrefix+a);return d&&(d=b.serializer.deserialize(d)),d});return h(d,b),d}function ka(a,b){var c=this,d=c.ready().then(function(){for(var b=c._dbInfo,d=b.keyPrefix,e=d.length,f=localStorage.length,g=1,h=0;h<f;h++){var i=localStorage.key(h);if(0===i.indexOf(d)){var j=localStorage.getItem(i);if(j&&(j=b.serializer.deserialize(j)),void 0!==(j=a(j,i.substring(e),g++)))return j}}});return h(d,b),d}function la(a,b){var c=this,d=c.ready().then(function(){var b,d=c._dbInfo;try{b=localStorage.key(a)}catch(a){b=null}return b&&(b=b.substring(d.keyPrefix.length)),b});return h(d,b),d}function ma(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo,c=localStorage.length,d=[],e=0;e<c;e++){var f=localStorage.key(e);0===f.indexOf(a.keyPrefix)&&d.push(f.substring(a.keyPrefix.length))}return d});return h(c,a),c}function na(a){var b=this,c=b.keys().then(function(a){return a.length});return h(c,a),c}function oa(a,b){var c=this;a=j(a);var d=c.ready().then(function(){var b=c._dbInfo;localStorage.removeItem(b.keyPrefix+a)});return h(d,b),d}function pa(a,b,c){var d=this;a=j(a);var e=d.ready().then(function(){void 0===b&&(b=null);var c=b;return new va(function(e,f){var g=d._dbInfo;g.serializer.serialize(b,function(b,d){if(d)f(d);else try{localStorage.setItem(g.keyPrefix+a,b),e(c)}catch(a){"QuotaExceededError"!==a.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==a.name||f(a),f(a)}})})});return h(e,c),e}function qa(a,b){if(b=k.apply(this,arguments),a="function"!=typeof a&&a||{},!a.name){var c=this.config();a.name=a.name||c.name,a.storeName=a.storeName||c.storeName}var d,e=this;return d=a.name?new va(function(b){b(a.storeName?ea(a,e._defaultConfig):a.name+"/")}).then(function(a){for(var b=localStorage.length-1;b>=0;b--){var c=localStorage.key(b);0===c.indexOf(a)&&localStorage.removeItem(c)}}):va.reject("Invalid arguments"),h(d,b),d}function ra(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}function sa(){for(var a=1;a<arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&&($a(b[c])?arguments[0][c]=b[c].slice():arguments[0][c]=b[c])}return arguments[0]}var ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ua=e();"undefined"==typeof Promise&&a(3);var va=Promise,wa="local-forage-detect-blob-support",xa=void 0,ya={},za=Object.prototype.toString,Aa="readonly",Ba="readwrite",Ca={_driver:"asyncStorage",_initStorage:C,_support:f(),iterate:E,getItem:D,setItem:F,removeItem:G,clear:H,length:I,key:J,keys:K,dropInstance:L},Da="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ea="~~local_forage_type~",Fa=/^~~local_forage_type~([^~]+)~/,Ga="__lfsc__:",Ha=Ga.length,Ia="arbf",Ja="blob",Ka="si08",La="ui08",Ma="uic8",Na="si16",Oa="si32",Pa="ur16",Qa="ui32",Ra="fl32",Sa="fl64",Ta=Ha+Ia.length,Ua=Object.prototype.toString,Va={serialize:P,deserialize:Q,stringToBuffer:N,bufferToString:O},Wa={_driver:"webSQLStorage",_initStorage:S,_support:M(),iterate:V,getItem:U,setItem:X,removeItem:Y,clear:Z,length:$,key:_,keys:aa,dropInstance:ca},Xa={_driver:"localStorageWrapper",_initStorage:ha,_support:da(),iterate:ka,getItem:ja,setItem:pa,removeItem:oa,clear:ia,length:na,key:la,keys:ma,dropInstance:qa},Ya=function(a,b){return a===b||"number"==typeof a&&"number"==typeof b&&isNaN(a)&&isNaN(b)},Za=function(a,b){for(var c=a.length,d=0;d<c;){if(Ya(a[d],b))return!0;d++}return!1},$a=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},_a={},ab={},bb={INDEXEDDB:Ca,WEBSQL:Wa,LOCALSTORAGE:Xa},cb=[bb.INDEXEDDB._driver,bb.WEBSQL._driver,bb.LOCALSTORAGE._driver],db=["dropInstance"],eb=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(db),fb={description:"",driver:cb.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},gb=function(){function a(b){d(this,a);for(var c in bb)if(bb.hasOwnProperty(c)){var e=bb[c],f=e._driver;this[c]=f,_a[f]||this.defineDriver(e)}this._defaultConfig=sa({},fb),this._config=sa({},this._defaultConfig,b),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(a){if("object"===(void 0===a?"undefined":ta(a))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a){if("storeName"===b&&(a[b]=a[b].replace(/\W/g,"_")),"version"===b&&"number"!=typeof a[b])return new Error("Database version must be a number.");this._config[b]=a[b]}return!("driver"in a&&a.driver)||this.setDriver(this._config.driver)}return"string"==typeof a?this._config[a]:this._config},a.prototype.defineDriver=function(a,b,c){var d=new va(function(b,c){try{var d=a._driver,e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void c(e);for(var f=eb.concat("_initStorage"),g=0,i=f.length;g<i;g++){var j=f[g];if((!Za(db,j)||a[j])&&"function"!=typeof a[j])return void c(e)}(function(){for(var b=function(a){return function(){var b=new Error("Method "+a+" is not implemented by the current driver"),c=va.reject(b);return h(c,arguments[arguments.length-1]),c}},c=0,d=db.length;c<d;c++){var e=db[c];a[e]||(a[e]=b(e))}})();var k=function(c){_a[d]&&console.info("Redefining LocalForage driver: "+d),_a[d]=a,ab[d]=c,b()};"_support"in a?a._support&&"function"==typeof a._support?a._support().then(k,c):k(!!a._support):k(!0)}catch(a){c(a)}});return i(d,b,c),d},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(a,b,c){var d=_a[a]?va.resolve(_a[a]):va.reject(new Error("Driver not found."));return i(d,b,c),d},a.prototype.getSerializer=function(a){var b=va.resolve(Va);return i(b,a),b},a.prototype.ready=function(a){var b=this,c=b._driverSet.then(function(){return null===b._ready&&(b._ready=b._initDriver()),b._ready});return i(c,a,a),c},a.prototype.setDriver=function(a,b,c){function d(){g._config.driver=g.driver()}function e(a){return g._extend(a),d(),g._ready=g._initStorage(g._config),g._ready}function f(a){return function(){function b(){for(;c<a.length;){var f=a[c];return c++,g._dbInfo=null,g._ready=null,g.getDriver(f).then(e).catch(b)}d();var h=new Error("No available storage method found.");return g._driverSet=va.reject(h),g._driverSet}var c=0;return b()}}var g=this;$a(a)||(a=[a]);var h=this._getSupportedDrivers(a),j=null!==this._driverSet?this._driverSet.catch(function(){return va.resolve()}):va.resolve();return this._driverSet=j.then(function(){var a=h[0];return g._dbInfo=null,g._ready=null,g.getDriver(a).then(function(a){g._driver=a._driver,d(),g._wrapLibraryMethodsWithReady(),g._initDriver=f(h)})}).catch(function(){d();var a=new Error("No available storage method found.");return g._driverSet=va.reject(a),g._driverSet}),i(this._driverSet,b,c),this._driverSet},a.prototype.supports=function(a){return!!ab[a]},a.prototype._extend=function(a){sa(this,a)},a.prototype._getSupportedDrivers=function(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c];this.supports(e)&&b.push(e)}return b},a.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,b=eb.length;a<b;a++)ra(this,eb[a])},a.prototype.createInstance=function(b){return new a(b)},a}(),hb=new gb;b.exports=hb},{3:3}]},{},[4])(4)}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
const ID_SCRAPERLET="scraperlet",URL_BASE="https://www.novelupdates.com",URL_GROUPLIST="https://www.novelupdates.com/groupslist/",URL_GROUPDETAILS_TEMPL="https://www.novelupdates.com/group/{name}/",URL_SERIESLIST="https://www.novelupdates.com/series-ranking/?rank=popular",URL_SERIES_TEMPL="https://www.novelupdates.com/series/{name}/",URL_USER_TEMPL="https://www.novelupdates.com/user/{idname}/",URL_GENRELIST="https://www.novelupdates.com/genre-explanation/",URL_TAGLIST="https://www.novelupdates.com/list-tags/",URL_RECOMMENDATIONLIST_TEMPL="https://www.novelupdates.com/viewlist/{id}/",KEY_STORE_SERIESIDS="scrapeSeriesDetails-seriesIds",KEY_STORE_SERIESIDS_SOURCE="scrapeSeriesDetails-seriesIds-source",KEY_STORE_STATS="STATS",KEY_STORE_STATS_HISTORY="STATS_HISTORY",STATS=new Proxy({numRequests:0,numBytesResponseText:0,numGroups:null,numGroupInfos:null,numGroupInfosTotal:null,numSeries:null,numSeriesForCrawl:null,numSeriesInfos:null,numSeriesInfosTotal:null,numChapters:null,numSeriesForChapters:null,numSeriesForChaptersTotal:null,numChapterLinksResolved:null,numReviews:null,numSeriesForReviews:null,numSeriesForReviewsTotal:null,numGenres:null,numTags:null},{set(e,t,r){return e[t]=r,updateStats(t),localforage.setItem(KEY_STORE_STATS,e),!0}}),CONFIGS={requestDelay:2e3,stop:!1,blockLeavePage:!0};async function bytesToBase64DataUrl(a,s="application/octet-stream"){return new Promise((e,t)=>{const r=Object.assign(new FileReader,{onload:()=>e(r.result),onerror:()=>t(r.error)});r.readAsDataURL(new File([a],"",{type:s}))})}function textToBytes(e){return(new TextEncoder).encode(e)}async function saveData(e,t){var r,e=await bytesToBase64DataUrl(textToBytes(JSON.stringify(e)),"application/json");void 0!==t?((r=document.createElement("a")).download=t,r.href=e,r.addEventListener("click",function(e){e.stopPropagation(),this.removeEventListener("click",arguments.callee)}),r.click()):window.open(e)}function sleep(t){return new Promise(e=>setTimeout(e,t))}function rtrim(e,t){if(!e)return e;for(var r=e.length-1;0<=t.indexOf(e[r]);)--r;return e.substr(0,r+1)}function ltrim(e,t){if(!e)return e;for(var r=0;0<=t.indexOf(e[r]);)r+=1;return e.substr(r)}function trim(e,t){return e&<rim(rtrim(e,t),t)}function humanFileSize(e,t=!1,r=1){var a=t?1e3:1024;if(Math.abs(e)<a)return e+" B";var s=t?["kB","MB","GB"]:["KiB","MiB","GiB"];let n=-1;for(var o=10**r;e/=a,++n,Math.round(Math.abs(e)*o)/o>=a&&n<s.length-1;);return e.toFixed(r)+" "+s[n]}async function navigate(e){if(CONFIGS.stop)throw new Error("Stop flag set! Interrupt...");STATS.numRequests++;try{var t,r=await fetch(e);if(r.ok)return t=await r.text(),STATS.numBytesResponseText+=t.length,(new DOMParser).parseFromString(t,"text/html");throw new Error(`Fetching URL ${e}! Status: `+r.status)}catch(e){throw console.error(e),e}}function parseNextPageUrlRelative(e,t,r="div.digg_pagination > a.next_page"){e=(void 0!==e?e:document).querySelector(r)?.attributes?.href?.value;return t=void 0!==t?t:document.location.origin+document.location.pathname,void 0!==e?t+e.substring(2):null}function parsePrevPageUrlRelative(e,t,r="div.digg_pagination > a.previous_page"){e=(void 0!==e?e:document).querySelector(r)?.attributes?.href?.value;return t=void 0!==t?t:document.location.origin+document.location.pathname,void 0!==e?t+e.substring(2):null}function parseNextPageUrlAbsolute(e,t="div.digg_pagination > a.next_page"){e=(void 0!==e?e:document).querySelector(t)?.attributes?.href?.value;return void 0!==e?e:null}function parsePrevPageUrlAbsolute(e,t="div.digg_pagination > a.previous_page"){e=(void 0!==e?e:document).querySelector(t)?.attributes?.href?.value;return void 0!==e?e:null}function parseLastPageNr(e,t="div.digg_pagination > a.next_page",r=null){return Number.parseInt((void 0!==e?e:document).querySelector(t)?.previousElementSibling?.textContent)||r}function parseGrouplist(e){var t={};return(void 0!==e?e:document).querySelectorAll("div.w-blog-content .wpb_text_column .wpb_wrapper ul li a").forEach(e=>{t[e.getAttribute("href").split("/").filter(Boolean).pop()]=e.textContent}),t}function parseSerieslist(e){var r={};return(void 0!==e?e:document).querySelectorAll("div.w-blog-content .search_main_box_nu").forEach(e=>{var t,e={name:e.querySelector(".search_body_nu .search_title a").href.split("/").filter(Boolean).pop(),title:e.querySelector(".search_body_nu .search_title a").textContent,langCode:e.querySelector(".search_img_nu .search_ratings span")?.textContent.toLowerCase()||null,rating:Number.parseFloat(trim(e.querySelector(".search_img_nu .search_ratings").textContent.split(" ")[1],"()")),isCompleted:!!e.querySelector(".search_body_nu .search_genre a.gennew.complete"),genres:Array.from(e.querySelectorAll(".search_body_nu .search_genre a.gennew.search")).filter(e=>e.href.includes("novelupdates.com/genre/")).map(e=>e.href.split("/").filter(Boolean).pop()),numChapters:Number.parseInt(e.querySelector(".search_main_box_nu .search_body_nu .search_stats span:nth-child(1)").textContent.split(" ").filter(Boolean).shift()),updateFrequency:Number.parseFloat(e.querySelector(".search_main_box_nu .search_body_nu .search_stats span:nth-child(2)").textContent.split(" ").filter(Boolean)[1]),numReaders:Number.parseInt(e.querySelector(".search_main_box_nu .search_body_nu .search_stats span:nth-child(3)").textContent.split(" ").filter(Boolean).shift()),numReviews:Number.parseInt(e.querySelector(".search_main_box_nu .search_body_nu .search_stats span:nth-child(4)").textContent.split(" ").filter(Boolean).shift()),lastUpdated:"N/A"===(t=e.querySelector(".search_main_box_nu .search_body_nu .search_stats span:nth-child(5)").textContent.trim())?null:t,summary:(Array.from(e.querySelector(".search_main_box_nu .search_body_nu").childNodes).filter(e=>3===e.nodeType).map(e=>e.textContent).join(" ")+Array.from(e.querySelector(".search_main_box_nu .search_body_nu span.testhide")?.childNodes||[]).filter(e=>3===e.nodeType).map(e=>e.textContent).join(" ")).trim(),imgUrl:"https://cdn.novelupdates.com/imgmid/noimagemid.jpg"===(t=e.querySelector(".search_main_box_nu .search_img_nu img")?.src)?null:t};r[e.name]=e}),r}function parseGroupSeriesUrls(e){var t="div.w-blog-content.group table.groupinfo tr:nth-child(4) td:nth-child(2)",r=[];return(void 0!==e?e:document).querySelectorAll(t+" a").forEach(e=>{e.classList.contains("chosen-single")||r.push(e.getAttribute("href").split("/").filter(Boolean).pop())}),(void 0!==e?e:document).querySelectorAll(t+" select option").forEach(e=>{"---"!==e.value&&r.push(e.value.split("/").filter(Boolean).pop())}),r}function parseGroupDetails(t){t=void 0!==t?t:document;const r="div.w-blog-content.group table.groupinfo";function e(e){return t.querySelector(r+e).textContent}return{name:e(" tr:nth-child(1) td:nth-child(2)"),homepage:t.querySelector(r+" tr:nth-child(2) td:nth-child(2) a")?.href||null,numFollowers:Number.parseInt(e(" tr:nth-child(3) td:nth-child(2)")),numReleases:Number.parseInt(e(" tr:nth-child(5) td:nth-child(2)")),series:parseGroupSeriesUrls(t)}}function parseSeriesDetailsCommunity(r){function e(e){var t=r.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function t(e){var t=r.createElement("div");return t.innerHTML=e,t}r=void 0!==r?r:document;var a=Array.from(r.querySelectorAll(".two-thirds .wpb_wrapper h5.seriesother")).slice(1),s=r.createRange(),n=(s.setStart(a[0].nextSibling,0),s.setEnd(a[1].previousSibling,0),e(s.cloneContents()).split("<br>").map(e=>e.trim()).filter(Boolean).filter(e=>"n/a"!==e.toLowerCase()).map(t).map(e=>({name:e.querySelector("a")?.href.split("/").filter(Boolean).pop(),details:trim(e.querySelector("a")?.nextSibling.textContent.trim(),"()")||null}))),a=(s.setStart(a[1].nextSibling,0),s.setEnd(a[2].previousSibling,0),e(s.cloneContents()).split("<br>").map(e=>e.trim()).filter(Boolean).filter(e=>"n/a"!==e.toLowerCase()).filter(e=>!e.startsWith("Be the first to make a")).map(t).map(e=>({name:e.querySelector("a")?.href.split("/").filter(Boolean).pop(),numUsers:Number.parseInt(trim(e.querySelector("a")?.nextSibling.textContent.trim(),"()"))||0})));return{relatedSeries:n,recommendations:a,recommendationListsFirst:Array.from(r.querySelectorAll(".two-thirds .wpb_text_column .wpb_wrapper ol.ulc_sp li a")).map(e=>e.href.split("/").filter(Boolean).pop()),discussionUrl:r.querySelector(".two-thirds .wpb_text_column .wpb_wrapper .seriesother .nuf_link a")?.href||null}}function parseSeriesRatings(e){var t=trim((e=void 0!==e?e:document).querySelector(".one-third .wpb_text_column .wpb_wrapper h5 > .uvotes")?.textContent.trim(),"()")?.match(/\(?(?<rating>\d\.\d) \/ 5\.0, (?<votes>\d+) votes\)?/)?.groups||{},r=Object.fromEntries(Array.from(e.querySelectorAll(".one-third .wpb_text_column .wpb_wrapper table#myrates span.votetext")).map(e=>trim(e.textContent.trim(),"()")).map(e=>Number.parseInt(e.match(/\(?(?<votes>\d+) votes\)?/)?.groups.votes)||0).reverse().map((e,t)=>[t+1,e]));return{rating:Number.parseFloat(t?.rating)||null,votes:Number.parseInt(t?.votes)||null,votesPerStar:r,numReviews:Number.parseInt(e.querySelector("#comments > div.review-count")?.textContent.split(" ").shift())||null}}function parseSeriesDetails(t){function e(e){return t.querySelector(e)?.href.split("/").filter(Boolean).pop()||null}function r(e){return Array.from(t.querySelectorAll(e)).map(e=>e.href.split("/").filter(Boolean).pop())}function a(e){return"yes"===(e=e.trim().toLowerCase())||"no"!==e&&null}var s={title:(t=void 0!==t?t:document).querySelector(".w-blog-content .seriestitlenu").textContent,language:e(".one-third .wpb_text_column .wpb_wrapper #showlang a.genre.lang"),novelType:e(".one-third .wpb_text_column .wpb_wrapper #showtype a.genre.type"),authors:r(".one-third .wpb_text_column .wpb_wrapper #showauthors a"),artists:r(".one-third .wpb_text_column .wpb_wrapper #showartists a"),genres:r(".one-third .wpb_text_column .wpb_wrapper #seriesgenre a.genre"),tags:r(".one-third .wpb_text_column .wpb_wrapper #showtags a.genre"),imageUrl:"https://www.novelupdates.com/img/noimagefound.jpg"===(s=t.querySelector(".seriesimg img")?.src)?null:s,year:Number.parseInt(t.querySelector(".one-third .wpb_text_column .wpb_wrapper #edityear")?.textContent.trim())||null,status:Array.from(t.querySelectorAll(".one-third .wpb_text_column .wpb_wrapper #editstatus")).map(e=>e.textContent.trim()),licensed:a(t.querySelector(".one-third .wpb_text_column .wpb_wrapper #showlicensed")?.textContent),translated:a(t.querySelector(".one-third .wpb_text_column .wpb_wrapper #showtranslated")?.textContent),publisherOriginal:r(".one-third .wpb_text_column .wpb_wrapper #showopublisher a"),publisherEnglish:r(".one-third .wpb_text_column .wpb_wrapper #showepublisher a"),associatedNames:Array.from(t.querySelectorAll("#editassociated")).map(e=>e.textContent.trim()).filter(e=>"n/a"!==e.toLowerCase()),description:Array.from(t.querySelectorAll("#editdescription p")).map(e=>e.textContent.trim()).filter(e=>"n/a"!==e.toLowerCase()).join("\n")||null};return Object.assign(s,parseSeriesDetailsCommunity(t)),Object.assign(s,{ratings:parseSeriesRatings(t)}),s}function parseSeriesChapterList(e){return Array.from((void 0!==e?e:document).querySelectorAll(".w-blog-content .two-thirds .wpb_text_column .wpb_wrapper table tr")).slice(1).map(e=>{return{date:(t=(t=e.querySelector("td:nth-child(1)").textContent.trim()).split("/"),new Date(2e3+Number.parseInt(t[2],10),Number.parseInt(t[0],10)-1,Number.parseInt(t[1],10))),group:e.querySelector("td:nth-child(2) a")?.href.split("/").filter(Boolean).pop()||null,title:(e.querySelector("td:nth-child(3) span")||e.querySelector("td:nth-child(3) a"))?.textContent.trim(),url:(t=e.querySelector("td:nth-child(3) a")?.href)&&t.split("/").filter(Boolean).pop()||null};var t})}function parseSeriesReviews(e){return e=void 0!==e?e:document,Array.from(e.querySelectorAll("#comments > div.w-comments-list > div.w-comments-item")).map(e=>{var t,r,a=Number.parseInt(e.id.slice(8));return{id:a,num_liked:Number.parseInt(e.nextElementSibling.querySelector(".liked_"+a)?.textContent||0),reviewer_name:e.querySelector("a#revname.revname"+a)?.textContent.trim()||null,reviewer_id:e.querySelector("a#revname.revname"+a)?.href.split("/").filter(Boolean).slice(-2).join("/")||null,num_stars:e.querySelectorAll(".w-comments-item-meta-new i.fa.fa-star").length,date:(t=e.querySelector(".w-comments-item-meta-new > table > tbody > tr > td:nth-child(2) > div:nth-child(1)")?.textContent)?(t=Date.parse(t),r=-(new Date).getTimezoneOffset()/60*1e3*3600,new Date(t+r).toISOString()):null,reading_status:(!(t=e.querySelector("#stat"+a)?.textContent.trim())||"-"===t?null:"Completed"===t||t)||null,content_html:(r=e.querySelector(".w-comments-item-text"))?(a=r.querySelector('span[style="display:none"]'))?(r.querySelector("span.dots").remove(),Array.from(r.querySelectorAll("span.morelink")).forEach(e=>e.remove()),a.remove(),r?.innerHTML.trim()+a.innerHTML.trimRight()):r?.innerHTML.trim():null}})}function parseGenrelist(e){let t={};return(void 0!==e?e:document).querySelectorAll(".w-blog-content table tr").forEach(e=>{e.querySelector("b.genreexplain")&&(t[e.querySelector("b.genreexplain a").href.split("/").filter(Boolean).pop()]={title:e.querySelector("b.genreexplain a").textContent.trim(),description:e.querySelector("td:nth-child(2)").textContent.trim()})}),t}function parseTaglist(e){let r={};return(void 0!==e?e:document).querySelectorAll(".w-blog-content .staglistall .one-half ul > li").forEach(e=>{var t,e=e.querySelector("a");r[e.href.split("/").filter(Boolean).pop()]={title:e.textContent.trim(),description:!(t=e?.title.trim())||"N/A"===t||"No definition found."===t||t.startsWith("Locked. Propose a definition here:")?null:t,count:Number.parseInt(trim(e.nextSibling.textContent," ()"))||null}}),r}async function scrapeGrouplist(){var e="scrapeGrouplist-finished",t="scrapeGrouplist-curUrl",r="scrapeGrouplist-groupMap",a=await localforage.getItem(r)||{};let s=await localforage.getItem(t)||URL_GROUPLIST;for(await localforage.removeItem(e);null!==s;){await localforage.setItem(t,s);await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay));var n=await navigate(s),o=parseGrouplist(n),n=parseNextPageUrlRelative(n,URL_GROUPLIST);Object.assign(a,o),await localforage.setItem(r,a),STATS.numGroups=Object.keys(a).length,s=n}return await localforage.setItem(e,new Date),a}async function scrapeGroupDetails(e){var t,r="scrapeGroupDetails-finished",a="scrapeGroupDetails-groupInfoMap",s=await localforage.getItem(a)||{};console.debug("Processing group details of",e),STATS.numGroupInfosTotal=e.length,STATS.numGroupInfos=Object.keys(s).length,await localforage.removeItem(r);for(const n of e)n in s?console.debug(`Found group details for key '${n}'. Skipping ...`):(STATS.numGroupInfos++,await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay)),t=parseGroupDetails(await navigate(URL_GROUPDETAILS_TEMPL.replace("{name}",n))),Object.assign(s,{[n]:t}),await localforage.setItem(a,s));return await localforage.setItem(r,new Date),s}async function scrapeSerieslist(){var e="scrapeSerieslist-finished",t="scrapeSerieslist-curUrl",r="scrapeSerieslist-seriesMap",a=await localforage.getItem(r)||{};let s=await localforage.getItem(t)||URL_SERIESLIST,n=[];for(await localforage.removeItem(e);null!==s;){await localforage.setItem(t,s);await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay));var o=await navigate(s),i=parseSerieslist(o),l=parseNextPageUrlAbsolute(o),l=(Object.assign(a,i),await localforage.setItem(r,a),STATS.numSeries=Object.keys(a).length,s=l,Object.keys(i).filter(e=>!n.includes(e)));n=l.length!==Object.keys(i).length?(console.log("Found rank change in series list. New Series:",l,"Known ones:",Object.keys(i).filter(e=>n.includes(e))),(l=parsePrevPageUrlAbsolute(o))&&(s=l),[]):Object.keys(i)}return await localforage.setItem(e,new Date),a}async function scrapeSeriesDetails(e){var t,r="scrapeSeriesDetails-finished",a="scrapeSeriesDetails-seriesInfoMap",s=await localforage.getItem(a)||{};console.debug("Processing series details of",e),STATS.numSeriesInfosTotal=e.length,await localforage.removeItem(r);for(const n of e)n in s?console.debug(`Found series details for key '${n}'. Skipping ...`):(await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay)),t=parseSeriesDetails(await navigate(URL_SERIES_TEMPL.replace("{name}",n))),Object.assign(s,{[n]:t}),STATS.numSeriesInfos=Object.keys(s).length,await localforage.setItem(a,s));return await localforage.setItem(r,new Date),s}async function scrapeSeriesChapterList(e){var t=URL_SERIES_TEMPL.replace("{name}",e),r="scrapeSeriesChapterList-seriesId",a="scrapeSeriesChapterList-curUrl",s="scrapeSeriesChapterList-chapterList",n=await localforage.getItem(r);null!==n&&n!==e&&(console.debug(`Found possibly stale data in STORE for seriesId: '${e}'`,n,await localforage.getItem(a),await localforage.getItem(s)),await localforage.removeItem(s),await localforage.removeItem(a)),await localforage.setItem(r,e);let o=await localforage.getItem(s)||[],i=await localforage.getItem(a)||t;for(;null!==i;){await localforage.setItem(a,i);await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay));var l=await navigate(i),c=parseSeriesChapterList(l),l=parseNextPageUrlRelative(l,t);o=o.concat(c),await localforage.setItem(s,o),i=l}return o}async function scrapeAllSeriesChapterList(e){var t,r="scrapeAllSeriesChapterList-finished",a="scrapeAllSeriesChapterList-seriesChapterListMap",s=await localforage.getItem(a)||{};console.debug("Processing series chapter lists of",e),STATS.numSeriesForChaptersTotal=e.length,STATS.numSeriesForChapters=Object.keys(s).length,await localforage.removeItem(r);for(const n of e)n in s?console.debug(`Found series chapter list for key '${n}'. Skipping ...`):(STATS.numSeriesForChapters++,t=await scrapeSeriesChapterList(n),Object.assign(s,{[n]:t}),STATS.numChapters=Object.values(s).map(e=>e.length).reduce((e,t)=>e+t,0),await localforage.setItem(a,s));return await localforage.setItem(r,new Date),s}async function scrapeSeriesReviews(e){var t=URL_SERIES_TEMPL.replace("{name}",e),r="scrapeSeriesReviews-seriesId",a="scrapeSeriesReviews-curUrl",s="scrapeSeriesReviews-reviewsList",n=await localforage.getItem(r);null!==n&&n!==e&&(console.debug(`Found possibly stale data in STORE for seriesId: '${e}'`,n,await localforage.getItem(a),await localforage.getItem(s)),await localforage.removeItem(s),await localforage.removeItem(a)),await localforage.setItem(r,e);let o=await localforage.getItem(s)||[],i=await localforage.getItem(a)||t;for(;null!==i;){await localforage.setItem(a,i);await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay));var l=await navigate(i),c=parseSeriesReviews(l),l=parseNextPageUrlAbsolute(l,"#comments .mb_review_pagination .w-comments-pagination a.next.page-numbers");o=o.concat(c),await localforage.setItem(s,o),i=l}return o}async function scrapeAllSeriesReviews(e){var t,r="scrapeAllSeriesReviews-finished",a="scrapeAllSeriesReviews-seriesReviewsMap",s=await localforage.getItem(a)||{};console.debug("Processing series reviews of",e),STATS.numSeriesForReviewsTotal=e.length,STATS.numSeriesForReviews=Object.keys(s).length,await localforage.removeItem(r);for(const n of e)n in s?console.debug(`Found series reviews for key '${n}'. Skipping ...`):(STATS.numSeriesForReviews++,t=await scrapeSeriesReviews(n),Object.assign(s,{[n]:t}),STATS.numReviews=Object.values(s).map(e=>e.length).reduce((e,t)=>e+t,0),await localforage.setItem(a,s));return await localforage.setItem(r,new Date),s}async function scrapeGenres(){var e=parseGenrelist(await navigate(URL_GENRELIST));return await localforage.setItem("scrapeGenres-genresMap",e),STATS.numGenres=Object.keys(e).length,await localforage.setItem("scrapeGenres-finished",new Date),e}async function scrapeTags(){var e="scrapeTags-finished",t="scrapeTags-curUrl",r="scrapeTags-tagsMap",a=await localforage.getItem(r)||{};let s=await localforage.getItem(t)||URL_TAGLIST;for(await localforage.removeItem(e);null!==s;){await localforage.setItem(t,s);await sleep(Math.floor(CONFIGS.requestDelay/2+Math.random()*CONFIGS.requestDelay));var n=await navigate(s),o=parseTaglist(n),n=parseNextPageUrlAbsolute(n);Object.assign(a,o),await localforage.setItem(r,a),STATS.numTags=Object.keys(a).length,s=n}return await localforage.setItem(e,new Date),a}function filterMultiAuthorSeriesByGroupDetails(e){return Object.fromEntries(Object.entries(Object.entries(e).map(([e,t])=>[e,t.series]).reduce((t,[r,e])=>((e||[]).forEach(e=>(t[e]||(t[e]=[])).push(r)),t),{})).filter(([,e])=>2<=e.length))}async function runGrouplistScraper(){var t=document.getElementById("runGrouplistScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runGrouplistScraper] already running?!");else{setTaskStatusWorking(t);try{await saveData(await scrapeGrouplist(),"groups.json"),setTaskStatusSuccess(t),setHasData(t),document.getElementById(ID_SCRAPERLET).classList.add("has-groups")}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runGroupDetailsScraper(){var t=document.getElementById("runGroupDetailsScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runGroupDetailsScraper] already running?!");else{setTaskStatusWorking(t);var e=await localforage.getItem("scrapeGrouplist-groupMap");if(null===e)console.warn("[runGroupDetailsScraper] No 'groupMap' found in STORE! Try to first scrape the Group List!"),setTaskStatusError(t,"Error: No 'groupMap' found in STORE! Try to first scrape the Group List!");else try{var r=await scrapeGroupDetails(Object.keys(e).sort());await saveData(r,"groupDetails.json"),await localforage.setItem(KEY_STORE_SERIESIDS,Object.values(r).map(e=>e.series).flat(1/0)),await localforage.setItem(KEY_STORE_SERIESIDS_SOURCE,"runGroupDetailsScraper"),STATS.numSeriesForCrawl=(await localforage.getItem(KEY_STORE_SERIESIDS)||[]).length,document.getElementById(ID_SCRAPERLET).classList.add("has-groups-details"),document.getElementById(ID_SCRAPERLET).classList.add("has-series"),setTaskStatusSuccess(t),setHasData(t)}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runFindMASeries(){var e,t=document.getElementById("runFindMASeries");null===t||t.hasAttribute("disabled")?console.warn("[runFindMASeries] already running?!"):(setTaskStatusWorking(t),null===(e=await localforage.getItem("scrapeGroupDetails-groupInfoMap"))?(console.warn("[runFindMASeries] No 'groupInfoMap' found in STORE! Try to first scrape the Group List, and then Group Details!"),setTaskStatusError(t,"Error: No 'groupInfoMap' found in STORE! Try to first scrape the Group List, and then Group Details!")):(await saveData(e=filterMultiAuthorSeriesByGroupDetails(e),"multi_groups_series.json"),await localforage.setItem(KEY_STORE_SERIESIDS,Object.keys(e)),await localforage.setItem(KEY_STORE_SERIESIDS_SOURCE,"runFindMASeries"),STATS.numSeriesForCrawl=Object.keys(e).length,document.getElementById(ID_SCRAPERLET).classList.add("has-series")),setTaskStatusSuccess(t),setHasData(t))}async function runSerieslistScraper(){var t=document.getElementById("runSerieslistScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runSerieslistScraper] already running?!");else{setTaskStatusWorking(t);try{var e=await scrapeSerieslist();await saveData(e,"series.json"),await localforage.setItem(KEY_STORE_SERIESIDS,Object.keys(e)),await localforage.setItem(KEY_STORE_SERIESIDS_SOURCE,"runSerieslistScraper"),STATS.numSeriesForCrawl=Object.keys(e).length,setTaskStatusSuccess(t),setHasData(t),document.getElementById(ID_SCRAPERLET).classList.add("has-series")}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runSeriesDetailsScraper(){var t=document.getElementById("runSeriesDetailsScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runSeriesDetailsScraper] already running?!");else{setTaskStatusWorking(t);var e=await localforage.getItem(KEY_STORE_SERIESIDS);if(null===e)console.warn("[runSeriesDetailsScraper] No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!"),setTaskStatusError(t,"Error: No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!");else try{e.sort(),await saveData(await scrapeSeriesDetails(e),"seriesDetails.json"),setTaskStatusSuccess(t),setHasData(t)}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runChapterLinksScraper(){var t=document.getElementById("runChapterLinksScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runChapterLinksScraper] already running?!");else{setTaskStatusWorking(t);var e=await localforage.getItem(KEY_STORE_SERIESIDS);if(null===e)console.warn("[runChapterLinksScraper] No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!"),setTaskStatusError(t,"Error: No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!");else try{e.sort(),await saveData(await scrapeAllSeriesChapterList(e),"chapters.json"),setTaskStatusSuccess(t),setHasData(t),document.getElementById(ID_SCRAPERLET).classList.add("has-chapter-links")}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runChapterLinkResolver(){var e=await localforage.getItem("scrapeAllSeriesChapterList-seriesChapterListMap")||{};throw await saveData(Object.values(e).flat().map(e=>e?.url.split("/").filter(Boolean).pop()).filter(Boolean),"extnu.json"),new Error("Not possible currently.")}async function runSeriesReviewsScraper(){var t=document.getElementById("runSeriesReviewsScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runSeriesReviewsScraper] already running?!");else{setTaskStatusWorking(t);var e=await localforage.getItem(KEY_STORE_SERIESIDS);if(null===e)console.warn("[runSeriesReviewsScraper] No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!"),setTaskStatusError(t,"Error: No 'seriesIds' found in STORE! Try to first scrape the [Group List, then Group Infos or Find Multi Author Series] / [Series List]!");else try{e.sort(),await saveData(await scrapeAllSeriesReviews(e),"reviews.json"),setTaskStatusSuccess(t),setHasData(t)}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runGenrelistScraper(){var t=document.getElementById("runGenrelistScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runGenrelistScraper] already running?!");else{setTaskStatusWorking(t);try{await saveData(await scrapeGenres(),"genres.json"),setTaskStatusSuccess(t),setHasData(t)}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function runTaglistScraper(){var t=document.getElementById("runTaglistScraper");if(null===t||t.hasAttribute("disabled"))console.warn("[runTaglistScraper] already running?!");else{setTaskStatusWorking(t);try{await saveData(await scrapeTags(),"tags.json"),setTaskStatusSuccess(t),setHasData(t)}catch(e){console.error(e),setTaskStatusError(t,e)}}}async function doDownload(e){document.getElementById("runGrouplistScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeGrouplist-groupMap"),"groups.json"):document.getElementById("runGroupDetailsScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeGroupDetails-groupInfoMap"),"groupDetails.json"):document.getElementById("runFindMASeries").contains(e.target)?await saveData(filterMultiAuthorSeriesByGroupDetails(await localforage.getItem("scrapeGroupDetails-groupInfoMap")),"multi_groups_series.json"):document.getElementById("runSerieslistScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeSerieslist-seriesMap"),"series.json"):document.getElementById("runSeriesDetailsScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeSeriesDetails-seriesInfoMap"),"seriesDetails.json"):document.getElementById("runChapterLinksScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeAllSeriesChapterList-seriesChapterListMap"),"chapters.json"):document.getElementById("runChapterLinkResolver").contains(e.target)||(document.getElementById("runSeriesReviewsScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeAllSeriesReviews-seriesReviewsMap"),"reviews.json"):document.getElementById("runGenrelistScraper").contains(e.target)?await saveData(await localforage.getItem("scrapeGenres-genresMap"),"genres.json"):document.getElementById("runTaglistScraper").contains(e.target)&&await saveData(await localforage.getItem("scrapeTags-tagsMap"),"tags.json"))}async function doDataDelete(e){document.getElementById("runGrouplistScraper").contains(e.target)?(await localforage.removeItem("scrapeGrouplist-finished"),await localforage.removeItem("scrapeGrouplist-curUrl"),await localforage.removeItem("scrapeGrouplist-groupMap"),document.getElementById("runGrouplistScraper").classList.remove("has-data")):document.getElementById("runGroupDetailsScraper").contains(e.target)?(await localforage.removeItem("scrapeGroupDetails-finished"),await localforage.removeItem("scrapeGroupDetails-groupInfoMap"),document.getElementById("runGroupDetailsScraper").classList.remove("has-data")):document.getElementById("runFindMASeries").contains(e.target)||(document.getElementById("runSerieslistScraper").contains(e.target)?(await localforage.removeItem("scrapeSerieslist-finished"),await localforage.removeItem("scrapeSerieslist-curUrl"),await localforage.removeItem("scrapeSerieslist-seriesMap"),document.getElementById("runSerieslistScraper").classList.remove("has-data")):document.getElementById("runSeriesDetailsScraper").contains(e.target)?(await localforage.removeItem("scrapeSeriesDetails-finished"),await localforage.removeItem("scrapeSeriesDetails-seriesInfoMap"),document.getElementById("runSeriesDetailsScraper").classList.remove("has-data")):document.getElementById("runChapterLinksScraper").contains(e.target)?(await localforage.removeItem("scrapeAllSeriesChapterList-finished"),await localforage.removeItem("scrapeAllSeriesChapterList-seriesChapterListMap"),await localforage.removeItem("scrapeSeriesChapterList-seriesId"),await localforage.removeItem("scrapeSeriesChapterList-curUrl"),await localforage.removeItem("scrapeSeriesChapterList-chapterList"),document.getElementById("runChapterLinksScraper").classList.remove("has-data")):document.getElementById("runChapterLinkResolver").contains(e.target)||(document.getElementById("runSeriesReviewsScraper").contains(e.target)?(await localforage.removeItem("scrapeAllSeriesReviews-finished"),await localforage.removeItem("scrapeAllSeriesReviews-seriesReviewsMap"),await localforage.removeItem("scrapeSeriesReviews-seriesId"),await localforage.removeItem("scrapeSeriesReviews-curUrl"),await localforage.removeItem("scrapeSeriesReviews-reviewsList"),document.getElementById("runSeriesReviewsScraper").classList.remove("has-data")):document.getElementById("runGenrelistScraper").contains(e.target)?(await localforage.removeItem("scrapeGenres-finished"),await localforage.removeItem("scrapeGenres-genresMap"),document.getElementById("runGenrelistScraper").classList.remove("has-data")):document.getElementById("runTaglistScraper").contains(e.target)&&(await localforage.removeItem("scrapeTags-finished"),await localforage.removeItem("scrapeTags-curUrl"),await localforage.removeItem("scrapeTags-tagsMap"),document.getElementById("runTaglistScraper").classList.remove("has-data"))))}function updateStopFlag(){CONFIGS.stop=document.querySelector(`#${ID_SCRAPERLET} input[type="checkbox"][name="stop"]`).checked}function updateRequestDelay(){CONFIGS.requestDelay=Number.parseInt(document.querySelector(`#${ID_SCRAPERLET} input[type="text"][name="delay"]`).value)}function updateBlockClicksFlag(){CONFIGS.blockLeavePage=document.querySelector(`#${ID_SCRAPERLET} input[type="checkbox"][name="clicks"]`).checked,CONFIGS.blockLeavePage?(document.body.style.pointerEvents="none",window.disablePageClicksHandler=disablePageClicksHandler,document.body.addEventListener("click",disablePageClicksHandler,!0)):(document.body.style.removeProperty("pointer-events"),document.body.removeEventListener("click",disablePageClicksHandler),delete window.disablePageClicksHandler)}function disablePageClicksHandler(e){return!CONFIGS.blockLeavePage||document.getElementById(ID_SCRAPERLET).contains(e.target)?void 0:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1)}function updateStats(e){void 0!==e&&"numRequests"!==e||(document.querySelector(`#${ID_SCRAPERLET} .stats-requests`).innerHTML=`<b>${STATS.numRequests.toLocaleString()}</b>`),void 0!==e&&"numBytesResponseText"!==e||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-response-bytes`),{innerHTML:`<b>${humanFileSize(STATS.numBytesResponseText)}</b>`,title:STATS.numBytesResponseText+" bytes received (content only)"}),void 0!==e&&"numGroups"!==e||null===STATS.numGroups||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-groups`),{innerHTML:`<b>${STATS.numGroups.toLocaleString()}</b>`,hidden:null===STATS.numGroups}),void 0!==e&&"numGroupInfos"!==e&&"numGroupInfosTotal"!==e||null===STATS.numGroupInfos||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-groups-infos`),{innerHTML:`<b>${STATS.numGroupInfos.toLocaleString()}</b> / <b>${(STATS.numGroupInfosTotal||STATS.numGroupInfos).toLocaleString()}</b>`,hidden:null===STATS.numGroupInfos}),void 0!==e&&"numSeries"!==e||null===STATS.numSeries||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-series`),{innerHTML:`<b>${STATS.numSeries.toLocaleString()}</b>`,hidden:null===STATS.numSeries}),void 0!==e&&"numSeriesForCrawl"!==e||null===STATS.numSeriesForCrawl||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-series-ids`),{innerHTML:`<b>${STATS.numSeriesForCrawl.toLocaleString()}</b>`,hidden:null===STATS.numSeriesForCrawl}),void 0!==e&&"numSeriesInfos"!==e&&"numSeriesInfosTotal"!==e||null===STATS.numSeriesInfos||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-series-infos`),{innerHTML:`<b>${STATS.numSeriesInfos.toLocaleString()}</b> / <b>${(STATS.numSeriesInfosTotal||STATS.numSeriesInfos).toLocaleString()}</b>`,hidden:null===STATS.numSeriesInfos}),void 0!==e&&"numChapters"!==e||null===STATS.numChapters||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-chapters`),{innerHTML:`<b>${STATS.numChapters.toLocaleString()}</b>`,hidden:null===STATS.numChapters}),void 0!==e&&"numSeriesForChapters"!==e&&"numSeriesForChaptersTotal"!==e||null===STATS.numSeriesForChapters||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-chapters-series-progress`),{innerHTML:`<b>${STATS.numSeriesForChapters.toLocaleString()}</b> / <b>${(STATS.numSeriesForChaptersTotal||STATS.numSeriesForChapters).toLocaleString()}</b>`,hidden:null===STATS.numSeriesForChapters}),void 0!==e&&"numChapterLinksResolved"!==e&&"numChapters"!==e||null===STATS.numChapterLinksResolved||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-chapter-links`),{innerHTML:`<b>${STATS.numChapterLinksResolved.toLocaleString()}</b> / <b>${(STATS.numChapters||STATS.numChapterLinksResolved).toLocaleString()}</b>`,hidden:null===STATS.numChapterLinksResolved}),void 0!==e&&"numReviews"!==e||null===STATS.numReviews||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-reviews`),{innerHTML:`<b>${STATS.numReviews.toLocaleString()}</b>`,hidden:null===STATS.numReviews}),void 0!==e&&"numSeriesForReviews"!==e&&"numSeriesForReviewsTotal"!==e||null===STATS.numSeriesForReviews||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-reviews-series-progress`),{innerHTML:`<b>${STATS.numSeriesForReviews.toLocaleString()}</b> / <b>${(STATS.numSeriesForReviewsTotal||STATS.numSeriesForReviews).toLocaleString()}</b>`,hidden:null===STATS.numSeriesForReviews}),void 0!==e&&"numGenres"!==e||null===STATS.numGenres||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-genres`),{innerHTML:`<b>${STATS.numGenres.toLocaleString()}</b>`,hidden:null===STATS.numGenres}),void 0!==e&&"numTags"!==e||null===STATS.numTags||Object.assign(document.querySelector(`#${ID_SCRAPERLET} .stats-tags`),{innerHTML:`<b>${STATS.numTags.toLocaleString()}</b>`,hidden:null===STATS.numTags}),void 0===e&&(document.querySelector(`#${ID_SCRAPERLET} .stats-groups`).hidden=null===STATS.numGroups,document.querySelector(`#${ID_SCRAPERLET} .stats-groups-infos`).hidden=null===STATS.numGroupInfos,document.querySelector(`#${ID_SCRAPERLET} .stats-series`).hidden=null===STATS.numSeries,document.querySelector(`#${ID_SCRAPERLET} .stats-series-ids`).hidden=null===STATS.numSeriesForCrawl,document.querySelector(`#${ID_SCRAPERLET} .stats-series-infos`).hidden=null===STATS.numSeriesInfos,document.querySelector(`#${ID_SCRAPERLET} .stats-chapters`).hidden=null===STATS.numChapters,document.querySelector(`#${ID_SCRAPERLET} .stats-chapters-series-progress`).hidden=null===STATS.numSeriesForChapters,document.querySelector(`#${ID_SCRAPERLET} .stats-chapter-links`).hidden=null===STATS.numChapterLinksResolved,document.querySelector(`#${ID_SCRAPERLET} .stats-reviews`).hidden=null===STATS.numReviews,document.querySelector(`#${ID_SCRAPERLET} .stats-reviews-series-progress`).hidden=null===STATS.numSeriesForReviews,document.querySelector(`#${ID_SCRAPERLET} .stats-genres`).hidden=null===STATS.numGenres,document.querySelector(`#${ID_SCRAPERLET} .stats-tags`).hidden=null===STATS.numTags)}function setTaskStatusWorking(e){e.setAttribute("disabled","disabled"),e.classList.add("working"),e.classList.remove("success","error");e=e.querySelector(".status");e.textContent="🏭",e.removeAttribute("title")}function setTaskStatusSuccess(e){e.removeAttribute("disabled"),e.classList.remove("working"),e.classList.add("success");e=e.querySelector(".status");e.textContent="✅",e.removeAttribute("title")}function setTaskStatusError(e,t=null){e.removeAttribute("disabled"),e.classList.remove("working"),e.classList.add("error");e=e.querySelector(".status");e.textContent="⚠️",e.title=t}function setHasData(e){e.classList.add("has-data")}async function setStatsFromStorage(){var e=await localforage.getItem(KEY_STORE_STATS)||{};Object.entries(e).forEach(([e,t])=>{null!==t&&0!==t&&(STATS[e]=t)})}async function backupStorageStats(){var e=await localforage.getItem(KEY_STORE_STATS_HISTORY)||[],t=await localforage.getItem(KEY_STORE_STATS);null!==t&&(e.push([new Date,t]),await localforage.setItem(KEY_STORE_STATS_HISTORY,e))}async function setHasDataFromStorage(){await localforage.getItem("scrapeGrouplist-groupMap")&&(document.getElementById("runGrouplistScraper").classList.add("has-data"),await localforage.getItem("scrapeGrouplist-finished")||!1)&&(setTaskStatusSuccess(document.getElementById("runGrouplistScraper")),document.getElementById(ID_SCRAPERLET).classList.add("has-groups")),await localforage.getItem("scrapeGroupDetails-groupInfoMap")&&(document.getElementById("runGroupDetailsScraper").classList.add("has-data"),await localforage.getItem("scrapeGroupDetails-finished")||!1)&&(document.getElementById("runFindMASeries").classList.add("has-data"),setTaskStatusSuccess(document.getElementById("runGroupDetailsScraper")),document.getElementById(ID_SCRAPERLET).classList.add("has-groups-details"),document.getElementById(ID_SCRAPERLET).classList.add("has-series")),await localforage.getItem("scrapeSerieslist-seriesMap")&&(document.getElementById("runSerieslistScraper").classList.add("has-data"),await localforage.getItem("scrapeSerieslist-finished")||!1)&&(setTaskStatusSuccess(document.getElementById("runSerieslistScraper")),document.getElementById(ID_SCRAPERLET).classList.add("has-series")),await localforage.getItem("scrapeSeriesDetails-seriesInfoMap")&&(document.getElementById("runSeriesDetailsScraper").classList.add("has-data"),await localforage.getItem("scrapeSeriesDetails-finished")||!1)&&setTaskStatusSuccess(document.getElementById("runSeriesDetailsScraper")),await localforage.getItem("scrapeAllSeriesChapterList-seriesChapterListMap")&&(document.getElementById("runChapterLinksScraper").classList.add("has-data"),document.getElementById(ID_SCRAPERLET).classList.add("has-chapter-links"),await localforage.getItem("scrapeAllSeriesChapterList-finished")||!1)&&(setTaskStatusSuccess(document.getElementById("runChapterLinksScraper")),document.getElementById(ID_SCRAPERLET).classList.add("has-chapter-links")),(await localforage.getItem("scrapeAllSeriesReviews-seriesReviewsMap")||{})&&(document.getElementById("runSeriesReviewsScraper").classList.add("has-data"),await localforage.getItem("scrapeAllSeriesReviews-finished")||!1)&&setTaskStatusSuccess(document.getElementById("runSeriesReviewsScraper")),await localforage.getItem("scrapeGenres-genresMap")&&(document.getElementById("runGenrelistScraper").classList.add("has-data"),await localforage.getItem("scrapeGenres-finished")||!1)&&setTaskStatusSuccess(document.getElementById("runGenrelistScraper"));await localforage.getItem("scrapeTags-tagsMap")&&(document.getElementById("runTaglistScraper").classList.add("has-data"),await localforage.getItem("scrapeTags-finished")||!1)&&setTaskStatusSuccess(document.getElementById("runTaglistScraper"))}function buildMenu(){var e=` | |
/* https://stackoverflow.com/a/60660207/9360161 */ | |
@media (pointer: coarse), (hover: none) { | |
[title] { | |
position: relative; | |
display: inline-flex; | |
justify-content: center; | |
} | |
[title]:focus::after { | |
content: attr(title); | |
position: absolute; | |
top: 90%; | |
color: #000; | |
background-color: #fff; | |
border: 1px solid; | |
width: fit-content; | |
padding: 3px; | |
} | |
} | |
#${ID_SCRAPERLET} { | |
pointer-events: auto; | |
position: absolute; /* fixed */ | |
z-index: 1000; | |
top: 0; | |
right: 0; | |
background-color: #2c3e50; | |
color: #fff; | |
border: 1px #e8ebee solid; | |
border-radius: 5px; | |
width: max-content; | |
height: min-content; | |
margin: 1em; | |
padding: 1em; | |
} | |
#${ID_SCRAPERLET} h1 { | |
font-size: 1.8rem; | |
font-family: "Open Sans",sans-serif; | |
font-weight: 700; | |
color: rgba(255,255,255,.87); | |
text-decoration: none; | |
border-bottom: 1px solid #c3d7eb; | |
padding-bottom: 3px; | |
margin: 0 0 15px 0; | |
} | |
#${ID_SCRAPERLET} h2 { | |
font-size: 1.1rem; | |
color: rgba(255,255,255,.87); | |
text-decoration: none; | |
border-top: 1px solid #c3d7eb; | |
padding-top: 3px; | |
margin: 15px 0 0 0; | |
} | |
#${ID_SCRAPERLET} input[type="checkbox"] { | |
position: unset; | |
left: unset; | |
margin: 0 1ex 0 0; | |
} | |
#${ID_SCRAPERLET} input[type="checkbox"] + label { | |
position: unset; | |
left: unset; | |
margin: unset; | |
padding: unset; | |
} | |
#${ID_SCRAPERLET} input[type="checkbox"] + label::before, | |
#${ID_SCRAPERLET} input[type="checkbox"] + label::after { | |
display: none; | |
} | |
#${ID_SCRAPERLET} input[type="text"] { | |
position: unset; | |
left: unset; | |
height: unset; | |
line-height: unset; | |
font-size: unset; | |
padding: 0 10px; | |
margin: 0 0 0 10px; | |
text-align: end; | |
width: 5em; | |
} | |
#${ID_SCRAPERLET} .btn { | |
border: 1px solid #4b627a; | |
padding: 0px 9px; | |
cursor: pointer; | |
} | |
#${ID_SCRAPERLET} .btn:hover { | |
background-color: #314961; | |
} | |
#${ID_SCRAPERLET} ul.actions { | |
list-style: none; | |
margin: 4px 0 0 10px; | |
padding: 0; | |
} | |
#${ID_SCRAPERLET} ul.actions > li { | |
margin-bottom: 4px; | |
display: flex; | |
} | |
#${ID_SCRAPERLET} ul.actions > li.l1 { | |
margin-left: 9px; | |
} | |
#${ID_SCRAPERLET} ul.actions > li.l2 { | |
margin-left: 18px; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span { | |
margin-block: auto; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.action { | |
margin-right: auto; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.action ~ span { | |
margin-left: 3px; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.status { | |
margin-left: 6px; | |
padding: 0 3px; | |
} | |
#${ID_SCRAPERLET} ul.actions > li:not(.has-data) span.action ~ span.icon.btn, | |
#${ID_SCRAPERLET} ul.actions > li.no-cache span.action ~ span.icon.btn, | |
#${ID_SCRAPERLET}.delete-not-allowed ul.actions > li span.icon.btn.delete { | |
opacity: 0.3; | |
pointer-events: none; | |
cursor: not-allowed; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.icon { | |
width: 2rem; | |
padding: 0; | |
text-align: center; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.icon::before { | |
content: " "; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.icon.download::before { | |
content: "📥"; | |
} | |
#${ID_SCRAPERLET} ul.actions > li span.icon.delete::before { | |
content: "🗙"; | |
} | |
#${ID_SCRAPERLET} ul.actions > li.working span.action, | |
#${ID_SCRAPERLET}:not(.has-groups) #runGroupDetailsScraper span.action, | |
#${ID_SCRAPERLET}:not(.has-groups-details) #runFindMASeries span.action, | |
#${ID_SCRAPERLET}:not(.has-series) #runSeriesDetailsScraper span.action, | |
#${ID_SCRAPERLET}:not(.has-series) #runChapterLinksScraper span.action, | |
#${ID_SCRAPERLET}:not(.has-chapter-links) #runChapterLinkResolver span.action, | |
#${ID_SCRAPERLET}:not(.has-series) #runSeriesReviewsScraper span.action { | |
pointer-events: none; | |
color: #a8a8a8; | |
} | |
#${ID_SCRAPERLET} ul.stats { | |
list-style: square inside; | |
margin-left: 9px; | |
font-size: 0.8rem; | |
line-height: 1rem; | |
} | |
#${ID_SCRAPERLET} ul.stats > li.sep-above { | |
position: relative; | |
margin-top: 5px; | |
} | |
#${ID_SCRAPERLET} ul.stats > li.sep-above::before { | |
position: absolute; | |
top: -3px; | |
left: 4%; | |
content: ""; | |
border-top: 1px solid aliceblue; | |
width: 92%; | |
height: 0.6rem; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-requests::after { | |
content: " Requests Sent"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-response-bytes::after { | |
content: " Received"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-groups::after { | |
content: " Groups Found"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-groups-infos::after { | |
content: " Group Details Scraped"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-series::after { | |
content: " Series Found"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-series-ids::after { | |
content: " Series IDs for Crawls"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-series-infos::after { | |
content: " Series Details Scraped"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-chapters::after { | |
content: " Chapters Found"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-chapters-series-progress::after { | |
content: " Series for Chapters Processed"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-chapter-links::after { | |
content: " Chapter Links Resolved"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-reviews::after { | |
content: " Reviews Found"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-reviews-series-progress::after { | |
content: " Series for Reviews Processed"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-genres::after { | |
content: " Genres Found"; | |
} | |
#${ID_SCRAPERLET} ul.stats > .stats-tags::after { | |
content: " Tags Found"; | |
} | |
#${ID_SCRAPERLET} div.configs { | |
margin-left: 9px; | |
font-size: 0.8rem; | |
line-height: 1.2rem; | |
} | |
`,t=document.createElement("style"),e=(t.id=ID_SCRAPERLET+"-style",t.innerText=e,document.getElementsByTagName("head")[0].appendChild(t),` | |
<span class="status" tabindex="0"></span> | |
<span class="icon btn download" onclick="doDownload(event)"></span> | |
<span class="icon btn delete" onclick="doDataDelete(event)"></span> | |
`.trim()),t=`<h1>NU Scraper</h1> | |
<ul class="actions"> | |
<li id="runGrouplistScraper"> | |
<span class="btn action" onclick="runGrouplistScraper()">Group List</span> | |
${e} | |
</li> | |
<li id="runGroupDetailsScraper" class="l1"> | |
<span class="btn action" onclick="runGroupDetailsScraper()">Group Infos</span> | |
${e} | |
</li> | |
<li id="runFindMASeries" class="l2 no-cache"> | |
<span class="btn action" onclick="runFindMASeries()">Find Multi-Author Series</span> | |
${e} | |
</li> | |
<li id="runSerieslistScraper"> | |
<span class="btn action" onclick="runSerieslistScraper()">Series List</span> | |
${e} | |
</li> | |
<li id="runSeriesDetailsScraper" class="l1"> | |
<span class="btn action" onclick="runSeriesDetailsScraper()">Series Infos</span> | |
${e} | |
</li> | |
<li id="runChapterLinksScraper" class="l1"> | |
<span class="btn action" onclick="runChapterLinksScraper()">Chapter Links</span> | |
${e} | |
</li> | |
<li id="runChapterLinkResolver" class="l2"> | |
<span class="btn action" onclick="runChapterLinkResolver()">Resolve External Links</span> | |
${e} | |
</li> | |
<li id="runSeriesReviewsScraper" class="l1"> | |
<span class="btn action" onclick="runSeriesReviewsScraper()">Series Reviews</span> | |
${e} | |
</li> | |
<li id="runGenrelistScraper"> | |
<span class="btn action" onclick="runGenrelistScraper()">Genres</span> | |
${e} | |
</li> | |
<li id="runTaglistScraper"> | |
<span class="btn action" onclick="runTaglistScraper()">Tags</span> | |
${e} | |
</li> | |
</ul> | |
<h2 style="display:flex;">Stats <span onclick="setStatsFromStorage()" class="btn" style="margin-left: auto; font-size: 0.6rem; line-height: 1.3rem;">Load from Cache</span></h2> | |
<ul class="stats"> | |
<li class="stats-requests">${STATS.numRequests}</li> | |
<li class="stats-response-bytes">${humanFileSize(STATS.numBytesResponseText)}</li> | |
<li class="stats-groups sep-above">${STATS.numGroups||0}</li> | |
<li class="stats-groups-infos">${STATS.numGroupInfos||0} / ${STATS.numGroupInfosTotal||"?"}</li> | |
<li class="stats-series">${STATS.numSeries||0}</li> | |
<li class="stats-series-ids sep-above">${STATS.numSeriesForCrawl||0}</li> | |
<li class="stats-series-infos">${STATS.numSeriesInfos||0} / ${STATS.numSeriesInfosTotal||"?"}</li> | |
<li class="stats-chapters">${STATS.numChapters||0}</li> | |
<li class="stats-chapters-series-progress">${STATS.numSeriesForChapters||0} / ${STATS.numSeriesForChaptersTotal||"?"}</li> | |
<li class="stats-chapter-links">${STATS.numChapterLinksResolved||0} / ${STATS.numChapters||"?"}</li> | |
<li class="stats-reviews">${STATS.numReviews||0}</li> | |
<li class="stats-reviews-series-progress">${STATS.numSeriesForReviews||0} / ${STATS.numSeriesForReviewsTotal||"?"}</li> | |
<li class="stats-genres sep-above">${STATS.numGenres||0}</li> | |
<li class="stats-tags">${STATS.numTags||0}</li> | |
</ul> | |
<h2>Configs</h2> | |
<div class="configs"> | |
<div><input type="checkbox" id="nus-stop" name="stop" onchange="updateStopFlag()" /><label for="nus-stop" title="Stop the next web request and halt any scraping.">Halt requests!</label></div> | |
<div><label for="nus-delay" title="Average delay between web requests.">Delay (ms):</label><input type="text" id="nus-delay" name="delay" value="${CONFIGS.requestDelay}" onchange="updateRequestDelay()" /></div> | |
<div><input type="checkbox" id="nus-clicks" name="clicks" onchange="updateBlockClicksFlag()" checked="checked" /><label for="nus-clicks" title="Block any accidental mouse interaction on the original webpage.">Block any Clicks!</label></div> | |
</div>`,e=document.createElement("div");e.id=ID_SCRAPERLET,e.innerHTML=t,e.classList.add("delete-not-allowed"),document.body.append(e),window.runGrouplistScraper=runGrouplistScraper,window.runGroupDetailsScraper=runGroupDetailsScraper,window.runFindMASeries=runFindMASeries,window.runSerieslistScraper=runSerieslistScraper,window.runSeriesDetailsScraper=runSeriesDetailsScraper,window.runChapterLinksScraper=runChapterLinksScraper,window.runChapterLinkResolver=runChapterLinkResolver,window.runSeriesReviewsScraper=runSeriesReviewsScraper,window.runGenrelistScraper=runGenrelistScraper,window.runTaglistScraper=runTaglistScraper,window.updateStopFlag=updateStopFlag,window.updateRequestDelay=updateRequestDelay,window.updateBlockClicksFlag=updateBlockClicksFlag,window.doDownload=doDownload,window.doDataDelete=doDataDelete,window.setStatsFromStorage=setStatsFromStorage,updateStats(),updateStopFlag(),updateRequestDelay(),updateBlockClicksFlag(),setHasDataFromStorage()}function install(){document.location.origin!==URL_BASE?console.error("Bookmarklet not for this page. Please visit",URL_BASE):(null!==document.getElementById(ID_SCRAPERLET)&&(console.warn("Already installed Bookmarklet. Removing old HTML..."),document.getElementById(ID_SCRAPERLET).remove(),document.getElementById(ID_SCRAPERLET+"-style").remove()),void 0!==window.disablePageClicksHandler&&(document.body.removeEventListener("click",window.disablePageClicksHandler),delete window.disablePageClicksHandler),localforage.config({driver:localforage.INDEXEDDB,name:"nuscraper",version:1,storeName:"keyvaluepairs",description:"NovelUpdates Scraper Storage"}),backupStorageStats(),buildMenu())}install(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment