Skip to content

Commit 21f1fff

Browse files
committed
plug a few electron-remote-related security holes.
1 parent 05da5da commit 21f1fff

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

_todo.md

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727

2828
#### logging
2929

30+
#### filesystem
31+
32+
* eliminate dependency on electron remote module.
33+
* migrate filebrowser to html File, etc..
34+
3035
#### drawing/rendering
3136

3237
* custom mouse cursors

src/app/app.js

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export default class ImguiApp
2424
this.runtime = (window.process && window.process.type) ? "electron"
2525
: (window.cordova) ? "cordova" : "browser";
2626
this.filesystem = new FileSystem(this.runtime);
27-
this.fs = this.filesystem.fs;
28-
this.path = this.filesystem.path;
2927
this.canvas = document.getElementById("AppCanvas");
3028
if(!this.canvas)
3129
{

src/app/filesystem.js

+6
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ export class FileSystem
4848
if(runtime == "electron")
4949
{
5050
// we use window.require to trick webpack for electron
51+
/* we don't want to use remote package since it's
52+
* deprecated.
53+
*/
54+
55+
/*
5156
let remote = window.require("electron").remote;
5257
this.fs = remote.require("fs");
5358
this.path = window.require("path");
59+
*/
5460
this.isWindows = navigator &&
5561
(navigator.platform.indexOf("Win32") != -1);
5662
}

0 commit comments

Comments
 (0)