Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"browser.display.use_document_fonts", default fonts & uBo/uM icons [FFv55, Linux] #238

Closed
atomGit opened this issue Sep 20, 2017 · 26 comments

Comments

@atomGit
Copy link

atomGit commented Sep 20, 2017

after installing FFv55, i noticed the icons at the top of both uMatrix (1.0.0) and uBlock O (1.14.8) are mangled/missing - i found the cause to be "browser.display.use_document_fonts" = 0

setting that to '1' solves the issue

this was apparently an old problem, but i'm wondering if it's resurfaced with v55?

related:

test: browser.display.use_document_fonts · Issue #126 · ghacksuserjs/ghacks-user.js

Firefox 41: Mozilla modifies how icon fonts are handled by the browser - gHacks Tech News

@2glops
Copy link

2glops commented Sep 20, 2017

browser.display.use_document_fonts = 0
I set fonts to Liberation (Sans, Serif) to unbreak uBo GUI
FF 55.0.3 on Debian

@atomGit
Copy link
Author

atomGit commented Sep 21, 2017

i couldn't get the uBO or uM icons to appear by changing fonts - i tried about every reasonable font i had installed and started with a fresh prefs.js - so i'm leaving the option for sites to choose their own fonts enabled (this is on Linux btw)

on another note (and i'll open a new ticket depending on feedback) ... when the user.js is updated, there can be old sections that are commented out, depreciated stuff, etc. - i'm wondering about how to handle removing/resetting the affected prefs in prefs.js - i'm wondering if you guys could create a batch script with all the old/commented prefs that would run on prefs.js to remove the clutter?

@earthlng
Copy link
Contributor

earthlng commented Sep 22, 2017

A simple scratchpad script could do the job:

(function() {
  let ops = [
    /* deprecated/removed in FF55 */
    'browser.formautofill.enabled',
    'browser.formfill.saveHttpsForms',
    'browser.fullscreen.animate',
    'browser.newtabpage.directory.ping',
    'browser.selfsupport.enabled',
    'browser.selfsupport.url',
    'browser.tabs.animate',
    'dom.enable_user_timing',
    'dom.keyboardevent.code.enabled',
    'geo.security.allowinsecure'
  ]
  
  for (let i=0, len=ops.length; i < len; i++) {
    if (Services.prefs.prefHasUserValue(ops[i])) {
      Services.prefs.clearUserPref(ops[i]);
      if (!Services.prefs.prefHasUserValue(ops[i])) { console.log("reset", ops[i]); }
    }
  }
})();

open about:config (so that Services is available for scratchpad) then press Shift+F4, paste the script and run it. We could add every pref we either removed, commented out or deprecated/removed since 52-alpha to the ops array. But it would be one more thing we would need to maintain and IDK if we want to do that.

@earthlng
Copy link
Contributor

"could" because

it would be one more thing we would need to maintain and IDK if we want to do that.

but "does" if we decide to provide that.

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

A simple scratchpad script ...

that's a damn good idea

i might be willing to maintain the script, the problem is that you guys do a lot of releases, sometimes multiple releases a day, and i don't have the time for that

if i updated the script once a week (oe so), would that work? i'm not sure how i'd get a list of prefs though unless i parsed every version of user.js since the last time i updated the script - i'm not into that either

is there maybe a GitHub repo tool that could run a RegEx on ALL of the released user.js files that could help? or could all of them be downloaded at once?

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

well, i'd like the depreciated ones too just to cut the garbage in prefs that could be misleading to someone trying to troubleshoot - i think a RegEx run against every release could be used, the ? is; how to d/l or access in one place every version of user.js

@earthlng
Copy link
Contributor

We could add a new wiki page for bulk clearing via scratchpad - sample would include non-existant pref names

that would be pretty nonsensical because people would need to check our changelogs for the relevant prefs and add them to the script and that would probably end up taking longer than just resetting each one in about:config.

@earthlng
Copy link
Contributor

you don't need to include all the inactive prefs, only the ones we made inactive since the last release.

"commented out" output from my script for the next changelog:

//user_pref("device.sensors.enabled", false);
//user_pref("dom.gamepad.enabled", false);
//user_pref("dom.indexedDB.enabled", false);
//user_pref("dom.presentation.controller.enabled", false);
//user_pref("dom.presentation.discoverable", false);
//user_pref("dom.presentation.discovery.enabled", false);
//user_pref("dom.presentation.enabled", false);
//user_pref("dom.presentation.receiver.enabled", false);
//user_pref("dom.presentation.session_transport.data_channel.enable", false);
//user_pref("dom.vr.enabled", false);
//user_pref("dom.w3c_touch_events.enabled", 0);
//user_pref("font.name.monospace.x-unicode", "Lucida Console");
//user_pref("font.name.monospace.x-western", "Lucida Console");
//user_pref("font.name.sans-serif.x-unicode", "Arial");
//user_pref("font.name.sans-serif.x-western", "Arial");
//user_pref("font.name.serif.x-unicode", "Georgia");
//user_pref("font.name.serif.x-western", "Georgia");
//user_pref("media.mediasource.enabled", false); // previously active with value: true
//user_pref("media.mediasource.mp4.enabled", false); // previously active with value: true
//user_pref("media.mediasource.webm.audio.enabled", false); // previously active with value: true
//user_pref("media.mediasource.webm.enabled", false); // previously active with value: true
//user_pref("security.ssl3.dhe_rsa_aes_128_sha", false);
//user_pref("security.ssl3.dhe_rsa_aes_256_sha", false);
//user_pref("security.ssl3.ecdhe_ecdsa_aes_128_sha", false);
//user_pref("security.ssl3.ecdhe_rsa_aes_128_sha", false);
//user_pref("security.ssl3.rsa_des_ede3_sha", false);

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

139 inactive prefs in user.js

is that a running list? does it include all inactive since you guys started? if so, this will be easier than i thought

an idea: i'll maintain the list/script - i can do this in the wiki, or you could put it in the repo alongside user.js and i'll make pull requests

you guys point users to the script in user.js and wherever else is appropriate

since peeps will have the script to refer to, in user.js i think you could remove 9999: DEPRECATED (maybe just link the script there) and shorten the file <-- NOT a good idea

might be best to have 2 scratchpad scripts? 1 for depreciated and 1 for inactive? or 1 script that is commented to indicated what's what

as pants says, people need to be sure they add custom prefs at the end so they don't lose and settings from removed inactive prefs

i like this/your ideas guys - i, and certainly others i'm sure, would like to make updating user.js as quick and hassle-free as possible and resetting prefs in about:config isn't an option IMHO

@earthlng
Copy link
Contributor

earthlng commented Sep 22, 2017

well I'm willing to do this if and when you finally find the time to upload the pics for your blogpost to your own server and update all the <img> tags xD deal?

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

@earthlng - i get an error when running your script (modified to include all this, with commas in the right places and some cleanup)...

Exception: ReferenceError: Services is not defined @Scratchpad/1:220:5 @Scratchpad/1:1:2

this is referencing...

for (let i=0, len=ops.length; i < len; i++) { Services.prefs.clearUserPref(ops[i]); }

@earthlng
Copy link
Contributor

earthlng commented Sep 22, 2017

open about:config (so that Services is available for scratchpad) then press Shift+F4, paste the script and run it.

(by default) scratchpad scripts run within the environment of the currently active tab so you need to make sure that about:config is the active tab.

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

well I'm willing to do this if and when you finally find the time to upload the pics for your uBlock/uMatrix article to your own server ...

already got much of that done - i've been updating the article and replacing as i go

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

open about:config (so that Services is available ...

lol - i guess it helps to actually READ the directions :)

is there any feedback when you run a script? i clicked 'run' and nothing appears to happen (about:config was active tab)

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

is there any feedback when you run a script? i

never mind - i checked a pref and the script is indeed working

@earthlng
Copy link
Contributor

earthlng commented Sep 22, 2017

clearUserPref() doesn't return anything so it's not possible to add meaningful checks or counts. If nothing appears to happen it worked. That's why I think we should include the _user.js.parrot in the list, to make it easy to spot if the script worked or not (because it's the first pref in about:config)

