Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
fix(d3): fix d3 hack for electron env
Browse files Browse the repository at this point in the history
index.html, and the scripts loaded, is used in the usual browser env and in
the electron one. For d3 there was an hack to load it correctly in the electron
env.

Setting node integration to the browser window, when it runs in the electron
env, d3 is loaded without any hack.
  • Loading branch information
albertosantini committed May 8, 2016
1 parent 97c59f3 commit e042465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ app.on("ready", function () {
frame: false,
height: 800,
icon: "src/client/favicon.ico",
width: 1450
width: 1450,
"node-integration": false
});

mainWindow.loadURL("http://localhost:8000");
Expand Down
1 change: 0 additions & 1 deletion src/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<script src="node_modules/ngSocket/dist/ngSocket.js"></script>
<script src="node_modules/angular-local-storage/dist/angular-local-storage.min.js"></script>
<script src="node_modules/d3/d3.min.js"></script>
<script>if (typeof module === "object") { window.d3 = module.exports; } // electron d3 hack</script>
<script src="node_modules/techan/dist/techan.min.js"></script>

<script src="app/app.module.js"></script>
Expand Down

0 comments on commit e042465

Please sign in to comment.