mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-22 18:18:55 +00:00
Fix filter exception when injecting CSS (PR #837)
When injecting CSS, an `onBeforeRequest paramater 'filter' must have property 'urls'` error is thrown. ![image](https://user-images.githubusercontent.com/599164/63574823-a3dd6180-c5c3-11e9-89c0-a9debdd4f696.png) 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
|
||||
// will run multiple times, so did-finish-load will remove this handler
|
||||
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,
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user