// ==UserScript==
// @name AdsBypasser
// @namespace AdsBypasser
// @description Bypass Ads
// @copyright 2012+, Wei-Cheng Pan (legnaleurc)
// @version 6.28.0
// @license BSD
// @homepageURL https://adsbypasser.github.io/
// @supportURL https://github.com/adsbypasser/adsbypasser/issues
// @updateURL https://adsbypasser.github.io/releases/adsbypasser.full.es7.meta.js
// @downloadURL https://adsbypasser.github.io/releases/adsbypasser.full.es7.user.js
// @icon https://raw.githubusercontent.com/adsbypasser/adsbypasser/v6.28.0/resources/img/logo.png
// @grant GM_deleteValue
// @grant GM_getResourceURL
// @grant GM_getValue
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant GM.deleteValue
// @grant GM.getResourceUrl
// @grant GM.getValue
// @grant GM.openInTab
// @grant GM.setValue
// @grant GM.xmlHttpRequest
// @grant unsafeWindow
// @resource alignCenter https://raw.githubusercontent.com/adsbypasser/adsbypasser/v6.28.0/resources/css/align_center.css
// @resource scaleImage https://raw.githubusercontent.com/adsbypasser/adsbypasser/v6.28.0/resources/css/scale_image.css
// @resource bgImage https://raw.githubusercontent.com/adsbypasser/adsbypasser/v6.28.0/resources/img/imagedoc-darknoise.png
// @run-at document-start
// @include http://*
// @include https://*
// @connect *
// ==/UserScript==
(function(modules) {
var installedModules = {};
function __webpack_require__(moduleId) {
if(installedModules[moduleId]) {
return installedModules[moduleId].exports;
}
var module = installedModules[moduleId] = {
i: moduleId,
l: false,
exports: {}
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l = true;
return module.exports;
}
__webpack_require__.m = modules;
__webpack_require__.c = installedModules;
__webpack_require__.d = function(exports, name, getter) {
if(!__webpack_require__.o(exports, name)) {
Object.defineProperty(exports, name, {
configurable: false,
enumerable: true,
get: getter
});
}
};
__webpack_require__.r = function(exports) {
Object.defineProperty(exports, '__esModule', { value: true });
};
__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;
};
__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
__webpack_require__.p = "";
return __webpack_require__(__webpack_require__.s = 0);
})
([
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var util_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
var util_dispatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
var util_platform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
var util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
var util_logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5);
var _ADSBYPASSER_HANDLERS___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6);
const isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
function disableWindowOpen () {
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].open = function () {
return {
closed: false,
};
};
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].alert = util_core__WEBPACK_IMPORTED_MODULE_0__["nop"];
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].confirm = util_core__WEBPACK_IMPORTED_MODULE_0__["nop"];
}
function disableLeavePrompt (element) {
if (!element) {
return;
}
const seal = {
set: function () {
Object(util_logger__WEBPACK_IMPORTED_MODULE_4__["info"])('blocked onbeforeunload');
},
};
element.onbeforeunload = undefined;
if (isSafari) {
element.__defineSetter__('onbeforeunload', seal.set);
} else {
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].Object.defineProperty(element, 'onbeforeunload', {
configurable: true,
enumerable: false,
get: undefined,
set: seal.set,
});
}
const oael = element.addEventListener;
const nael = function (type) {
if (type === 'beforeunload') {
Object(util_logger__WEBPACK_IMPORTED_MODULE_4__["info"])('blocked addEventListener onbeforeunload');
return;
}
return oael.apply(this, arguments);
};
element.addEventListener = nael;
}
function changeTitle () {
document.title += ' - AdsBypasser';
}
async function beforeDOMReady (handler) {
const config = await Object(util_config__WEBPACK_IMPORTED_MODULE_3__["dumpConfig"])();
Object(util_logger__WEBPACK_IMPORTED_MODULE_4__["info"])('working on\n%s \nwith\n%s', window.location.toString(), JSON.stringify(config));
disableLeavePrompt(util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"]);
disableWindowOpen();
await handler.start();
}
async function afterDOMReady (handler) {
disableLeavePrompt(util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].document.body);
changeTitle();
await handler.ready();
}
function waitDOM () {
return new Promise((resolve) => {
if (document.readyState !== 'loading') {
resolve();
return;
}
document.addEventListener('DOMContentLoaded', () => {
resolve();
});
});
}
async function main () {
if (util_platform__WEBPACK_IMPORTED_MODULE_2__["rawUSW"].top !== util_platform__WEBPACK_IMPORTED_MODULE_2__["rawUSW"].self) {
return;
}
util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].registerMenuCommand('AdsBypasser - Configure', () => {
util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].openInTab('https://adsbypasser.github.io/configure.html');
});
await Object(util_config__WEBPACK_IMPORTED_MODULE_3__["loadConfig"])();
const handler = Object(util_dispatcher__WEBPACK_IMPORTED_MODULE_1__["findHandler"])();
if (handler) {
await beforeDOMReady(handler);
await waitDOM();
await afterDOMReady(handler);
return;
}
}
main().catch((e) => {
Object(util_logger__WEBPACK_IMPORTED_MODULE_4__["warn"])(e);
});
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "AdsBypasserError", function() { return AdsBypasserError; });
__webpack_require__.d(__webpack_exports__, "every", function() { return every; });
__webpack_require__.d(__webpack_exports__, "find", function() { return find; });
__webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
__webpack_require__.d(__webpack_exports__, "isString", function() { return isString; });
__webpack_require__.d(__webpack_exports__, "map", function() { return map; });
__webpack_require__.d(__webpack_exports__, "none", function() { return none; });
__webpack_require__.d(__webpack_exports__, "nop", function() { return nop; });
__webpack_require__.d(__webpack_exports__, "partial", function() { return partial; });
__webpack_require__.d(__webpack_exports__, "tryEvery", function() { return tryEvery; });
__webpack_require__.d(__webpack_exports__, "wait", function() { return wait; });
class AdsBypasserError extends Error {
constructor (message) {
super(message);
}
get name () {
return 'AdsBypasserError';
}
}
function forEach (collection, fn) {
if (isArrayLike(collection)) {
return Array.prototype.forEach.call(collection, fn);
}
return Object.keys(collection).forEach((k) => {
return fn(collection[k], k, collection);
});
}
function every (collection, fn) {
if (isArrayLike(collection)) {
return Array.prototype.every.call(collection, fn);
}
return Object.keys(collection).every((k) => {
return fn(collection[k], k, collection);
});
}
function map (collection, fn) {
if (isArrayLike(collection)) {
return Array.prototype.map.call(collection, fn);
}
const mapped = Object.assign({}, collection);
Object.getOwnPropertyNames(mapped).forEach((k) => {
mapped[k] = fn(collection[k], k, collection);
});
return mapped;
}
function find (collection, fn) {
for (const [k, v] of enumerate(collection)) {
const r = fn(v, k, collection);
if (r !== none) {
return [k, v, r];
}
}
return [none, none, none];
}
function * enumerate (collection) {
if (isArrayLike(collection)) {
yield * Array.prototype.entries.call(collection);
return;
}
const keys = Object.getOwnPropertyNames(collection);
for (const k of keys) {
yield [k, collection[k]];
}
}
function isArrayLike (collection) {
return Array.isArray(collection) || isNodeList(collection);
}
function isNodeList (collection) {
return collection.constructor.name === 'NodeList';
}
function partial (fn, ...args) {
if (typeof fn !== 'function') {
throw new AdsBypasserError('must give a function');
}
return (...innerArgs) => {
return fn(...args.concat(innerArgs));
};
}
function isString (value) {
return (typeof value === 'string') || (value instanceof String);
}
function nop () {
}
const none = nop;
function wait (msDelay) {
return new Promise((resolve) => {
setTimeout(resolve, msDelay);
});
}
function tryEvery (msInterval, fn) {
return new Promise((resolve) => {
const handle = setInterval(function () {
const result = fn();
if (result !== none) {
clearInterval(handle);
resolve(result);
}
}, msInterval);
});
}
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "register", function() { return register; });
__webpack_require__.d(__webpack_exports__, "findHandler", function() { return findHandler; });
var util_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
const patterns = [];
function register (pattern) {
patterns.push(pattern);
}
function dispatchByObject (rule, url_6) {
const matched = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["map"])(rule, (pattern, part) => {
if (pattern instanceof RegExp) {
return url_6[part].match(pattern);
}
if (Array.isArray(pattern)) {
const [, , r] = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["find"])(pattern, (sp) => {
const m = url_6[part].match(sp);
return m || util_core__WEBPACK_IMPORTED_MODULE_0__["none"];
});
return r !== util_core__WEBPACK_IMPORTED_MODULE_0__["none"] ? r : null;
}
throw new util_core__WEBPACK_IMPORTED_MODULE_0__["AdsBypasserError"]('invalid rule');
});
const passed = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["every"])(matched, (v) => {
return !!v;
});
return passed ? matched : null;
}
function dispatchByRegExp (rule, url_1) {
return url_1.match(rule);
}
function dispatchByArray (rules, url_1, url_3, url_6) {
const [, , r] = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["find"])(rules, (rule) => {
const m = dispatch(rule, url_1, url_3, url_6);
return m ? m : util_core__WEBPACK_IMPORTED_MODULE_0__["none"];
});
return r !== util_core__WEBPACK_IMPORTED_MODULE_0__["none"] ? r : null;
}
function dispatchByString (rule, url_3) {
let scheme = /\*|https?|file|ftp|chrome-extension/;
let host = /\*|(\*\.)?([^/*]+)/;
let path = /\/.*/;
let tmp = `^(${scheme.source})://(${host.source})?(${path.source})$`;
let up = new RegExp(tmp);
const matched = rule.match(up);
if (!matched) {
return null;
}
scheme = matched[1];
host = matched[2];
const wc = matched[3];
const sd = matched[4];
path = matched[5];
if (scheme === '*' && !/https?/.test(url_3.scheme)) {
return null;
}
if (scheme !== url_3.scheme) {
return null;
}
if (scheme !== 'file' && host !== '*') {
if (wc) {
up = url_3.host.indexOf(sd);
if (up < 0 || up + sd.length !== url_3.host.length) {
return null;
}
} else if (host !== url_3.host) {
return null;
}
}
tmp = path.replace(/[*.[\]?+#]/g, (c) => {
if (c === '*') {
return '.*';
}
return '\\' + c;
});
path = new RegExp(`^${tmp}$`);
if (!path.test(url_3.path)) {
return null;
}
return url_3;
}
function dispatchByFunction (rule, url_1, url_3, url_6) {
return rule(url_1, url_3, url_6);
}
function dispatch (rule, url_1, url_3, url_6) {
if (Array.isArray(rule)) {
return dispatchByArray(rule, url_1, url_3, url_6);
}
if (typeof rule === 'function') {
return dispatchByFunction(rule, url_1, url_3, url_6);
}
if (rule instanceof RegExp) {
return dispatchByRegExp(rule, url_1);
}
if (Object(util_core__WEBPACK_IMPORTED_MODULE_0__["isString"])(rule)) {
return dispatchByString(rule, url_3);
}
return dispatchByObject(rule, url_6);
}
function findHandler () {
const url_1 = window.location.toString();
const url_3 = {
scheme: window.location.protocol.slice(0, -1),
host: window.location.host,
path: window.location.pathname + window.location.search + window.location.hash,
};
const url_6 = {
scheme: window.location.protocol,
host: window.location.hostname,
port: window.location.port,
path: window.location.pathname,
query: window.location.search,
hash: window.location.hash,
};
const [i, pattern, matched] = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["find"])(patterns, (pattern) => {
const m = dispatch(pattern.rule, url_1, url_3, url_6);
return m ? m : util_core__WEBPACK_IMPORTED_MODULE_0__["none"];
});
if (i === util_core__WEBPACK_IMPORTED_MODULE_0__["none"]) {
return null;
}
if (!pattern.start && !pattern.ready) {
return null;
}
return {
start: pattern.start ? Object(util_core__WEBPACK_IMPORTED_MODULE_0__["partial"])(pattern.start, matched) : util_core__WEBPACK_IMPORTED_MODULE_0__["nop"],
ready: pattern.ready ? Object(util_core__WEBPACK_IMPORTED_MODULE_0__["partial"])(pattern.ready, matched) : util_core__WEBPACK_IMPORTED_MODULE_0__["nop"],
};
}
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "rawUSW", function() { return rawUSW; });
__webpack_require__.d(__webpack_exports__, "usw", function() { return usw; });
__webpack_require__.d(__webpack_exports__, "GMAPI", function() { return GMAPI; });
var util_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
const rawUSW = getUnsafeWindow();
const usw = getUnsafeWindowProxy();
const GMAPI = getGreaseMonkeyAPI();
function getUnsafeWindow () {
let w = null;
try {
w = unsafeWindow;
} catch (e) {
try {
w = (0, eval)('this').global;
} catch (e) {
}
}
return w ? w : (0, eval)('this').window;
}
function getGreaseMonkeyAPI () {
if (rawUSW.global) {
return null;
}
const gm = {};
if (typeof GM_openInTab === 'function') {
gm.openInTab = GM_openInTab;
} else {
gm.openInTab = GM.openInTab;
}
if (typeof GM_getValue === 'function') {
gm.getValue = (name, default_) => {
return Promise.resolve(GM_getValue(name, default_));
};
} else {
gm.getValue = GM.getValue;
}
if (typeof GM_setValue === 'function') {
gm.setValue = (name, value) => {
return Promise.resolve(GM_setValue(name, value));
};
} else {
gm.setValue = GM.setValue;
}
if (typeof GM_deleteValue === 'function') {
gm.deleteValue = (name) => {
return Promise.resolve(GM_deleteValue(name));
};
} else {
gm.deleteValue = GM.deleteValue;
}
if (typeof GM_xmlhttpRequest === 'function') {
gm.xmlHttpRequest = GM_xmlhttpRequest;
} else {
gm.xmlHttpRequest = GM.xmlHttpRequest;
}
if (typeof GM_registerMenuCommand === 'function') {
gm.registerMenuCommand = GM_registerMenuCommand;
} else {
gm.registerMenuCommand = util_core__WEBPACK_IMPORTED_MODULE_0__["nop"];
}
if (typeof GM_getResourceURL === 'function') {
gm.getResourceUrl = (resourceName) => {
return Promise.resolve(GM_getResourceURL(resourceName));
};
} else if (typeof GM === 'object' && GM && GM.getResourceUrl) {
gm.getResourceUrl = GM.getResourceUrl;
}
return gm;
}
const MAGIC_KEY = '__adsbypasser_reverse_proxy__';
function getUnsafeWindowProxy () {
const isFirefox = typeof InstallTrigger !== 'undefined';
const isWebExtension = typeof cloneInto === 'undefined' || typeof exportFunction === 'undefined';
if (!isFirefox || isWebExtension) {
return rawUSW;
}
const decorator = {
set (target, key, value) {
if (key === MAGIC_KEY) {
return false;
}
if (target === unsafeWindow && key === 'open') {
const d = Object.getOwnPropertyDescriptor(target, key);
d.value = clone(function () {
const rv = value();
return cloneInto(rv, unsafeWindow);
});
Object.defineProperty(target, key, d);
} else {
target[key] = clone(value);
}
return true;
},
get (target, key) {
if (key === MAGIC_KEY) {
return target;
}
const value = target[key];
const type = typeof value;
if (value === null || (type !== 'function' && type !== 'object')) {
return value;
}
return new Proxy(value, decorator);
},
apply (target, self, args) {
args = Array.prototype.slice.call(args);
if (target === unsafeWindow.Object.defineProperty) {
args[0] = args[0][MAGIC_KEY];
}
if (target === unsafeWindow.Function.apply) {
self = self[MAGIC_KEY];
args[1] = Array.prototype.slice.call(args[1]);
}
if (target === unsafeWindow.document.querySelector) {
self = self[MAGIC_KEY];
}
if (target === unsafeWindow.document.write) {
self = self[MAGIC_KEY];
}
const usargs = clone(args);
return target.apply(self, usargs);
},
construct (target, args) {
args = Array.prototype.slice.call(args);
args.unshift(undefined);
const usargs = clone(args);
const bind = unsafeWindow.Function.prototype.bind;
return new (bind.apply(target, usargs));
},
};
return new Proxy(unsafeWindow, decorator);
}
function clone (safe) {
if (safe === null || !(safe instanceof Object)) {
return safe;
}
if (safe === unsafeWindow) {
return safe;
}
if (safe instanceof String) {
return safe.toString();
}
if (safe instanceof Function) {
return exportFunction(safe, unsafeWindow, {
allowCrossOriginArguments: true,
});
}
if (safe instanceof Array) {
const unsafe = new unsafeWindow.Array();
for (let i = 0; i < safe.length; ++i) {
unsafe.push(clone(safe[i]));
}
return unsafe;
}
const unsafe = new unsafeWindow.Object();
Object(util_core__WEBPACK_IMPORTED_MODULE_0__["forEach"])(safe, (v, k) => {
unsafe[k] = clone(v);
});
return unsafe;
}
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "dumpConfig", function() { return dumpConfig; });
__webpack_require__.d(__webpack_exports__, "loadConfig", function() { return loadConfig; });
var util_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
var util_dispatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
var util_platform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
const MANIFEST = [
{
key: 'version',
default_: 0,
verify (v) {
return typeof v === 'number' && v >= 0;
},
normalize: toNumber,
},
{
key: 'align_center',
default_: true,
verify: isBoolean,
normalize: toBoolean,
},
{
key: 'change_background',
default_: true,
verify: isBoolean,
normalize: toBoolean,
},
{
key: 'redirect_image',
default_: true,
verify: isBoolean,
normalize: toBoolean,
},
{
key: 'scale_image',
default_: true,
verify: isBoolean,
normalize: toBoolean,
},
{
key: 'log_level',
default_: 1,
verify (v) {
return typeof v === 'number' && v >= 0 && v <= 2;
},
normalize: toNumber,
},
];
const PATCHES = [
async () => {
const alignCenter = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('align_center');
const changeBackground = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('change_background');
const scaleImage = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('scale_image');
const redirectImage = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('redirect_image');
const ac = typeof alignCenter === 'boolean';
if (typeof changeBackground !== 'boolean') {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('change_background', ac ? alignCenter : true);
}
if (typeof scaleImage !== 'boolean') {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('scale_image', ac ? alignCenter : true);
}
if (!ac) {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('align_center', true);
}
if (typeof redirectImage !== 'boolean') {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('redirect_image', true);
}
},
async () => {
const externalServerSupport = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('external_server_support');
if (typeof externalServerSupport !== 'boolean') {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('external_server_support', false);
}
},
async () => {
const logLevel = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('log_level');
if (typeof logLevel !== 'number') {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('log_level', 1);
}
},
async () => {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].deleteValue('external_server_support');
},
];
function isBoolean (v) {
return typeof v === 'boolean';
}
function toBoolean (v) {
return !!v;
}
function toNumber (v) {
return parseInt(v, 10);
}
async function senityCheck () {
let verifyResults = MANIFEST.map(async (descriptor) => {
const rv = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue(descriptor.key);
return descriptor.verify(rv);
});
verifyResults = await Promise.all(verifyResults);
const ok = Object(util_core__WEBPACK_IMPORTED_MODULE_0__["every"])(verifyResults, v => v);
if (!ok) {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('version', 0);
}
}
async function migrate () {
let currentVersion = await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('version');
if (currentVersion !== 0 && !currentVersion) {
throw new util_core__WEBPACK_IMPORTED_MODULE_0__["AdsBypasserError"]('invalid version');
}
while (currentVersion < PATCHES.length) {
PATCHES[currentVersion]();
++currentVersion;
}
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue('version', currentVersion);
}
async function loadConfig () {
await senityCheck();
await migrate();
Object(util_dispatcher__WEBPACK_IMPORTED_MODULE_1__["register"])({
rule: {
host: /^adsbypasser\.github\.io$/,
path: /^\/configure\.html$/,
},
async ready () {
await waitForPage();
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].commit = async (data) => {
for (const [k, v] of Object.entries(data)) {
await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].setValue(k, v);
}
};
util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].render({
version: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('version'),
options: {
align_center: {
type: 'checkbox',
value: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('align_center'),
label: 'Align Center',
help: 'Align image to the center if possible. (default: enabled)',
},
change_background: {
type: 'checkbox',
value: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('change_background'),
label: 'Change Background',
help: 'Use Firefox-like image background if possible. (default: enabled)',
},
redirect_image: {
type: 'checkbox',
value: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('redirect_image'),
label: 'Redirect Image',
help: [
'Directly open image link if possible. (default: enabled)',
'If disabled, redirection will only works on link shortener sites.',
].join('
\n'),
},
scale_image: {
type: 'checkbox',
value: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('scale_image'),
label: 'Scale Image',
help: 'When image loaded, scale it to fit window if possible. (default: enabled)',
},
log_level: {
type: 'select',
value: await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue('log_level'),
menu: [
[0, '0 (quiet)'],
[1, '1 (default)'],
[2, '2 (verbose)'],
],
label: 'Log Level',
help: [
'Log level in developer console. (default: 1)',
'0 will not print anything in console.',
'1 will only print logs on affected sites.',
'2 will print on any sites.',
].join('
\n'),
},
},
});
},
});
}
function waitForPage () {
return new Promise((resolve) => {
const i = setInterval(() => {
if (util_platform__WEBPACK_IMPORTED_MODULE_2__["usw"].render) {
clearInterval(i);
resolve();
}
}, 50);
});
}
async function dumpConfig () {
let rv = MANIFEST.map(async (descriptor) => {
return [descriptor.key, await util_platform__WEBPACK_IMPORTED_MODULE_2__["GMAPI"].getValue(descriptor.key)];
});
rv = await Promise.all(rv);
const o = {};
for (const [k, v] of rv) {
o[k] = v;
}
return o;
}
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "debug", function() { return debug; });
__webpack_require__.d(__webpack_exports__, "info", function() { return info; });
__webpack_require__.d(__webpack_exports__, "warn", function() { return warn; });
var util_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
const quiet = false;
function log (method, args) {
if (quiet) {
return;
}
args = Array.prototype.slice.call(args);
if (Object(util_core__WEBPACK_IMPORTED_MODULE_0__["isString"])(args[0])) {
args[0] = 'AdsBypasser: ' + args[0];
} else {
args.unshift('AdsBypasser:');
}
const f = console[method];
if (typeof f === 'function') {
f.apply(console, args);
}
}
function debug () {
log('debug', arguments);
}
function info () {
log('info', arguments);
}
function warn () {
log('warn', arguments);
}
}),
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var _ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
_ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["_"].register({
rule: {
host: /^akoam\.net$/,
path: /^\/download\/([^/]+)\//,
},
async start (m) {
let data = await _ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["$"].post(location.href, m.path[1]);
try {
data = JSON.parse(data);
} catch (e) {
_ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["_"].warn('JSON error:', e);
return;
}
await _ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["$"].openLink(data.direct_link);
},
});
_ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["_"].register({
rule: {
host: /^(www\.)?coolrom\.com$/,
path: /^\/dlpop\.php$/,
},
async ready () {
const matches = _ADSBYPASSER_NAMESPACE___WEBPACK_IMPORTED_MODULE_0__["$"].searchFromScripts(/