user.js icon indicating copy to clipboard operation
user.js copied to clipboard

Addon Save Page WE [solved: layout.css.font-loading-api.enabled=false]

Open Pilford opened this issue 7 years ago • 9 comments

Thorin reminder

  • [x] add console tip to troubleshooting wiki (I am so guilty of skipping this step myself!)
  • [x] add this info our sticky on extension breakage due to prefs #391
  • [x] test: layout.css.font-loading-api.enabled=false causes the problem as far back as FF57

Original Post

I’m using FF64. After updating user.js the addon Save Page WE (https://addons.mozilla.org/en-US/firefox/addon/save-page-we) stopped working. It hangs when trying to save a page.

When I delete both prefs.js and user.js Save Page WE runs fine, but when I add user.js it doesn’t work anymore.

Pilford avatar Dec 13 '18 07:12 Pilford

I can't think what change or new pref might do that. When earthlng does the changelog it might stand out (atm, we did so many changes, including cosmetic, that I honestly can't decipher it)

When I get time, I'll come back and help narrow it down.

In the meantime, go here to our wiki page. You've already confirmed it is a user.js pref that causes it. So all you need to do now, is keep resetting your profile (I always use a new profile, rather than mess with my main everyday one) and use a binary/halving method - i.e apply only half the user.js, then a quarter, then an eight etc, testing and resetting each time - and you should be able to find it in a four or five goes.

Once you've got a good idea of the section(s) that cause it, then it's easier to reset the profile and then test by changing the values one by on in about:config until the extension breaks

Thorin-II avatar Dec 13 '18 08:12 Thorin-II

check the Browser Console (Ctrl+Shift+J) for any error messages. Clear it first then trigger the "save a page" and see if logs something. If it does but you can't decipher what it means, feel free to post the error message and maybe we can help

earthlng avatar Dec 13 '18 09:12 earthlng

^^ we should add that to the troubleshooting steps

Thorin-II avatar Dec 13 '18 09:12 Thorin-II

Thanks for the narrowing tip! I figured out the problem.

layout.css.font-loading-api.enabled should be true (default setting) instead of false.

Pilford avatar Dec 13 '18 09:12 Pilford

:small_red_triangle_down: FF63.03 (it fails in 63, so no need to test 64)

Test profile:

  • brand spanking shiny new profile
  • auto install of app updates off
  • "save page as" extension added
  • using extension options (Save Basic)
  • bookmarks for pages to save
    • Bookmark1 = http://asmjs.org/ (its just text, no fonts defined)
    • Bookmark2 = https://ghacksuserjs.github.io/ghacks-user.js/

Test1: layout.css.font-loading-api.enabled= default true

  • BM1 saves
  • BM2 prompts to save as 1 of 10 resources can't be loaded, and saves if you go ahead
    • no console error during save, but loading the page has warning about favicon

Test2: layout.css.font-loading-api.enabled=false

  • BM1 fails to save
  • BM2 fails to save
  • Console error for both: Save Page WE - document.fonts is undefined background.js:1129:10

Intrigued how OP had this working in 63

  • Searched this repo for the pref, found nothing where it was changed or added. Went back to our first published version here, v51 (Feb 18 2017), and layout.css.font-loading-api.enabled was active at false back then.
  • The extension had a version update on Dec 8th to 12.6. Redid Test2 with the previous version 12.5. Nope that fails as well

I guess it's always been broken? And OP just didn't realize he had somehow overriden the pref? IDK, OP said he "updated" the user.js. Maybe that wiped out any previous overrides (how did he update it? manually?). IDK, I'm not there. I can't re-produce the extension working in 63 with font-loading=false.

I'm tempted to go back to FF52 or something just to scope it out. Hell, why not

Thorin-II avatar Dec 16 '18 15:12 Thorin-II

I went back to FF57.0.4. I don't see any point in testing further back pre Quantum.

  • 57 was first released Nov 14 2017
  • the first version of the "Save Page As" web extension to specially state 52 or newer was version 10.0 released May 22 2018. So I went with those
  • used extension settings to "Save Basic"

Redid the tests. With the pref at true, it all works. With the pref at false, it all fails with the same console warning.

@Pilford Thanks for coming across this and letting us know. At the very least someone should tell the extension dev, so 1) he's aware 2) maybe he can add the information to his wiki or troubleshooting guide or whatever, and 3) maybe he can code a warning /fallback / workaround.

I'll add this to our sticky extension breakage due to prefs.

Thorin-II avatar Dec 16 '18 16:12 Thorin-II

..aaaand we're done. Just updated the wiki page, in which I also added that users can check the extension breakage due to prefs sticky

PS: I will leave it up to someone else to contact the dev, you know, like a user of the extension :)

Thorin-II avatar Dec 16 '18 16:12 Thorin-II

@Pilford said

From the developer of Save Page WE:

Save Page WE uses the CSS Font Loading Module to check which fonts are currently being used in the page that is being saved.

Without doing this check, Save Page WE would have to save all of the font files that are referenced in any CSS ‘@font-face’ rules. This would often make saved files much larger.

When saving the page, Save Page WE downloads the font files for the fonts that are currently being used in the page and (optionally) for WOFF fonts.

That's cool. Thanks for letting him know (he probably knew already). The dev can do what he likes, no-one (certainly not intended) is having a go at why he does the check, that's totally understandable :) I just think maybe he missed the point (see next paragraph) since he doesn't mention it

We're not the only ones flipping that pref, anyone can and the web is full of info. Given the number of users (33K?), I just thought he should know, and if he wants to provide a better product (and I am not an extension dev), then maybe he could have detected the error and alert the user. IDK, I'm not him.

:kiss: for bringing it to our attention for our unofficial sticky, and for the changes it made to improving our troubleshooting wiki .. here are some free drinks for you :beers:

Thorin-II avatar Dec 17 '18 10:12 Thorin-II

the pref was removed in AF v67, removing answered label

Thorin-II avatar Oct 11 '22 19:10 Thorin-II