Skip to content

Commit

Permalink
Merge pull request #269 from JasonReed-2/master
Browse files Browse the repository at this point in the history
Fix VSCode debug settings so that can debug main and fix reload on error
  • Loading branch information
Jazcash authored Sep 24, 2024
2 parents 840e162 + dcad684 commit 242d2dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"version": "0.2.0",
"configurations": [

{
"type": "node",
"request": "launch",
"name": "Electron: Main",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run", "debug"
]
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
},
"runtimeArgs": ["--sourcemap"],
"env": { "REMOTE_DEBUGGING_PORT": "9223" }
},
{
"name": "Electron: Renderer",
Expand All @@ -23,10 +24,10 @@
"compounds": [
{
"name": "Electron: All",
"configurations": [
"Electron: Main",
"Electron: Renderer"
]
"configurations": ["Electron: Main", "Electron: Renderer"],
"presentation": {
"order": 1
}
}
]
}
}
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class Application {
app.on("web-contents-created", (event, contents) => {
contents.on("will-navigate", (event, navigationUrl) => {
const parsedUrl = new URL(navigationUrl);
if (process.env.ELECTRON_RENDERER_URL && parsedUrl.protocol == "http:" && parsedUrl == new URL(process.env.ELECTRON_RENDERER_URL)) {
if (process.env.ELECTRON_RENDERER_URL && parsedUrl.protocol == "http:" && parsedUrl.toString() == process.env.ELECTRON_RENDERER_URL + "/") {
return; //allow
}
if (parsedUrl.protocol == "file:" && parsedUrl.pathname) {
Expand Down

0 comments on commit 242d2dd

Please sign in to comment.