Opened 9 months ago

Closed 9 months ago

Last modified 7 months ago

#6474 closed change (fixed)

Enable pre-configured preferences through managed storage on Firefox

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-3.1-for-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: josue.mouco, Ross Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29721777

Description (last modified by sebastian)

Background

With Adblock Plus 2.6.10 for Firefox we started to allow suppressing the first run page through external configuration. This mechanism was specific to legacy Gecko extension, and when we migrated to WebExtensions with Adblock Plus 3.0, we had to leave that feature behind.

Now, Firefox 57 and above provides a mechanism to pre-configure WebExtensions, similar to Chrome. However, despite Adblock Plus for Chrome and Firefox being based on the same code, now, we still specifically use that mechanism only on Chromium-based browsers.

I verified that removing this check, and saving following file in the resprective location (e.g. ~/.mozilla/managed-storage/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json), successfully suppresses the first run page, on Firefox 57 and above:

{
  "name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
  "description": "Managed storage manifest for Adblock Plus",
  "type": "storage",
  "data": {
    "suppress_first_run_page": true
  }
}

Similarly, this change allows pre-configuration of additional default subscriptions (#3801):

{
  "name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
  "description": "Managed storage manifest for Adblock Plus",
  "type": "storage",
  "data": {
    "additional_subscriptions": [
      "https://easylist-downloads.adblockplus.org/easyprivacy.txt"
    ]
  }
}

What to change

Read pre-configurable preferences from storage.managed on all platforms that support it.

Change History (20)

comment:1 Changed 9 months ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 9 months ago by sebastian

  • Description modified (diff)

comment:3 Changed 9 months ago by sebastian

  • Description modified (diff)

comment:4 Changed 9 months ago by sebastian

  • Description modified (diff)

comment:5 follow-up: Changed 9 months ago by josue.mouco

Hi all,

I created the file:

{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json

with that content:

{

"name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
"description": "Managed storage manifest for Adblock Plus",
"type": "storage",
"data": {

"suppress_first_run_page": true

}

}
{

"name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
"description": "Managed storage manifest for Adblock Plus",
"type": "storage",
"data": {

"additional_subscriptions": [

"https://easylist-downloads.adblockplus.org/easyprivacy.txt"

]

}

}

under:

C:\Program Files\Mozilla Firefox\managed-storage

and generated the reg key (export to .reg):

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="\"\"C:
Program Files
Mozilla Firefox
managed-storage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json\"\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="\"\"C:
Program Files
Mozilla Firefox
managed-storage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json\"\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="\"\"C:
Program Files
Mozilla Firefox
managed-storage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json\"\""

but it doesn't work with FF 59.0. Is there something wrong I didn't understand?

comment:6 in reply to: ↑ 5 Changed 9 months ago by sebastian

  • Cc josue.mouco added

Replying to josue.mouco:

I created the file:

{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json

with that content:

{

"name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
"description": "Managed storage manifest for Adblock Plus",
"type": "storage",
"data": {

"suppress_first_run_page": true

}

}
{

"name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
"description": "Managed storage manifest for Adblock Plus",
"type": "storage",
"data": {

"additional_subscriptions": [

"https://easylist-downloads.adblockplus.org/easyprivacy.txt"

]

}

}

You cannot have two JSON objects in the manifest. If you want to use both, suppress_first_run_page and additional_subscriptions you have to combine them like this:

{
  "name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
  "description": "Managed storage manifest for Adblock Plus",
  "type": "storage",
  "data": {
    "suppress_first_run_page": true,
    "additional_subscriptions": [
      "https://easylist-downloads.adblockplus.org/easyprivacy.txt"
    ]
  }
}


but it doesn't work with FF 59.0. Is there something wrong I didn't understand?

Regardless of the above mistake, this change hasn't been landed yet. It will probably be shipped with Adblock Plus 3.0.4.

comment:8 Changed 9 months ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:9 Changed 9 months ago by josue.mouco

Bad comment. can be ignored

Last edited 9 months ago by josue.mouco (previous) (diff)

comment:10 follow-up: Changed 7 months ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Done. Both the suppress first run page and additional subscription settings work as expected in Chrome and now Firefox. Could not get this to work with windows, but believe this is due to needing group policy from active directory, instead of "just" a windows machine with regedit.

Firefox 59 / Ubuntu 16.04
Chrome 66 / Ubuntu 16.04

comment:11 in reply to: ↑ 10 Changed 7 months ago by sebastian

  • Cc Ross added

As far as I understand, on Firefox (unlike Chrome), you don't need to deploy a group policy through Active Directory, but just editing the registry should be sufficient. However, if you tested it on Linux that is good enough, as far as I'm concerned. If it works there but not on Windows, then its either a configuration issue or a bug in Firefox, either way nothing we can address in Adblock Plus.

comment:12 Changed 7 months ago by josue.mouco

Hi,
AdblockPlus 3.1 has been released and in my case I still have the first run page in Firefox using either the setting lockPref("extensions.adblockplus.suppress_first_run_page", true); in cck2.cfg file or using the managestorage file.

comment:13 Changed 7 months ago by sebastian

You had it working before with the devbuild, right? Did you adapt the extension ID in the managed storage manifest, its filename and the respective registry entry for the release version?

See the announcement for more details.

If its still not working, can you show the contents of your manged storage manifest?

comment:14 Changed 7 months ago by josue.mouco

Hi,
"You had it working before with the devbuild, right?" Don't have any devbuild.
"Did you adapt the extension ID in the managed storage manifest, its filename and the respective registry entry for the release version?" My filename is still {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json which seems to be the same extension ID equivalent. What do you mean with "respective registry entry for the release version"? Here is the content of my file:
{

"name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
"description": "Managed storage manifest for Adblock Plus",
"type": "storage",
"data": {

"suppress_first_run_page": true

}

}

comment:15 follow-up: Changed 7 months ago by sebastian

On Windows, you also have to create a registry key, pointing to the location of your managed storage manifest.

Also just to be sure, you don't happen to be on a version of Firefox older than 57, and the version of Adblock Plus you are using is 3.1?

Last edited 7 months ago by sebastian (previous) (diff)

comment:16 in reply to: ↑ 15 Changed 7 months ago by josue.mouco

Replying to sebastian:

On Windows, you also have to create a registry key, pointing to the location of your managed storage manifest.

Also just to be sure, you don't happen to be on a version of Firefox older than 57, and the version of Adblock Plus you are using is 3.1?

Correct, FF 60.0.1 and AdblockPlus 3.1

And yes, I import the following reg file after the setup:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage"

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage"

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage"

Last edited 7 months ago by josue.mouco (previous) (diff)

comment:17 Changed 7 months ago by sebastian

As far as I understand, Mozilla's documentation, you have to set the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d} to the full path to your managed storage manifest file.

Last edited 7 months ago by sebastian (previous) (diff)

comment:18 Changed 7 months ago by josue.mouco

Thank you.
Even with full path, I still get the first run page:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json"

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json"

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:
Program Files
Mozilla Firefox
ManagedStorage
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json"

comment:19 Changed 7 months ago by tschuster

I tried to reproduce this problem under these conditions and it works for me.

I have this registry entry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}]
@="C:\\Program Files\\Mozilla Firefox\\ManagedStorage\\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.json"

And this manifest:

{
  "name": "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}",
  "description": "Managed storage manifest for Adblock Plus",
  "type": "storage",
  "data": {
    "suppress_first_run_page": true,
    "additional_subscriptions": [
      "https://easylist-downloads.adblockplus.org/easyprivacy.txt"
    ]
  }
}

When installing ABP, the first run page doesn't show up and the additional subscription is there.

comment:20 Changed 7 months ago by josue.mouco

OK it works with you proposal.
Thanks

Note: See TracTickets for help on using tickets.