1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/patches/@lavamoat+snow+1.2.1.patch

35 lines
24 KiB
Diff
Raw Normal View History

diff --git a/node_modules/@lavamoat/snow/snow.js b/node_modules/@lavamoat/snow/snow.js
index 6458dcb..5a96ecd 100644
--- a/node_modules/@lavamoat/snow/snow.js
+++ b/node_modules/@lavamoat/snow/snow.js
@@ -369,7 +369,7 @@ function warn(msg, a, b) {
case WARN_OPEN_API_DISABLED:
const args = a,
win = b;
- bail = true;
+ bail = false;
console.warn('SNOW:', 'blocking open API call:', args, win, '.', '\n', 'if this prevents your application from running correctly, please visit/report at', 'https://github.com/LavaMoat/snow/issues/2#issuecomment-1239264255', '.');
break;
default:
diff --git a/node_modules/@lavamoat/snow/snow.prod.js b/node_modules/@lavamoat/snow/snow.prod.js
index 635efb0..daf1d55 100644
--- a/node_modules/@lavamoat/snow/snow.prod.js
+++ b/node_modules/@lavamoat/snow/snow.prod.js
@@ -1 +1 @@
-(function(){"use strict";(()=>{var e={586:(e,t,n)=>{const r=n(228),{getFramesArray:o,getFrameTag:i}=n(648),{getOnload:c,setOnload:a,removeAttribute:l,addEventListener:s}=n(14);function u(e,t,n){if(!i(t))return;s(t,"load",(function(){r(e,[this],n)}));const o=c(t);o&&(a(t,null),l(t,"onload"),a(t,o))}e.exports=function(e,t,n){for(let r=0;r<t.length;r++){const i=t[r],c=o(i,!0);for(let t=0;t<c.length;t++)u(e,c[t],n)}}},750:e=>{e.exports=function(e){e&&e.contentWindow}},228:(e,t,n)=>{const r=n(851),o=n(750),{shadows:i,getFramesArray:c,getFrameTag:a}=n(648),{getContentWindow:l,Object:s,getFrameElement:u}=n(14);function p(e,t){let n=-1;for(;e[++n];)if(!r(e[n],e,s)&&u(e[n])===t)return e[n];for(let e=0;e<i.length;e++){const n=i[e],r=c(n,!1);for(let e=0;e<r.length;e++)if(r[e]===t)return l(r[e],a(r[e]))}return null}e.exports=function(e,t,n){for(let r=0;r<t.length;r++){const i=t[r];o(i);const c=p(e,i);c&&n(c)}}},328:(e,t,n)=>{const{getFramesArray:r}=n(648),{removeAttribute:o,getAttribute:i,getTemplateContent:c,createElement:a,getInnerHTML:l,setInnerHTML:s}=n(14),{warn:u,WARN_IFRAME_ONLOAD_ATTRIBUTE_REMOVED:p}=n(312);function m(e){for(let t=0;t<e.length;t++){const n=e[t],r=i(n,"onload");r&&(u(p,n,r),o(n,"onload"))}}e.exports=function(e,t){for(let e=0;e<t.length;e++){const n=t[e],o=a(document,"template");s(o,n);const i=r(c(o),!1);i.length&&(m(i),t[e]=l(o))}}},352:(e,t,n)=>{const r=n(228),o=n(583),i=n(459),c=n(58),{hookShadowDOM:a}=n(373),{securely:l,addEventListener:s,getFrameElement:u}=n(14),{isMarked:p,mark:m}=n(111),{error:d,ERR_MARK_NEW_WINDOW_FAILED:f}=n(312);function g(e){try{const t=!p(e);return t&&m(e),t}catch(t){d(f,e,t)}return g(e)}function E(e,t){g(t)&&function(e,t,n,r){o(e,t),i(e,t),c(e,t),a(e,t),r(e,n)}(t,(function(n){E(e,n),s(u(n),"load",(function(){r(t,[this],(function(){E(e,n)}))}))}),l,e)}let y=!1;e.exports=function(e,t){y||(y=!0,E(e,t||window))}},58:(e,t,n)=>{const{protectShadows:r}=n(373),o=n(586),{getFramesArray:i,shadows:c}=n(648),{getParentElement:a,slice:l,Object:s,Function:u}=n(14),p=n(328),m=n(228),d={DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend","write","writeln"],Node:["appendChild","insertBefore","replaceChild"],Element:["innerHTML","outerHTML","insertAdjacentHTML","replaceWith","insertAdjacentElement","append","before","prepend","after","replaceChildren"],ShadowRoot:["innerHTML"],HTMLIFrameElement:["srcdoc"]};function f(e,t,n){return function(){const s=l(arguments),d=a(this)||this;o(e,s,n),o(e,c,n),p(e,s),p(e,c);const f=u.prototype.apply.call(t,this,s),g=i(d,!1);return m(e,g,n),m(e,s,n),r(e,n,!0),f}}e.exports=function(e,t){for(const n in d){const r=d[n];for(let o=0;o<r.length;o++){const i=r[o],c=s.getOwnPropertyDescriptor(e[n].prototype,i),a=c.set?"set":"value";c[a]=f(e,c[a],t),s.defineProperty(e[n].prototype,i,c)}}}},459:(e,t,n)=>{const r=n(228),{removeEventListener:o,addEventListener:i,slice:c,Map:a,Object:l}=n(14),s=new a;function u(e,t,n){if(t)return t.handleEvent?t.handleEvent.apply(t,n):t.apply(e,n)}function p(e,t){return function(n,o,a){let l=o;return"load"===n&&(s.has(o)||s.set(o,(function(){r(e,[this],t);const n=c(arguments);u(this,o,n)})),l=s.get(o)),i(this,n,l,a)}}e.exports=function(e,t){l.defineProperty(e.EventTarget.prototype,"addEventListener",{value:p(e,t)}),l.defineProperty(e.EventTarget.prototype,"removeEventListener",{value:function(e,t,n){let r=t;return"load"===e&&(r=s.get(t),s.delete(t)),o(this,e,r,n)}})}},312:e=>{e.exports={warn:function(e,t,n){let r;switch(e){case 1:const e=t,o=n;r=!1,console.warn("SNOW:","removing html string iframe onload attribute:",e,`"${o}"`,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/32#issuecomment-1239273328",".");break;case 3:const i=t,c=n;r=!0,console.warn("SNOW:","blocking open API call:",i,c,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/2#issuecomment-1239264255",".")}return r},error:function(e,t,n){let r;if(2===e){const e=t,o
\ No newline at end of file
+(function(){"use strict";(()=>{var e={586:(e,t,n)=>{const r=n(228),{getFramesArray:o,getFrameTag:i}=n(648),{getOnload:c,setOnload:a,removeAttribute:l,addEventListener:s}=n(14);function u(e,t,n){if(!i(t))return;s(t,"load",(function(){r(e,[this],n)}));const o=c(t);o&&(a(t,null),l(t,"onload"),a(t,o))}e.exports=function(e,t,n){for(let r=0;r<t.length;r++){const i=t[r],c=o(i,!0);for(let t=0;t<c.length;t++)u(e,c[t],n)}}},750:e=>{e.exports=function(e){e&&e.contentWindow}},228:(e,t,n)=>{const r=n(851),o=n(750),{shadows:i,getFramesArray:c,getFrameTag:a}=n(648),{getContentWindow:l,Object:s,getFrameElement:u}=n(14);function p(e,t){let n=-1;for(;e[++n];)if(!r(e[n],e,s)&&u(e[n])===t)return e[n];for(let e=0;e<i.length;e++){const n=i[e],r=c(n,!1);for(let e=0;e<r.length;e++)if(r[e]===t)return l(r[e],a(r[e]))}return null}e.exports=function(e,t,n){for(let r=0;r<t.length;r++){const i=t[r];o(i);const c=p(e,i);c&&n(c)}}},328:(e,t,n)=>{const{getFramesArray:r}=n(648),{removeAttribute:o,getAttribute:i,getTemplateContent:c,createElement:a,getInnerHTML:l,setInnerHTML:s}=n(14),{warn:u,WARN_IFRAME_ONLOAD_ATTRIBUTE_REMOVED:p}=n(312);function m(e){for(let t=0;t<e.length;t++){const n=e[t],r=i(n,"onload");r&&(u(p,n,r),o(n,"onload"))}}e.exports=function(e,t){for(let e=0;e<t.length;e++){const n=t[e],o=a(document,"template");s(o,n);const i=r(c(o),!1);i.length&&(m(i),t[e]=l(o))}}},352:(e,t,n)=>{const r=n(228),o=n(583),i=n(459),c=n(58),{hookShadowDOM:a}=n(373),{securely:l,addEventListener:s,getFrameElement:u}=n(14),{isMarked:p,mark:m}=n(111),{error:d,ERR_MARK_NEW_WINDOW_FAILED:f}=n(312);function g(e){try{const t=!p(e);return t&&m(e),t}catch(t){d(f,e,t)}return g(e)}function E(e,t){g(t)&&function(e,t,n,r){o(e,t),i(e,t),c(e,t),a(e,t),r(e,n)}(t,(function(n){E(e,n),s(u(n),"load",(function(){r(t,[this],(function(){E(e,n)}))}))}),l,e)}let y=!1;e.exports=function(e,t){y||(y=!0,E(e,t||window))}},58:(e,t,n)=>{const{protectShadows:r}=n(373),o=n(586),{getFramesArray:i,shadows:c}=n(648),{getParentElement:a,slice:l,Object:s,Function:u}=n(14),p=n(328),m=n(228),d={DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend","write","writeln"],Node:["appendChild","insertBefore","replaceChild"],Element:["innerHTML","outerHTML","insertAdjacentHTML","replaceWith","insertAdjacentElement","append","before","prepend","after","replaceChildren"],ShadowRoot:["innerHTML"],HTMLIFrameElement:["srcdoc"]};function f(e,t,n){return function(){const s=l(arguments),d=a(this)||this;o(e,s,n),o(e,c,n),p(e,s),p(e,c);const f=u.prototype.apply.call(t,this,s),g=i(d,!1);return m(e,g,n),m(e,s,n),r(e,n,!0),f}}e.exports=function(e,t){for(const n in d){const r=d[n];for(let o=0;o<r.length;o++){const i=r[o],c=s.getOwnPropertyDescriptor(e[n].prototype,i),a=c.set?"set":"value";c[a]=f(e,c[a],t),s.defineProperty(e[n].prototype,i,c)}}}},459:(e,t,n)=>{const r=n(228),{removeEventListener:o,addEventListener:i,slice:c,Map:a,Object:l}=n(14),s=new a;function u(e,t,n){if(t)return t.handleEvent?t.handleEvent.apply(t,n):t.apply(e,n)}function p(e,t){return function(n,o,a){let l=o;return"load"===n&&(s.has(o)||s.set(o,(function(){r(e,[this],t);const n=c(arguments);u(this,o,n)})),l=s.get(o)),i(this,n,l,a)}}e.exports=function(e,t){l.defineProperty(e.EventTarget.prototype,"addEventListener",{value:p(e,t)}),l.defineProperty(e.EventTarget.prototype,"removeEventListener",{value:function(e,t,n){let r=t;return"load"===e&&(r=s.get(t),s.delete(t)),o(this,e,r,n)}})}},312:e=>{e.exports={warn:function(e,t,n){let r;switch(e){case 1:const e=t,o=n;r=!1,console.warn("SNOW:","removing html string iframe onload attribute:",e,`"${o}"`,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/32#issuecomment-1239273328",".");break;case 3:const i=t,c=n;r=!1,console.warn("SNOW:","blocking open API call:",i,c,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/2#issuecomment-1239264255",".")}return r},error:function(e,t,n){let r;if(2===e){const e=t,o
diff --git a/node_modules/@lavamoat/snow/src/log.js b/node_modules/@lavamoat/snow/src/log.js
index 45e599c..093a852 100644
--- a/node_modules/@lavamoat/snow/src/log.js
+++ b/node_modules/@lavamoat/snow/src/log.js
@@ -16,7 +16,7 @@ function warn(msg, a, b) {
break;
case WARN_OPEN_API_DISABLED:
const args = a, win = b;
- bail = true;
+ bail = false;
console.warn('SNOW:',
'blocking open API call:', args, win, '.', '\n',
'if this prevents your application from running correctly, please visit/report at',