Electron: Correctly identify local contents pathname on Windows (#4503)
This commit is contained in:
parent
584f06fafc
commit
8b19d5e72c
@ -68,7 +68,11 @@ export function checkIsWebContentsUrlAllowed(url: string): boolean {
|
|||||||
|
|
||||||
const parsedUrl = new URL(url);
|
const parsedUrl = new URL(url);
|
||||||
|
|
||||||
if (parsedUrl.pathname === encodeURI(`${__dirname}/index.html`)) {
|
const localContentsPathname = IS_WINDOWS
|
||||||
|
? encodeURI(`/${__dirname.replace(/\\/g, '/')}/index.html`)
|
||||||
|
: encodeURI(`${__dirname}/index.html`);
|
||||||
|
|
||||||
|
if (parsedUrl.pathname === localContentsPathname) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user