permissions.default.image seems frozen




Image Blocking
2 years ago
11 months ago


(Reporter: Vangelis Katsikaros (unavailable until May '18), Unassigned)


44 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [gfx-noted])


(2 attachments)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160126223146

Steps to reproduce:

* Case A

firefox --profile <TEST_DIR> 

and in TEST_DIR I use the following for prefs.js:

user_pref("permissions.default.image", 2);
user_pref("lala.lala", "lala");

* Case B
After firefox was launched with the above steps, I manually did change the preference from about:config

Actual results:

* Case A Firefox launched and was loading pages with their images.

* Case B The pages that we loading their images no longer did.

What happened in Case B was expected, what happened in Case A wasn't.

Expected results:

I would expect Firefox to load pages without loading images.

When searching for this firefox preference, I run into several places that mention permissions.default.image as a "frozen" setting. However, I wouldn't find any documentation of this.

From these [2], [3] I understand the the preference removal occurred only for the UI?



2 years ago
Component: Untriaged → Image Blocking
Product: Firefox → Core
Whiteboard: [gfx-noted]
Both of these (case A and case B) work fine for me - hate to ask the obvious, but there wasn't a typo in there somewhere, was there?  Manually editing prefs.js is a dangerous thing, but it does work for me.
Created attachment 8722404 [details]

When I launch firefox as described in the "Steps to reproduce" I can see the fake "lala.lala" preference the prefs.js has
Created attachment 8722406 [details]

When I launch firefox as described in the "Steps to reproduce" I can see the  "permissions.default.image" preference. To ensure there is not a typo, I copied from the pref.js, and pasted in the search box of the about:config page. permissions.default.image remains with value 1. I think that in this way we can eliminate the typo, as a factor in this case?
Let me clarify a bit Case A of "Steps to reproduce":

$ rm -rf test-profile
$ mkdir test-profile
$ cat > test-profile/prefs.js
user_pref("permissions.default.image", 2);
user_pref("lala.lala", "lala");

# check no firefox is running
$ pgrep -fla firefox
$ firefox --profile test-profile/ &

Firefox then opens with two tabs showing a blue page titled "More protection" (promo for the Private Browsing) and a 2nd tab Ubuntu's start page. Then I start visiting pages or about:config.

Also some more details on my system:
I am on Xubuntu 14.04

$ uname -a
Linux xxxxxx 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.3 LTS
Release:	14.04
Codename:	trusty
Yeah, you're going off the supported path here.  What if you create a new profile through firefox --profile, then edit prefs.js in it?  Also, with your approach, what happens the second time you start firefox with the same profile?
Didn't know this is not a proper way of launching the profile :( I tried as you suggested a) launch with an empty profile b) close c) then manually add in pref.js d) launch again. It works fine [1].

This started as an effort to reproduce a problem that is usual in some selenium/webdriver cases [2], and the usual answer is that this setting is frozen. I tried to reproduce this, and it worked. But it seems my reproduction (as well as the original problem?) originates from a badly structured pref.js, and/or entire profile?

So, you suggest using a "default" profile (the one after steps a) & b) mentioned above), and then tweaking this further?

Is there somewhere a minimal profile I could use to tweak mine further?

$ rm -rf test-profile/
$ mkdir test-profile/
$ pgrep -fla firefox
$ firefox --profile test-profile/ &

# close firefox, profile should now be written on disk

$ vim test-profile/prefs.js 

$ grep permissions.default.image test-profile/prefs.js
user_pref("permissions.default.image", 2);

$ head -n20 test-profile/prefs.js
# Mozilla User Preferences

/* Do not edit this file.
 * If you make changes to this file while the application is running,
 * the changes will be overwritten when the application exits.
 * To make a manual change to preferences, you can visit the URL about:config
user_pref("permissions.default.image", 2);
user_pref("app.update.lastUpdateTime.browser-cleanup-thumbnails", 0);
user_pref("app.update.lastUpdateTime.xpi-signature-verification", 0);
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.cache.disk.capacity", 1048576);
user_pref("browser.cache.disk.filesystem_reported", 1);
user_pref("browser.cache.disk.smart_size.first_run", false);
user_pref("browser.cache.frecency_experiment", 2);
user_pref("", true);
user_pref("browser.migration.version", 34);
user_pref("browser.newtabpage.enhanced", true);

$ firefox --profile test-profile/ &
# in the about:config permission is set to the proper value, and pages load without images.

You shouldn't even need to edit pref.js, just adding a user.js file to the profile directory with your user-overriden values should suffice. You can create a profile without starting Firefox via the -CreateProfile command-line option:

There is also mozprofile, a python program to automate some of these tasks that you may find useful:

I don't know much about that, but the automation team should be able to help with it.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.