@earthlng
Copy link
Contributor

does it include all inactive since you guys started?

all the prefs we removed from the user.js are missing in that list

@earthlng
Copy link
Contributor

Would it not be better to have the parrot change at the end?

doesn't really matter, but sure, why not. I wanted to include a non-existent pref at the end anyway to make it easier for people to remove blocks they don't want to reset and not have to worry about the commas, but the parrot at the end would work too.

@earthlng
Copy link
Contributor

earthlng commented Sep 22, 2017

clearUserPref() doesn't return anything so it's not possible to add meaningful checks or counts.

scratch that. prefHasUserValue() can be used as a check (+count). see updated code sample

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

so this is what i came up with as an example...

/*
  NAME: Scratchpad prefs.js cleanup script
  VERSION: ?
  AUTHOR/MAINTAINER: the ghacks boys and atomGit

  This is a Firefox Scratchpad cleanup script intended to reset all depreciated and unused preferences from your prefs.js file.

  The purpose of running this script is to cleanup your prefs.js file after you update your user.js file with a newer ghacks version in order to remove bloat and thus potentially help you when troubleshooting a problem. Running this script each time you update your user.js avoids having to manually reset preference values, thus making updating your user.js a bit less painful.

  The source of the depreciated preferences is Mozilla while the source of the unused preferences is the ghacks user.js files. After resetting the preference values, all of the depreciated preferences will be removed from your prefs.js file upon restarting Firefox. The values for the unused preferences will be emptied in your prefs.js file.

  WARNING: If you have set the values of any preferences in this list but have not copied them to your user.js, then those preference values will be lost.

  How to run this script:
  
  1) BACKUP YOUR CURENT FIREFOX PROFILE - you have been warned :)
  2) Copy this script
  3) Open about:config in Firefox
  4) Press Shift + F4 to open Scratchpad
  5) Press Ctrl + A and then Ctrl + V to paste the script in Scratchpad
  6) Click the "Run" button on Scratchpad (there will be no indication that it ran, but there should be a log message appended to the script if there was a problem)
  7) Restart Firefox
*/

(function() {
  let ops = [
    'accessibility.typeaheadfind',
    'app.update.enabled',
    [content removed for brevity]
    'security.tls.unrestricted_rc4_fallback',
    'toolkit.telemetry.unifiedIsOptIn'
  ]
  
  for (let i=0, len=ops.length; i < len; i++) {
    if (Services.prefs.prefHasUserValue(ops[i])) {
      Services.prefs.clearUserPref(ops[i]);
      if (!Services.prefs.prefHasUserValue(ops[i])) { console.log("reset", ops[i]); }
    }
  }
})();

assuming you guys really want to do this, given i'll maintain it, then i got a Q: how can comments be added within the list? i want to identify and separate depreciated and unused if you think it's a good idea

UPDATE - added @earthlng code to display feedback

@earthlng
Copy link
Contributor

I don't like the idea to reset every single pref in the user.js, it's unnecessary. We already have "commented out", "removed from the user.js" and "moved to deprecated" sections in the changelogs and that covers everything we need to include in the reset-script. It also allows for commented blocks in the script and can therefore also be useful for ESR users.

how can comments be added within the list?

@atomGit see my pasty

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

@earthlng "see my pasty" - got it - thanks (at first i couldn't open that link when you first posted it - sorry)

@Thorin-Oakenpants re: resetting ALL prefs - not sure if you're referring to user or prefs, but either way, i would humbly agree with earthing

now, for something a bit different...

could the process of updating the user.js and the cleaning of prefs.js (equivalent to running the Scratchpad script) be totally automated by, say, a GM script that would prompt first and show a changelog perhaps?

@atomGit
Copy link
Author

atomGit commented Sep 22, 2017

no, you're not right - i am because i'm perfect ... well, there was this ONE time i THOUGHT i was wrong, but i was wrong :)

i get what you're saying and i realize it shouldn't break anything as long as the user appended changes rather than editing user.js (and if not, well, tough cookies) so yeah, i don't care, but i'd like you guys to argue about more cause i like watching you fight ... and i really don't feel qualified to make that decesion

what about the GM thingy to automate the entire process?

@atomGit
Copy link
Author

atomGit commented Sep 23, 2017

i ran it - seems to work but i'm still not seeing any feedback in the web or browser console

i'll have more feedback regarding the wiki and stuff shortly...

@atomGit
Copy link
Author

atomGit commented Sep 23, 2017

fresh, dedicated issue for the scratch-script discussion here

@atomGit atomGit closed this as completed Sep 23, 2017
@Thorin-Oakenpants Thorin-Oakenpants changed the title "browser.display.use_document_fonts", FFv55 - uBO and uM display corruption "browser.display.use_document_fonts", default fonts & uBo/uM icons [FFv55, Linux] Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants