Skip to content

Commit

Permalink
Fix windows loadFile compat (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfield committed Mar 27, 2024
1 parent 49d16a6 commit 5778713
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/windows.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ class SauceBrowserWindow extends electron.BrowserWindow {
return (this.subWindow ? '[sub-window] ' : '') +
(this.spec ? `specId:${this.spec.id}` : `id:${this.id}`);
}

loadFile(pathname, options) {
// Same as stock loadFile except we don't inject electron.app.getAppPath().
// On windows this will add a drive letter root to all paths. This is
// machine dependent, unnecessary and increases the complexity of our
// electron.protocol.handle(...) interceptor.
return this.loadURL(urlMod.format({
protocol: 'file',
slashes: true,
pathname,
...options,
}));
}
}


Expand Down

0 comments on commit 5778713

Please sign in to comment.