electron/fuses

How to confirm fuse values at runtime?

Nantris opened this issue · 6 comments

The fuse for NODE_OPTIONS logs to the console when it can't be used - NODE_OPTIONS have been disabled in this app - but the others seem not to log anything, or perhaps are not being set properly.

I ask because it seems like setting [FuseV1Options.EnableNodeCliInspectArguments]: false has no effect, --inspect still seems to work (granted I am not testing it directly, but rather loading the app in Debugtron - which seems to simply run the app with --inspect)

Our configuration of the fuses is adapted from this code for setting fuses: electron-userland/electron-builder#6365 (comment)

npx @electron/fuses read --app path/to/Thing.app

Should output some info to the terminal about the current status of fuses

Thanks for the reply @MarshallOfSound!

I see the output EnableNodeCliInspectArguments is Disabled - but Debugtron is still able to open debugger instances for the app, which it seems should not be possible if this fuse is having the desired effect. Is there something I'm overlooking?

@MarshallOfSound any thoughts on why this might be?

Note that the following code prevents Debugtron from working - which implies it uses the --inspect flag, which implies that the fuse enableNodeCliInspectArguments: false should prevent it from being able to debug an application, but this is not the case. Debugtron still works to debug the application.

// electron main
for (let i = 0; i < process.argv.length; i++) {
  const arg = process.argv[i]
  if (arg.indexOf('--inspect') !== -1 || arg.indexOf('--remote-debugging-port') !== -1) {
    throw new Error('Not allow debugging this program.')
  }
}

--remote-debugging-port is not affected by fuses, it is a Chromium flag that impacts renderer processes and as such can be filtered by the main app bundle if you choose.

Can you confirm if --inspect is working, or whether it is --remote-debugging-port you are seeing work?

Confirming the fuse works as intended. Sorry to waste time with a bad test case.