Skip to content

Commit

Permalink
fix: @W-15147937 do not remap Blob, File, FileReader and URL when rem…
Browse files Browse the repository at this point in the history
…apTypedArrays = false (#455)
  • Loading branch information
rwaldron authored Mar 1, 2024
1 parent a034887 commit 1697b8f
Show file tree
Hide file tree
Showing 2 changed files with 472 additions and 4 deletions.
8 changes: 8 additions & 0 deletions packages/near-membrane-dom/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export function filterWindowKeys(keys: PropertyKey[], remapTypedArrays: boolean)
excludedKeys.add('crypto');
excludedKeys.add('Crypto');
excludedKeys.add('SubtleCrypto');
excludedKeys.add('Blob');
excludedKeys.add('File');
excludedKeys.add('FileReader');
excludedKeys.add('URL');
}
const result: PropertyKey[] = [];
let resultOffset = 0;
Expand Down Expand Up @@ -128,6 +132,10 @@ export function removeWindowDescriptors<T extends PropertyDescriptorMap>(
ReflectDeleteProperty(unsafeDescs, 'crypto');
ReflectDeleteProperty(unsafeDescs, 'Crypto');
ReflectDeleteProperty(unsafeDescs, 'SubtleCrypto');
ReflectDeleteProperty(unsafeDescs, 'Blob');
ReflectDeleteProperty(unsafeDescs, 'File');
ReflectDeleteProperty(unsafeDescs, 'FileReader');
ReflectDeleteProperty(unsafeDescs, 'URL');
}
return unsafeDescs;
}
Expand Down
Loading

0 comments on commit 1697b8f

Please sign in to comment.