Skip to content

Commit fd5ab10

Browse files
committed
Require Electron 5 or later
1 parent 28e34f2 commit fd5ab10

File tree

5 files changed

+15
-28
lines changed

5 files changed

+15
-28
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
language: node_js
22
node_js:
3-
- '10'
3+
- '12'

index.d.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ declare const electronDebug: {
3535
@example
3636
```
3737
import {app, BrowserWindow} from 'electron';
38-
import electronDebug = require('electron-debug');
38+
import debug = require('electron-debug');
3939
40-
electronDebug();
40+
debug();
4141
42-
let win;
42+
let mainWindow;
4343
(async () => {
4444
await app.whenReady();
45-
win = new BrowserWindow();
45+
mainWindow = new BrowserWindow();
4646
});
4747
```
4848
*/
@@ -68,9 +68,6 @@ declare const electronDebug: {
6868
@param window - Default: `BrowserWindow.getFocusedWindow()`
6969
*/
7070
openDevTools(window?: BrowserWindow): void;
71-
72-
// TODO: Remove this for the next major release
73-
default: typeof electronDebug;
7471
};
7572

7673
export = electronDebug;

index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,9 @@ module.exports = options => {
8383

8484
app.on('browser-window-created', (event, win) => {
8585
if (options.showDevTools) {
86-
win.webContents.once('devtools-opened', () => {
87-
// Workaround for https://github.com/electron/electron/issues/13095
88-
setImmediate(() => {
89-
win.focus();
90-
});
91-
});
92-
9386
/// Workaround for https://github.com/electron/electron/issues/12438
9487
win.webContents.once('dom-ready', () => {
95-
openDevTools(win, options.showDevTools);
88+
openDevTools(win, options.showDevTools, false);
9689
});
9790
}
9891
});
@@ -112,9 +105,6 @@ module.exports = options => {
112105
})();
113106
};
114107

115-
// TODO: Remove this for the next major release
116-
module.exports.default = module.exports;
117-
118108
module.exports.refresh = refresh;
119109
module.exports.devTools = devTools;
120110
module.exports.openDevTools = openDevTools;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
"development"
2828
],
2929
"dependencies": {
30-
"electron-is-dev": "^0.3.0",
30+
"electron-is-dev": "^1.1.0",
3131
"electron-localshortcut": "^3.1.0"
3232
},
3333
"devDependencies": {
34-
"@types/node": "^11.13.0",
34+
"@types/node": "^12.0.0",
3535
"devtron": "^1.4.0",
36-
"electron": "^2.0.2",
36+
"electron": "^5.0.1",
3737
"electron-react-devtools": "^0.5.3",
3838
"tsd": "^0.7.2",
3939
"xo": "^0.24.0"

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Just install any of these extension and they'll be activated for you:
4343
$ npm install electron-debug
4444
```
4545

46-
*Requires Electron 4 or later.*
46+
*Requires Electron 5 or later.*
4747

4848
<a href="https://www.patreon.com/sindresorhus">
4949
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
@@ -58,10 +58,10 @@ const debug = require('electron-debug');
5858

5959
debug();
6060

61-
let win;
61+
let mainWindow;
6262
(async () => {
6363
await app.whenReady();
64-
win = new BrowserWindow();
64+
mainWindow = new BrowserWindow();
6565
})();
6666
```
6767

@@ -76,7 +76,7 @@ Install keyboard shortcuts and optionally activate DevTools on each created `Bro
7676

7777
#### options
7878

79-
Type: `Object`
79+
Type: `object`
8080

8181
##### isEnabled
8282

@@ -92,8 +92,8 @@ Show DevTools on each created `BrowserWindow`.
9292
##### devToolsMode
9393

9494
Type: `string`<br>
95-
Default: `undocked`<br>
96-
Values: `undocked` `right` `bottom` `previous` `detach`
95+
Default: `'undocked'`<br>
96+
Values: `'undocked'` `'right'` `'bottom'` `'previous'` `'detach'`
9797

9898
The dock state to open DevTools in.
9999

0 commit comments

Comments
 (0)