Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 22, 2020
1 parent 212552f commit bbce608
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: node_js
node_js:
- '14'
- '12'
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"description": "Adds useful debug features to your Electron app",
"license": "MIT",
"repository": "sindresorhus/electron-debug",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"scripts": {
"start": "electron test.js",
Expand Down
23 changes: 9 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

> Adds useful debug features to your [Electron](https://electronjs.org) app

## Features

### DevTools
Expand Down Expand Up @@ -36,7 +35,6 @@ Just install any of these extension and they'll be activated for you:
- [devtron](https://electronjs.org/devtron) - The official Electron DevTools extension
- [electron-react-devtools](https://github.com/firejune/electron-react-devtools) - React DevTools extension for Electron


## Install

```
Expand All @@ -45,7 +43,6 @@ $ npm install electron-debug

*Requires Electron 5 or later.*


## Usage

```js
Expand All @@ -61,12 +58,11 @@ let mainWindow;
})();
```


## API

Only runs when in [development](https://github.com/sindresorhus/electron-is-dev), unless overridden by the `isEnabled` option. So no need to guard it for production.

### electronDebug([options])
### electronDebug(options?)

Install keyboard shortcuts and optionally activate DevTools on each created `BrowserWindow`.

Expand All @@ -80,35 +76,35 @@ Type: `boolean`

##### showDevTools

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

Show DevTools on each created `BrowserWindow`.

##### devToolsMode

Type: `string`<br>
Default: `'previous'`<br>
Type: `string`\
Default: `'previous'`\
Values: `'undocked'` `'right'` `'bottom'` `'previous'` `'detach'`

The dock state to open DevTools in.

### devTools([window])
### devTools(window?)

Toggle DevTools for the specified `BrowserWindow` instance or the focused one.

#### window

Type: `BrowserWindow`<br>
Type: `BrowserWindow`\
Default: The focused `BrowserWindow`

### refresh([window])
### refresh(window?)

Reload the specified `BrowserWindow` instance or the focused one.

#### window

Type: `BrowserWindow`<br>
Type: `BrowserWindow`\
Default: The focused `BrowserWindow`

### openDevTools([window])
Expand All @@ -117,10 +113,9 @@ Open DevTools for the specified `BrowserWindow` instance or the focused one.

#### window

Type: `BrowserWindow`<br>
Type: `BrowserWindow`\
Default: The focused `BrowserWindow`


## Related

- [electron-util](https://github.com/sindresorhus/electron-util) - Useful utilities for developing Electron apps and modules
Expand Down
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const debug = require('.');
debug();

const load = async url => {
const win = new electron.BrowserWindow({show: true});
await win.loadURL(url);
win.removeMenu();
const window_ = new electron.BrowserWindow({show: true});
await window_.loadURL(url);
window_.removeMenu();
};

(async () => {
Expand Down

0 comments on commit bbce608

Please sign in to comment.