creating this issue to accompany the PR at #503
What createConsoleOverride does is just to call postParentMessage before calling console output methods, but if window.parent === window postParentMessage does nothing, so should we override console only if window.parent !== window? At least this fixes the issue in external browser.
Repro steps:
- Open a preview in an external window.
- console.log some text in your code.
- devtools console shows the line number in the injected script rather than where it is in user code 🐛
This is related to #449, but this can be easily fixed in the external browser because the console doesn't need to be overridden. In this particular case, we can easily identify this as an external browser because the window parent is itself.
creating this issue to accompany the PR at #503
Repro steps:
This is related to #449, but this can be easily fixed in the external browser because the console doesn't need to be overridden. In this particular case, we can easily identify this as an external browser because the window parent is itself.