@subwallet/web-runner 1.1.68-1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/web-runner.zip CHANGED
Binary file
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();class t{_storage={};constructor(){this.sync()}setItem(e,t){this._storage[e]=t,localStorage.setItem(e,t)}getItem(e){return this._storage[e]||localStorage.getItem(e)||null}removeItem(e){this._storage[e]&&delete this._storage[e],localStorage.removeItem(e)}clear(){this._storage={},localStorage.clear()}key(e){return Object.keys(this._storage)[e]||null}length(e){return Object.keys(this._storage)[e]||null}keys(){return Object.keys(this._storage)||[]}copy(){return JSON.parse(JSON.stringify(this._storage))}sync(){this._storage=JSON.parse(JSON.stringify(localStorage))}static get instance(){return window.SWStorage||(console.log("SWStorage init"),window.SWStorage=new t),window.SWStorage}}e.g.chrome||(e.g.chrome={}),e.g.chrome.extension||(e.g.chrome.extension={getURL:e=>e});const r=t.instance;e.g.chrome.runtime={lastError:void 0},e.g.chrome.windows={getCurrent:()=>{}},e.g.chrome.tabs={query:()=>{},getURL:e=>e},e.g.chrome.storage={local:{get:(e,t)=>{e||(e=r.keys()),"string"==typeof e&&(e=[e]);const o={};e.forEach((e=>{o[e]=function(e,t){const o=r.getItem(e);if(!o)return t;try{return JSON.parse(o)}catch(e){return t}}(e)})),t(o)},set:(e,t)=>{Object.entries(e).forEach((([e,t])=>{var o,s;o=e,s=t,r.setItem(o,JSON.stringify(s))})),t&&t()},remove:(e,t,o)=>{!function(e){r.removeItem(e)}(e),o&&o()}}}})();