docs: correcting main example in WebRequest documentation (#36113)
Correcting main example The entry `*://electron.github.io` is invalid and produces an exception. i.e. > UnhandledPromiseRejectionWarning: TypeError: Invalid url pattern *://electron.github.io: Empty path. Setting a valid path to resolve this issue
This commit is contained in:
parent
ff4816367e
commit
02ad8fcd5f
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ const { session } = require('electron')
|
||||||
|
|
||||||
// Modify the user agent for all requests to the following urls.
|
// Modify the user agent for all requests to the following urls.
|
||||||
const filter = {
|
const filter = {
|
||||||
urls: ['https://*.github.com/*', '*://electron.github.io']
|
urls: ['https://*.github.com/*', '*://electron.github.io/*']
|
||||||
}
|
}
|
||||||
|
|
||||||
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
|
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue