Skip to content

Commit

Permalink
Update DevTools console patching to patch the parent window's console…
Browse files Browse the repository at this point in the history
… rather than the iframe, to more accurately simulate real usage environment
  • Loading branch information
Brian Vaughn committed Oct 9, 2019
1 parent c17786b commit 4f9c35a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-devtools-shell/src/app/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ function ignoreStrings(
methodName: string,
stringsToIgnore: Array<string>,
): void {
const originalMethod = console[methodName];
// HACKY In the test harness, DevTools overrides the parent window's console.
// Our test app code uses the iframe's console though.
// To simulate a more accurate end-ot-end ienvironment,
// the shell's console patching should pass through to the parent override methods.
const originalMethod = window.parent.console[methodName];

console[methodName] = (...args) => {
const maybeString = args[0];
if (typeof maybeString === 'string') {
Expand Down

0 comments on commit 4f9c35a

Please sign in to comment.