📝 Normalize code tags
[ci skip]
This commit is contained in:
parent
741f8091b4
commit
7fa4b7c8b5
3 changed files with 5 additions and 5 deletions
|
@ -453,7 +453,7 @@ use this method to ensure single instance.
|
||||||
An example of activating the window of primary instance when a second instance
|
An example of activating the window of primary instance when a second instance
|
||||||
starts:
|
starts:
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
var myWindow = null;
|
var myWindow = null;
|
||||||
|
|
||||||
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
||||||
|
@ -489,7 +489,7 @@ correctly when DWM composition is disabled).
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
let browserOptions = {width: 1000, height: 800};
|
let browserOptions = {width: 1000, height: 800};
|
||||||
|
|
||||||
// Make the window transparent only if the platform supports it.
|
// Make the window transparent only if the platform supports it.
|
||||||
|
|
|
@ -315,7 +315,7 @@ Commands are lowercased with underscores replaced with hyphens and the
|
||||||
`APPCOMMAND_` prefix stripped off.
|
`APPCOMMAND_` prefix stripped off.
|
||||||
e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
|
e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
someWindow.on('app-command', function(e, cmd) {
|
someWindow.on('app-command', function(e, cmd) {
|
||||||
// Navigate the window back when the user hits their mouse back button
|
// Navigate the window back when the user hits their mouse back button
|
||||||
if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) {
|
if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) {
|
||||||
|
@ -682,7 +682,7 @@ Changes the attachment point for sheets on Mac OS X. By default, sheets are
|
||||||
attached just below the window frame, but you may want to display them beneath
|
attached just below the window frame, but you may want to display them beneath
|
||||||
a HTML-rendered toolbar. For example:
|
a HTML-rendered toolbar. For example:
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
|
var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
|
||||||
win.setSheetOffset(toolbarRect.height);
|
win.setSheetOffset(toolbarRect.height);
|
||||||
```
|
```
|
||||||
|
|
|
@ -23,7 +23,7 @@ beginning to load the web page or the main script.
|
||||||
It can be used by the preload script to add removed Node global symbols back to
|
It can be used by the preload script to add removed Node global symbols back to
|
||||||
the global scope when node integration is turned off:
|
the global scope when node integration is turned off:
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
// preload.js
|
// preload.js
|
||||||
var _setImmediate = setImmediate;
|
var _setImmediate = setImmediate;
|
||||||
var _clearImmediate = clearImmediate;
|
var _clearImmediate = clearImmediate;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue