mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-04-01 12:31:51 +00:00
Fix filter exception when injecting CSS (PR #837)
When injecting CSS, an `onBeforeRequest paramater 'filter' must have property 'urls'` error is thrown.  This is caused by [Electron PR #19337: Throw on invalid webRequest filters](https://github.com/electron/electron/pull/19337). So, pass filter argument properly, like Electron expects it strictly.
This commit is contained in:
parent
4f235c550a
commit
e00f08e5d6
@ -58,7 +58,7 @@ function maybeInjectCss(browserWindow) {
|
|||||||
// we have to inject the css in onHeadersReceived so they're early enough
|
// we have to inject the css in onHeadersReceived so they're early enough
|
||||||
// will run multiple times, so did-finish-load will remove this handler
|
// will run multiple times, so did-finish-load will remove this handler
|
||||||
browserWindow.webContents.session.webRequest.onHeadersReceived(
|
browserWindow.webContents.session.webRequest.onHeadersReceived(
|
||||||
[], // Pass an empty filter list; null will not match _any_ urls
|
{ urls: [] }, // Pass an empty filter list; null will not match _any_ urls
|
||||||
onHeadersReceived,
|
onHeadersReceived,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user