Skip to content

Commit

Permalink
Block requests to file: outside of the app in Electron environment
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Aug 24, 2023
1 parent 0f4d201 commit 84500d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,16 @@ app.on('web-contents-created', (event, contents) => {
});
});
app.on('session-created', (session) => {
session.webRequest.onBeforeRequest({
urls: ["file://*"]
}, (details, callback) => {
callback({
cancel: !details.url.startsWith(resourcesURL)
});
});
});
app.on('window-all-closed', () => {
app.quit();
});
Expand Down

0 comments on commit 84500d0

Please sign in to comment.