Frewacom / pywalfox

Dynamic theming of Firefox (and Thunderbird) using your Pywal colors
https://addons.mozilla.org/en-US/firefox/addon/pywalfox/
Mozilla Public License 2.0
583 stars 12 forks source link

Firefox cannot use the script #10

Closed morpheusthewhite closed 4 years ago

morpheusthewhite commented 4 years ago

I installed your script without any errors (the output is exactly the same on the README), but Firefox seems not to be able to use it; I already checked the troubleshooting section of the README none of the suggested conditions occurred.

By looking at the console, after starting Firefox no error appears. But if I try to go to the plugin settings page, different errors are raised:

Frewacom commented 4 years ago

The TypeErrors you got is a side-effect of the colors not being fetched correctly.

I have been looking around other similiar issues people have had with setting up the native app communication in Firefox and it could possibly be something with python. What happens if you run env python in your terminal?

morpheusthewhite commented 4 years ago

This is the output

$ env python
Python 3.8.2 (default, Feb 26 2020, 22:21:03) 
[GCC 9.2.1 20200130] on linux
Frewacom commented 4 years ago

Did you restart Firefox after running setup.sh?

JamesDalboth commented 4 years ago

This is something I have also been experiencing. My python env is 3.6.9 and I have restarted firefox and my pc a few times in an attempt to get it working.

Frewacom commented 4 years ago

Could you post a screenshot of the Browser console (Tools > Web developer > Browser Console) after restarting Firefox?

morpheusthewhite commented 4 years ago

Yes, after some reboots everything works

morpheusthewhite commented 4 years ago

Did you restart Firefox after running setup.sh?

Yes, even after restarting Firefox several times it didn't work

Could you post a screenshot of the Browser console (Tools > Web developer > Browser Console) after restarting Firefox?

Yes, actually some error are still present even if now I am able to apply the theme. In particular the one I posted

TypeError: pywalColors is undefined
JamesDalboth commented 4 years ago

2020-03-23_220829-1xMar_scrot

The above is the screenshot of the console after restarting Firefox for me.

2020-03-23_220838-1xMar_scrot Above is what happens after clicking fetch pywal colors.

morpheusthewhite commented 4 years ago

2020-03-23_220829-1xMar_scrot

The above is the screenshot of the console after restarting Firefox for me.

2020-03-23_220838-1xMar_scrot Above is what happens after clicking fetch pywal colors.

Same here

Frewacom commented 4 years ago

Did you restart Firefox after running setup.sh?

Yes, even after restarting Firefox several times it didn't work

Could you post a screenshot of the Browser console (Tools > Web developer > Browser Console) after restarting Firefox?

Yes, actually some error are still present even if now I am able to apply the theme. In particular the one I posted

TypeError: pywalColors is undefined

Does all the functionality including the custom color picker work as expected? If it is, I am not quite sure why are getting those errors. I'll add some error handling for those cases either way.

Frewacom commented 4 years ago

2020-03-23_220829-1xMar_scrot

The above is the screenshot of the console after restarting Firefox for me.

2020-03-23_220838-1xMar_scrot Above is what happens after clicking fetch pywal colors.

The errors you get is most likely because the native script could not be executed correctly. The output I would like to see is the Browser console that comes when pressing Shift+Ctrl+J (not the inspector console).

JamesDalboth commented 4 years ago

2020-03-23_222909-1xMar_scrot Apologies, yes I can see the error No such native application pywalfox

Frewacom commented 4 years ago

That error indicates that the manifest is (most likely) not installed properly.

  • Make sure that path in ~/.mozilla/native-messaging-hosts/pywalfox.json points to the location of daemon/pywalfox.py
JamesDalboth commented 4 years ago

Atm my path is "/home/james/Pywalfox/daemon/pywalfox.py".

{
  "name": "pywalfox",
  "description": "Automatically theme firefox using system colors generated by Pywal",
  "path": "/home/james/Pywalfox/daemon/pywalfox.py",
  "type": "stdio",
  "allowed_extensions": [ "pywalfox@frewacom.org" ]
}

I can confirm that it is the correct path as well

Frewacom commented 4 years ago

Hm, that is strange. Either way, the error indicates that the manifest is not installed properly (according to the Mozilla docs). Could it be some permission issue that denies read-access by Firefox?

morpheusthewhite commented 4 years ago

Does all the functionality including the custom color picker work as expected? If it is, I am not quite sure why are getting those errors. I'll add some error handling for those cases either way.

Yes, they seem to work, even if after selecting a color the error said before is raised

Error: Could not establish connection. Receiving end does not exist.

If they can help you, here it is also the content of the debugging output

Theme was updated
Set custom color "background" to #ff4056
Theme was updated
Set custom color "background" to #0c101e
Theme was updated
Custom CSS: "hide-scrollbar.as.css" has been enabled
Custom CSS: "hide-scrollbar.as.css" has been disabled
Set custom color "background" to #cbbdc4
Theme was updated
Set custom color "background" to #0c101e
Theme was updated
Set custom color "background" to #2500b6
Theme was updated
Set custom color "background" to #0c101e
Theme was updated
Set custom color "background" to #a09a7e
Theme was updated
Set custom color "background" to #0c101e
Theme was updated
morpheusthewhite commented 4 years ago

The errors you get is most likely because the native script could not be executed correctly. The output I would like to see is the Browser console that comes when pressing Shift+Ctrl+J (not the inspector console).

image

Frewacom commented 4 years ago

I actually have the exact same error from background.js:1504 and for me it is coming from the Bitwarden extension, so it has nothing to do with Pywalfox. It is kind of annoying that the addon that causes the error is not written out along with the error.

morpheusthewhite commented 4 years ago

I actually use bitwarden, too

JamesDalboth commented 4 years ago

Since the errors seem to have diverged, I'm gonna redirect my problems to a new issue specific my issues.