Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Last active August 20, 2019 23:54
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tlrobinson/1e63d15d3e5f33410ef7 to your computer and use it in GitHub Desktop.
Save tlrobinson/1e63d15d3e5f33410ef7 to your computer and use it in GitHub Desktop.
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
// give it a name so it reuses the same window
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
// reload in case it's reusing the same window with the old content
win.location.reload();
// wait a little bit for it to reload, then render
setTimeout(function() {
React.render(
<DebugPanel top right bottom left >
<DevTools store={store} monitor={LogMonitor} />
</DebugPanel>
, win.document.body);
}, 10);
@NeXTs
Copy link

NeXTs commented Nov 1, 2015

In case you want to close separate dev-tools window by closing working tab

// Close separate window by closing working tab
window.onunload = function() {
  win.close();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment