Upstream Electron bug in 1.7.5 (electron 32): DevTools always opens in Light Mode

My eyes are burning…

Upstream bug: [Bug][Regression][32-33]: Dark theme is not applied to Dev Tools · Issue #43367 · electron/electron · GitHub

I know this isn’t directly an Obsidian bug, but there is a hack/workaround that fixes it e.g. here. Since it’s typically long cycle between major bundled Electron updates, this might be worth looking into…

2 Likes

On Windows, I got dark mode … :love_you_gesture:

Cheers, Marko :nerd_face:

Possibly only affecting macOS/Linux. Would love others to confirm that.

Im on mac and I also have this issue. Thanks for the info!

Win11, downloaded the v1.7.5 exe today, also have this issue. Try to patch following the solution provided in the original post. Thanks.

const { remote } = require('electron')
const devTheme = (webContents)=> {
  const { nativeTheme } = remote
  webContents.on('devtools-opened', ()=> {
    nativeTheme.themeSource = 'light'
    setTimeout(()=> {
      nativeTheme.themeSource = 'dark' // or 'system'
    }, 300)
  })
}
const devtools = ()=> {
  devTheme(remote.getCurrentWindow().webContents)
  remote.app.on('web-contents-created', (createEvt, webContents)=> {
    if (webContents.getType() == 'window') devTheme(webContents)
  })
}
const ob = require('obsidian')
module.exports = class extends ob.Plugin {
  onload() {
    devtools()
  }
  onunload() {}
}

241107: fit when opening the devtools on new windows.

1 Like

On MacOS Sequoia 15.1, I also have this problem.

Actually on my Windows 11, the dev tool would also open as Light Theme - even I set it to Dark theme before:

My eyes, my eyes…!

Thank you for the patch!!

They’ve merged the fix upstream. It’s landing in Electron 35, fyi.

The fix for this was back ported and should be 1.7.7. you will need to download and reinstall obsidian.

1 Like

Confirmed, it’s fixed in 1.7.7. My eyes thank you.