Skip to content

Commit 053560b

Browse files
committed
Merge pull request reduxjs#732 from Andreyco/patch-1
Don't render directly to document.body
2 parents 47aefb1 + 1c7b97e commit 053560b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/real-world/createDevToolsWindow.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,27 @@ import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
77
* Based on https://gist.github.com/tlrobinson/1e63d15d3e5f33410ef7#gistcomment-1560218.
88
*/
99
export default function createDevToolsWindow(store) {
10+
// Window name.
11+
const name = 'Redux DevTools';
12+
1013
// Give it a name so it reuses the same window.
1114
const win = window.open(
1215
null,
13-
'Redux DevTools',
16+
name,
1417
'menubar=no,location=no,resizable=yes,scrollbars=no,status=no'
1518
);
1619

1720
// Reload in case it's reusing the same window with the old content.
1821
win.location.reload();
22+
23+
// Set visible Window title.
24+
win.document.title = name;
1925

2026
// Wait a little bit for it to reload, then render.
2127
setTimeout(() => render(
2228
<DebugPanel top right bottom left>
2329
<DevTools store={store} monitor={LogMonitor} />
2430
</DebugPanel>,
25-
win.document.body
31+
win.document.body.appendChild(document.createElement('div'))
2632
), 10);
2733
}

0 commit comments

Comments
 (0)