From bbce608ca4aa2846d6fde06e34046abf79a314b1 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 22 May 2020 16:38:43 +0800 Subject: [PATCH] Meta tweaks --- .travis.yml | 1 + license | 2 +- package.json | 3 ++- readme.md | 23 +++++++++-------------- test.js | 6 +++--- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index afb9d6d..d3847f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: + - '14' - '12' diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/package.json b/package.json index 6b6f54d..29ecd89 100644 --- a/package.json +++ b/package.json @@ -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": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "scripts": { "start": "electron test.js", diff --git a/readme.md b/readme.md index 0d0986a..15ad2d6 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,6 @@ > Adds useful debug features to your [Electron](https://electronjs.org) app - ## Features ### DevTools @@ -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 ``` @@ -45,7 +43,6 @@ $ npm install electron-debug *Requires Electron 5 or later.* - ## Usage ```js @@ -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`. @@ -80,35 +76,35 @@ Type: `boolean` ##### showDevTools -Type: `boolean`
+Type: `boolean`\ Default: `true` Show DevTools on each created `BrowserWindow`. ##### devToolsMode -Type: `string`
-Default: `'previous'`
+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`
+Type: `BrowserWindow`\ Default: The focused `BrowserWindow` -### refresh([window]) +### refresh(window?) Reload the specified `BrowserWindow` instance or the focused one. #### window -Type: `BrowserWindow`
+Type: `BrowserWindow`\ Default: The focused `BrowserWindow` ### openDevTools([window]) @@ -117,10 +113,9 @@ Open DevTools for the specified `BrowserWindow` instance or the focused one. #### window -Type: `BrowserWindow`
+Type: `BrowserWindow`\ Default: The focused `BrowserWindow` - ## Related - [electron-util](https://github.com/sindresorhus/electron-util) - Useful utilities for developing Electron apps and modules diff --git a/test.js b/test.js index 416ce1d..8526a74 100644 --- a/test.js +++ b/test.js @@ -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 () => {