Skip to content

Commit

Permalink
fix: messages from others iframes cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chunibyocola committed Oct 21, 2021
1 parent 178214b commit 18bc15f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/public/play-audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const appendAudioIframe = (element: HTMLElement | ShadowRoot) => {
element.appendChild(audioIframe);

window.addEventListener('message', (e) => {
if ('sc-translator-audio' in e.data) {
if (e.origin + '/' === chrome.runtime.getURL('/')) {
const { type } = e.data['sc-translator-audio'];

switch (type) {
Expand Down

0 comments on commit 18bc15f

Please sign in to comment.