Skip to content

Commit

Permalink
Use atob in execution env
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Dec 3, 2024
1 parent d882f64 commit a17d7de
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { PostMessageEvent } from '@metamask/post-message-stream';
import { BasePostMessageStream } from '@metamask/post-message-stream';
import { isValidStreamMessage } from '@metamask/post-message-stream/dist/utils';
import { base64ToBytes, bytesToString } from '@metamask/utils';

type WebViewExecutorStreamArgs = {
name: string;
Expand Down Expand Up @@ -66,8 +65,7 @@ export class WebViewExecutorStream extends BasePostMessageStream {
return;
}

const bytes = base64ToBytes(event.data);
const message = JSON.parse(bytesToString(bytes));
const message = JSON.parse(atob(event.data));

// Notice that we don't check targetWindow or targetOrigin here.
// This doesn't seem possible to do in RN.
Expand Down

0 comments on commit a17d7de

Please sign in to comment.