Opened 5 weeks ago

Closed 5 weeks ago

Last modified 4 weeks ago

#6474 closed change (fixed)

Enable pre-configured preferences through managed storage on Firefox

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-for-Chrome-Opera-Firefox-next
Module: Platform Keywords:
Cc: josue.mouco Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Unknown Verified working: no
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 (9)

comment:1 Changed 5 weeks ago by sebastian

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

comment:2 Changed 5 weeks ago by sebastian

  • Description modified (diff)

comment:3 Changed 5 weeks ago by sebastian

  • Description modified (diff)

comment:4 Changed 5 weeks ago by sebastian

  • Description modified (diff)

comment:5 follow-up: Changed 5 weeks 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 5 weeks 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 5 weeks 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 4 weeks ago by josue.mouco

Bad comment. can be ignored

Last edited 4 weeks ago by josue.mouco (previous) (diff)
Note: See TracTickets for help on using tickets.