зеркало из https://github.com/electron/electron.git
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:
Родитель
7f007109c3
Коммит
391f6dd663
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче