Skip to content

Instantly share code, notes, and snippets.

@ibdknox
Created June 15, 2013 00:49
Show Gist options
  • Save ibdknox/5786292 to your computer and use it in GitHub Desktop.
Save ibdknox/5786292 to your computer and use it in GitHub Desktop.
make node-webkit crash with devtools + webgl
<html>
<head>
<meta charset='utf-8'>
<title>
WebGL
</title>
<style>
body { background: #202020; color:#ccc; }
a { color:#ccc; }
iframe {border:none;}
</style>
</head>
<body>
<a href="#" id="move">move iframe</a>
<div id="parent">
<iframe src="http://threejs.org/examples/webgl_buffergeometry.html" width="50%" height="50%" nwfaketop="true" nwdisable="true"></iframe>
</div>
<div id="newparent">
</div>
<script type="text/javascript">
require("nw.gui").Window.get().showDevTools();
var iframe = document.querySelector("iframe");
var button = document.querySelector("#move");
console.log(button);
button.addEventListener("click", function(e) {
document.querySelector("#newparent").appendChild(iframe);
e.preventDefault();
return false;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment