docs: add sample code for contents.insertCSS() (#16959)
it not work before Event: 'did-finish-load', so add this sample code to show it.
This commit is contained in:
parent
7f007109c3
commit
391f6dd663
1 changed files with 6 additions and 0 deletions
|
@ -943,6 +943,12 @@ Returns `String` - The user agent for this web page.
|
|||
|
||||
Injects CSS into the current web page.
|
||||
|
||||
```js
|
||||
contents.on('did-finish-load', function () {
|
||||
contents.insertCSS('html, body { background-color: #f00; }')
|
||||
})
|
||||
```
|
||||
|
||||
#### `contents.executeJavaScript(code[, userGesture, callback])`
|
||||
|
||||
* `code` String
|
||||
|
|
Loading…
Reference in a new issue