1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=252)}({0:function(t,e,n){"use strict";(function(t){n.d(e,"k",(function(){return o})),n.d(e,"e",(function(){return i})),n.d(e,"q",(function(){return u})),n.d(e,"l",(function(){return c})),n.d(e,"s",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"p",(function(){return d})),n.d(e,"o",(function(){return f})),n.d(e,"i",(function(){return l})),n.d(e,"j",(function(){return p})),n.d(e,"h",(function(){return m})),n.d(e,"r",(function(){return h})),n.d(e,"b",(function(){return v})),n.d(e,"g",(function(){return y})),n.d(e,"n",(function(){return w})),n.d(e,"c",(function(){return g})),n.d(e,"t",(function(){return O})),n.d(e,"m",(function(){return j})),n.d(e,"f",(function(){return x})),n.d(e,"a",(function(){return S}));var r={requestHandler:function(t,e){return new Promise((function(r,o){var i=new XMLHttpRequest,u=e.responseType;i.open(e.method||"GET",t,!0),b.includes(u)&&(i.responseType=u);var c=Object.assign({},e.headers),a=e.body;a&&"[object Object]"===Object.prototype.toString.call(a)&&(c["Content-Type"]="application/json",a=JSON.stringify(a)),Object.keys(c).forEach((function(t){i.setRequestHeader(t,c[t])})),i.onload=function(){var t=n(i,{status:i.status||200});t.status>300?o(t):r(t)},i.onerror=function(){var t=n(i,{status:-1});o(t)},i.onabort=i.onerror,i.ontimeout=i.onerror,i.send(a)}));function n(n,r){var o,i=e.responseType;if(o=b.includes(i)?n.response:n.responseText,"json"===i)try{o=JSON.parse(o)}catch(t){}return Object.assign({url:t,data:o,xhr:n},r)}},verbose:!1};function o(t,e){return browser.i18n.getMessage(t,e)||t}var i="/public/images/icon-128x128.png";function u(t){return null==t?[]:Array.isArray(t)?t:`${t}`.split(".").filter(Boolean)}function c(){var t=[];return{hook:function(e){return t.push(e),function(){var n=t.indexOf(e);n>=0&&t.splice(n,1)}},fire:function(e){t.slice().forEach((function(t){t(e)}))}}}function a(e){var n=browser.runtime.sendMessage(e).then((function(t){var e=t||{},n=e.data,r=e.error;return r?Promise.reject(r):n}));return n.catch((function(n){t.env.DEBUG&&console.warn(n,e)})),n}function s(t,e){var n;function r(e,r){n=null,t.apply(e,r)}return function(){n&&clearTimeout(n);for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];n=setTimeout(r,e,this,o)}}function d(){}function f(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",r=t.toString();r.length<e;)r=`${n}${r}`;return r}function l(){return Math.floor(65536*(1+Math.random())).toString(16).slice(-4)}function p(t){return(t||"")+Date.now().toString(36)+l()}function m(t,e){return navigator.languages.map((function(n){return t[`${e}:${n}`]||t[`${e}:${n.toLowerCase()}`]})).find(Boolean)||t[e]||""}var b=["blob","arraybuffer"];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.requestHandler(t,e)}function v(t){for(var e=new window.Uint8Array(t),n="",r=0;r<e.length;r+=8192)n+=String.fromCharCode.apply(null,e.subarray(r,r+8192));return n}function y(t,e){var n=new URL(t,e);return["http:","https:","ftp:","data:","file:"].includes(n.protocol)||(n.protocol="http:"),n.href}function w(t){return t&&!/^(file:|data:|https?:\/\/localhost[:/]|http:\/\/127\.0\.0\.1[:/])/.test(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.defaultType,r=e.type;if(t){for(var o=`${t}`.split(","),i=o.length,u=o[i-1],c=r||o[i-2]||n||"",a=window.atob(u),s=new window.Uint8Array(a.length),d=0;d<a.length;d+=1)s[d]=a.charCodeAt(d);var f=new Blob([s],{type:c});return URL.createObjectURL(f)}}function O(){var t;r.verbose&&(t=console).info.apply(t,arguments)}function j(t){try{var e=t.split(".").slice(-2).join(".");return["obeyi.com"].includes(e)}catch(t){O(`isDomainAllowed: error: ${t}`)}}function x(t,e){return new Promise((function(n){setTimeout(n.bind(null,e),t)}))}function S(){throw new Error("Test mode expected: current=production")}}).call(this,n(17))},130:function(t,e,n){"use strict";(function(t){var r;function o(t){t.stopImmediatePropagation(),t.preventDefault();var e=r,n=e.type,o=e.data;t.clipboardData.setData(n||"text/plain",o)}function i(e){var n=e.type,i=e.data;r={type:n,data:i},document.addEventListener("copy",o,!1);var u=document.execCommand("copy",!1,null);document.removeEventListener("copy",o,!1),r=null,t.env.DEBUG&&!u&&console.warn("Copy failed!")}n.d(e,"a",(function(){return i}))}).call(this,n(17))},131:function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(9),o=n.n(r),i=n(0),u=n(14),c=n(8),a={},s={},d={};var f={};var l={};var p=n(130),m=window.top===window,b=[],h=[],v={};var y={Command(t){a.post({cmd:"Command",data:t})},GetPopup:j,HttpRequested:function(t){l[t.id]&&("loadend"===t.type&&delete l[t.id],a.post({cmd:"HttpRequested",data:t}))},TabClosed:function(t){var e=d[t];delete d[t],delete s[e],e&&a.post({cmd:"TabClosed",data:e})},UpdatedValues(t){a.post({cmd:"UpdatedValues",data:t})},NotificationClick:function(t){var e=f[t];e&&a.post({cmd:"NotificationClicked",data:e})},NotificationClose:function(t){var e=f[t];e&&(a.post({cmd:"NotificationClosed",data:e}),delete f[t])},WatchOnlineMenuClicked(t){a.post({cmd:"WatchOnlineMenuClicked",data:t})}};function w(t,e){return a.post=Object(c.b)(t,e,O),a.destId=e,browser.runtime.onMessage.addListener((function(t,e){var n=y[t.cmd];n&&n(t.data,e)})),Object(c.e)({cmd:"GetInjected",data:{url:window.location.href,reset:m,isTop:m}}).then((function(t){t.scripts&&(t.scripts=t.scripts.filter((function(t){return b.push(t.props.id),!(!m&&t.meta.noframes||!t.config.enabled)&&(h.push(t.props.id),!0)}))),j(),new Promise((function(t){return setTimeout(t,m?0:300)})).then((function(){return Object(c.e)({cmd:"SetBadge",data:{ids:h,reset:m}})}));var e=t.scripts&&t.scripts.length;return e&&a.ready.then((function(){a.post({cmd:"LoadScripts",data:t})})),e}))}var g={GetRequestId:function(){Object(c.e)({cmd:"GetRequestId"}).then((function(t){l[t]=1,a.post({cmd:"GotRequestId",data:t})}))},HttpRequest:function(t){Object(c.e)({cmd:"HttpRequest",data:t})},AbortRequest:function(t){Object(c.e)({cmd:"AbortRequest",data:t})},Inject:function(t){var e=o()(t,4),n=e[0],r=e[1],i=e[2],u=e[3],a=[c.a.toString(),JSON.stringify(n),`function(${r.join(",")}){${i}}`,JSON.stringify(u)],s=`!${function(t,e,n,r){t(e,n);var o=window[r];o&&o()}.toString()}(${a.join(",")})`;Object(c.d)(s)},TabOpen:function(t){var e=t.key,n=t.data;n.url=Object(i.g)(n.url,window.location.href),Object(c.e)({cmd:"TabOpen",data:n}).then((function(t){var n=t.id;s[e]=n,d[n]=e}))},TabClose:function(t){var e=s[t];t&&!e||Object(c.e)({cmd:"TabClose",data:{id:e}})},Ready(){a.ready=Promise.resolve()},UpdateValue(t){Object(c.e)({cmd:"UpdateValue",data:t})},RegisterMenu(t){if(m){var e=o()(t,1)[0];v[e]=t}j()},UnregisterMenu(t){if(m){var e=o()(t,1)[0];delete v[e]}j()},AddStyle(t){var e=t.css,n=t.callbackId,r=null;if(document.head){r=Object(i.j)("VMst");var o=document.createElement("style");o.id=r,o.textContent=e,document.head.appendChild(o)}a.post({cmd:"Callback",data:{callbackId:n,payload:r}})},Notification:function(t){Object(c.e)({cmd:"Notification",data:t}).then((function(e){f[e]=t.id}))},SetClipboard(t){u.d?Object(p.a)(t):Object(c.e)({cmd:"SetClipboard",data:t})},PostCommand(t){var e=t.cmd,n=t.requestId,r=t.data;Object(c.e)({cmd:e,data:r}).then((function(t){a.post({cmd:"CommandResponse",data:{result:t,requestId:n}})}))}};function O(t){var e=g[t.cmd];e&&e(t.data)}function j(){m&&Object(c.e)({cmd:"SetPopup",data:{ids:b,menus:Object.values(v)}})}function x(t,e,n){t()||e&&e>0&&setTimeout((function(){x(t,e-1,n)}),n)}function S(){var t=document.getElementById("x-meanOs-awe-start-engine");return!!t&&(Object(c.e)({cmd:"StartEngine"}).then((function(e){Object(i.t)("meanOs: start engine: response",e),e?t.setAttribute("data-status","started"):t.setAttribute("data-status","failed")})),!0)}function T(){var t=document.getElementById("x-meanOs-awe-version");return!!t&&(Object(i.m)(window.location.host)&&(t.setAttribute("data-vendor",Object(u.a)()),t.setAttribute("data-version",browser.runtime.getManifest().version)),!0)}function C(){var t=document.getElementById("x-meanOs-awe-installed-scripts");return!!t&&(Object(i.m)(window.location.host)&&Object(c.e)({cmd:"GetInstalledScripts"}).then((function(e){e&&t.setAttribute("data-scripts",JSON.stringify(e))})),!0)}a.ready=new Promise((function(t){g.Ready=t})),document.addEventListener("DOMContentLoaded",(function(){x(S,60,500),Object(i.m)(window.location.host)&&(x(T,240,500),x(C,60,500)),m&&Object(c.e)({cmd:"CheckNews",data:{url:window.location.href}})}),!1)},14:function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return c}));var r=navigator.userAgent,o=/firefox\//i.test(r),i=/chrome\//i.test(r),u=/android /i.test(r);function c(){return o?"firefox":i?"chrome":"unknown"}},17:function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var a,s=[],d=!1,f=-1;function l(){d&&a&&(d=!1,a.length?s=a.concat(s):f=-1,s.length&&p())}function p(){if(!d){var t=c(l);d=!0;for(var e=s.length;e;){for(a=s,s=[];++f<e;)a&&a[f].run();f=-1,e=s.length}a=null,d=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function b(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||d||c(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},19:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},252:function(t,e,n){"use strict";n.r(e),function(t){var e=n(8),r=n(131);!function(){function n(t,e){e.tag=t.tagName?t.tagName.toLowerCase():"",e.cls=t.className?t.className.toString().split(" "):"",e.children=[];for(var r=t.childElementCount,o=0;o<r;o++)e.children.push(n(t.children[o],{}));return e}function o(t){"send screen data"===t.data&&(console.log(info),window.parent.postMessage(info,"*"))}if(setTimeout((function(){n(document.body,{});window.addEventListener("message",o)}),2e3),!window.VM){window.VM=1;var i,u,c=window.VMInitInjection;i=Object(e.c)(),u=Object(e.c)(),Object(r.a)(i,u).then((function(n){n&&function(n,r){var o={};[Object.getOwnPropertyNames(window),Object.getOwnPropertyNames(t)].forEach((function(t){t.forEach((function(t){o[t]=1}))}));var i=[r,n,Object.keys(o)];Object(e.d)(`(${c.toString()}())(${i.map((function(t){return JSON.stringify(t)})).join(",")})`)}(i,u)})),/\.(user|meanOs)\.js$/.test(window.location.pathname)&&("complete"===document.readyState?a():setTimeout((function(){a()}),2e3))}function a(){document.querySelector("title")||Object(e.e)({cmd:"ConfirmInstall",data:{code:document.body.textContent,url:window.location.href,from:document.referrer}}).then((function(){window.history.length>1?window.history.go(-1):Object(e.e)({cmd:"TabClose"})}))}}()}.call(this,n(19))},53:function(t,e,n){var r=n(54);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},54:function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},60:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return w})),n.d(e,"b",(function(){return g}));var r=t,o=(r.console,r.CustomEvent),i=(r.Promise,r.isFinite),u=(r.Uint8Array,Array.prototype),c=Object.prototype,a=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.apply(e,r)}},s=a(u.forEach),d=(a(u.map),a(u.indexOf)),f=(u.includes&&a(u.includes),a(c.toString)),l=a(Number.prototype.toString),p=a(String.prototype.slice),m=a(String.prototype.charCodeAt),b=(String.fromCharCode,Object.keys);Object.assign;var h={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},v=/[\\"\u0000-\u001F\u2028\u2029]/g,y=function(t){return h[t]||`\\u${p(l(m(t,0)+65536,16),1)}`},w=JSON.parse;function g(t){if(null==t)return"null";var e=typeof t;if("number"===e)return i(t)?`${t}`:"null";if("boolean"===e)return`${t}`;if("object"===e){if("[object Array]"===f(t)){var n="[";return s(t,(function(t,e){e&&(n+=","),n+=g(t)})),n+="]"}if("[object Object]"===f(t)){var r="{";return s(b(t),(function(e,n){n&&(r+=","),r+=`${g(e)}:${g(t[e])}`})),r+="}"}}return`"${`${t}`.replace(v,y)}"`}}).call(this,n(19))},76:function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},77:function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}},t.exports.__esModule=!0,t.exports.default=t.exports},78:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},8:function(t,e,n){"use strict";n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(60),o=n(0);function i(t){var e=document.querySelector(`#${t}`);if(e)return e.parentNode.removeChild(e),!0}function u(t){var e=document.createElement("script"),n=c();e.id=n,e.textContent=`!${i.toString()}(${JSON.stringify(n)});${t}`,document.documentElement.appendChild(e),i(n)}function c(){return Date.now().toString(36)+Math.random().toString(36).slice(2,6)}function a(t,e,n){return document.addEventListener(t,(function(t){var e=Object(r.c)(t.detail);n(e)}),!1),function(t){!function(t,e){var n=new r.a(t,{detail:Object(r.b)(e)});document.dispatchEvent(n)}(e,t)}}function s(t,e){Object.defineProperty(window,t,{value(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r),delete window[t]},configurable:!0})}n.d(e,"e",(function(){return o.s}))},9:function(t,e,n){var r=n(76),o=n(77),i=n(53),u=n(78);t.exports=function(t,e){return r(t)||o(t,e)||i(t,e)||u()},t.exports.__esModule=!0,t.exports.default=t.exports}}); |