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:
Gavin Wang 2019-02-26 10:10:56 +08:00 committed by Samuel Attard
parent 7f007109c3
commit 391f6dd663

View file

@ -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