joethei/obsidian-link-favicon

Bug: When using `Adapt to theme`, plugin fails in Reading Mode

Closed this issue ยท 7 comments

yea well, so that was another round of debugging a lot... ๐Ÿ™ˆ

So, the plugin fails to show favicons when

  1. The new Adapt to theme in Appearance is activated
  2. you are in reading mode
  3. then restart once

The following error appears in the console:

Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at Gt.eval (plugin:link-favicon:9:1486)
    at Generator.next (<anonymous>)
    at eval (plugin:link-favicon:7:907)
    at new Promise (<anonymous>)
    at I (plugin:link-favicon:7:727)
    at Gt.setColorAttributes (plugin:link-favicon:9:1242)
    at Bt.eval (plugin:link-favicon:8:2675)
    at Generator.next (<anonymous>)
    at c (plugin:link-favicon:7:765)

in case it helps finding the issue, when I use the System Dark Mode Plugin instead of adapt to theme, the plugin works without issues

It's probably somewhat related, that when the theme is set to Adapt to system (and system happens to be dark) favicon colors are inverted. It happened already when switching between themes but it could be solved by reloading, but that doesn't work here.

I think the problem might be here. app.getTheme() yields 'system' on auto dark mode.

๐Ÿคฆโ€โ™‚๏ธI forgot to check that when I investigated this earlier.
Will fix

When can we expect progress on the GitHub issues, @joethei? Could outside help make things faster? (Some of them, like the line I linked don't look like they would need much time to fix.)

I do have a fix for this one ready, currently doing other fixes/refactors for some other issues.
Currently, fixing #35.
Given the scope of the refactor I will probably not accept PR's at the moment.

Hi @joethei!
Sorry to bother you, but this plugin is really important in my workflows and the issues still persist. When can we expect progress on this plugin? Even a partial update release would be much appreciated.