Skip to content

Commit

Permalink
fix: do not remap crypto, Crypto and SubtleCrypto if remapTypedArrays…
Browse files Browse the repository at this point in the history
… is false
  • Loading branch information
rwaldron committed Feb 12, 2024
1 parent 8255881 commit dc20856
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/near-membrane-dom/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export function filterWindowKeys(keys: PropertyKey[], remapTypedArrays: boolean)

// Crypto and typed arrays must be from the same global object
if (remapTypedArrays === false) {
result.splice(result.indexOf('crypto'), 1);
result.splice(result.indexOf('Crypto'), 1);
result.splice(result.indexOf('SubtleCrypto'), 1);
}

return result;
Expand Down Expand Up @@ -129,7 +131,9 @@ export function removeWindowDescriptors<T extends PropertyDescriptorMap>(
ReflectDeleteProperty(unsafeDescs, 'chrome');
// Crypto and typed arrays must be from the same global object
if (remapTypedArrays === false) {
ReflectDeleteProperty(unsafeDescs, 'crypto');
ReflectDeleteProperty(unsafeDescs, 'Crypto');
ReflectDeleteProperty(unsafeDescs, 'SubtleCrypto');
}
return unsafeDescs;
}
Expand Down

0 comments on commit dc20856

Please sign in to comment.