Skip to content

Commit

Permalink
fix: parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Saber2pr committed Sep 2, 2022
1 parent 30cb4aa commit 3b18ce2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sandbox/hooks.ts
Expand Up @@ -13,9 +13,9 @@ export const ConsoleHook = `<script data-type="${KEYS.__SANDBOX_HOOK__}">
console.log = function() {
origin_log.apply(this, arguments)
var output = Array.from(arguments).join(" ")
top.postMessage({method: "${KEYS.__MESSAGE_CONSOLE__}", value: output}, top.location.origin)
parent.postMessage({method: "${KEYS.__MESSAGE_CONSOLE__}", value: output}, parent.location.origin)
}
window.addEventListener('error', event => {
top.postMessage({method: "${KEYS.__MESSAGE_CONSOLE_ERROR__}", value: event.message}, top.location.origin)
parent.postMessage({method: "${KEYS.__MESSAGE_CONSOLE_ERROR__}", value: event.message}, parent.location.origin)
})
})()</script>`

0 comments on commit 3b18ce2

Please sign in to comment.