aminomancer / uc.css.js

A dark indigo CSS theme for Firefox and a large collection of privileged scripts to add new buttons, menus, and behaviors and eliminate nuisances. The theme is similar to other userChrome stylesheets, but it's intended for use with an autoconfig loader like fx-autoconfig, since it uses JavaScript to implement its more functional features.
Other
329 stars 27 forks source link

Customize Toolbar breakage with Pocket disabled #10

Closed silverwings15 closed 3 years ago

silverwings15 commented 3 years ago

Hey, i found this bug while trying to incorporate my user.js from my current setup into your theme. If i set the following in my user.js

user_pref("extensions.pocket.enabled", false;

when i try to use the Customize toolbar function, instead of this

image

it will result in this

image

and when i close the Customize Toolbar mode, the navbar will look like this

image

aminomancer commented 3 years ago

weird, I can't reproduce it. looks like you're missing a parentheses in that user_pref call? what operating system is this?

aminomancer commented 3 years ago

you sure you don't have an old/deprecated script installed somewhere? make sure you don't have any scripts that aren't currently in the repo. others have complained and posted similar screenshots of the UI all messed up, and turned out to be using 6 month old scripts that I stopped developing.

aminomancer commented 3 years ago

also maybe you should check if you have any old custom prefs. search userchrome. in about:config and delete every preference you see

aminomancer commented 3 years ago

also can you show me a bigger screenshot? actually it'd be better if it was just a complete screen capture. your bug might be unique to your layout or general environment, and I can't fix it if I can't reproduce it. also, sending me the browser toolbox console log would be helpful too. the fact that something says null suggests there's a javascript error in here somewhere. which will be in the console. that would help narrow it down.

silverwings15 commented 3 years ago

all tests are conducted with a vanilla profile using your files downloaded from about 2 hours ago, so no worries of leftover files or configs having an effect. Win 10 x64 1909 (18363.418), same version as yours as you said last time iirc

full screen captures

with your default user.js

image

with the pocket pref added to user.js (before first run)

image

image

browser console is empty in both cases

aminomancer commented 3 years ago

well the browser console can't possibly be empty. if it was empty that'd mean you have even bigger problems lol. just copy and paste it, let me decide what's important.

also, it looks like you aren't using nightly? the theme and some of the scripts require nightly. I thought the readme was pretty emphatic about that but maybe I need to elaborate. or maybe it's just so long that nobody reads it. I think that would explain why the tab labels are missing.

silverwings15 commented 3 years ago

oh sorry about that, i had the developer console opened instead of the browser console. also forgot to use nightly for my testing 😬 but result remains the same. i exported the two console outputs and attached them here since i can't fit them into a single screenshot

console-export-normal.txt console-export-bug.txt

image

silverwings15 commented 3 years ago

so the error does not happen if you first run the profile, then go to about:config and flip extensions.pocket.enabled to false. it only happens if you add it to user.js before the first run

aminomancer commented 3 years ago

yeah I tried with user.js. still could not reproduce the bug. maybe you should reinstall firefox and fx-autoconfig? could be issues with the profile too. how did you create this profile? check this out:

Could not get children of file(C:\Users\wtc\AppData\Roaming\Mozilla\Firefox\Profiles\lcmzo799.test bug\thumbnails) because it does not exist

why is it looking for thumbnails cache in your roaming folder? the thumbnails cache is in the local folder. this profile looks totally corrupted. if the profile was made recently and through normal means then maybe your entire firefox installation is broken. I don't know how else to explain this many error messages in the browser console. I mean, you can expect some errors, but I've never seen these types of errors in my life.

can you try deleting scripts one by one until the problem is gone? since you seem to have every script installed, and I can't reproduce the bug, I can't do anything but make a random guess. maybe the eyedropper button script, since it seems to go missing in your screenshots. or maybe the navbar toolbar slider script.

aminomancer commented 3 years ago

also, this is abnormal too

1627995179519   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1627995179519   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*

these are definitely valid extension permissions, and the extension is built by mozilla. I don't see how this could happen unless your profile is corrupt or there's some mismatch between your firefox version and your profile. although even that doesn't really make sense bc the extension is built into firefox, not held in the profile.

silverwings15 commented 3 years ago

i created this profile by:

  1. running firefox -p
  2. create new profile using Profile Manager
  3. copy user.js and chrome folder into profile directory, deleting all existing files if there are any
  4. open FF using the newly created profile

will experiment some more tomorrow and see if i can figure out anything

aminomancer commented 3 years ago

did you run the profile once before copying everything into it?

silverwings15 commented 3 years ago

nah i mentioned above that i added everything to the profile folder before first run. is that poor practice?

aminomancer commented 3 years ago

well there's a lot of stuff that needs to happen during setup. all sorts of elements will be different or nonexistent. some global objects may not exist. before installing any scripts I would always run the profile and log into firefox account. then quit, install the javascript, and restart.

aminomancer commented 3 years ago

it's possible the scripts are causing a failure in the profile setup, corrupting the profile. you certainly don't want third-party code running while a profile or fxa account is being initialized. so yeah I think it would be wise to set up the profile and log into the fxa account beforehand. the scripts don't have any kind of logic for detecting whether the profile is undergoing initial setup, or behaving differently in accordance. a profile can only be set up once so it's not the kind of thing I invest time into debugging. I guess I just expected the user to install scripts as they go, the same way I do. it's already hard enough to make the scripts as they are, designing them to behave properly in the milliseconds before a profile has been fully set up is too much. so I guess I'll add a warning in the readme that the profile should be run before installing scripts.

silverwings15 commented 3 years ago

yep i can't replicate the issue if i open the profile once before adding everything else to it. i'll make sure to do that from now on, i didn't consider what you said about third party code running during the initialization process. thanks for the help!

aminomancer commented 3 years ago

no problem. this stuff has been soaking up a lot of my time lately anyway. with so many scripts it's like playing whack-a-mole with new updates breaking things. now they changed the way favicons for closed tabs are cached and it broke the recently closed tabs/windows menus. which affects one of my scripts that puts an identical menu in the tab context menu. I fixed it but the fix only works in internal firefox scripts. if I apply the same fix to my script, it won't work because it'll create 2 different tab favicon maps.

I guess I gotta wait for them to upstream my fix, then completely redo my script so it uses the vanilla methods and fixes whatever they return after the fact. which I don't even think is practical so I might just have to throw the whole script out lol. this hobby is like drug addiction, if I knew how life-consuming the consequences would be, I'm not sure I'd have gotten into it in the first place

silverwings15 commented 3 years ago

lol i'm sure there are less healthy and more destructive habits out there.. would rebasing your stuff to a future stable version help reduce the amount of constant tinkering and fixing you have to do?