Skip to content

Commit

Permalink
docs: correcting main example in WebRequest documentation (#36160)
Browse files Browse the repository at this point in the history
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

Co-authored-by: Shane Gannon <sgannon200@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shane Gannon <sgannon200@gmail.com>
  • Loading branch information
trop[bot] and sregger committed Oct 27, 2022
1 parent 47bc841 commit 0ee70e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/web-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { session } = require('electron')

// Modify the user agent for all requests to the following urls.
const filter = {
urls: ['https://*.github.com/*', '*://electron.github.io']
urls: ['https://*.github.com/*', '*://electron.github.io/*']
}

session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
Expand Down

0 comments on commit 0ee70e9

Please sign in to comment.