Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5050 closed change (fixed)

Make legacy extension use WebExtensions I/O

Reported by: trev Assignee: trev
Priority: P2 Milestone: Adblock-Plus-2.9-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: wspee Blocked By:
Blocking: #5048 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29408710/

Description (last modified by trev)

Background

We need to migrate data from our legacy extension to a place where it will be usable by the WebExtensions build.

What to change

Embed a WebExtension in our legacy extension providing an I/O interface compatible with the WebExtension build. Make io.js in the legacy part message the WebExtension part by default.

In order to allow access to already existing files, the original io.js should be preserved as legacyIO.js. All I/O calls (with the exception of IO.writeFile) should fall back to the legacy I/O if the file isn't found.

chrome/content/ui/filters-backup.js should generally use legacyIO.js for file access.

Hints for testers

Originally, our data was stored in adblockplus/ directory in the Firefox profile. The new location is browser-extension-data/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/storage.js which contains all files we used to store in the directory before. If the new storage.js doesn't exist, Adblock Plus should fall back to the old data automatically - there should be no first-run page on update, and all the data (old automatic backups included) should still be intact. We are *not* importing the backups into the new storage immediately. Instead, new automatic backups are created in storage.js and old backups will be phased out eventually. This means however that initially some backups will be in adblockplus/ directory whereas others will be inside storage.js - the user shouldn't notice that, all backups should work equally, appear in the same list in Filter Preferences and restoring any should work.

Change History (10)

comment:1 Changed 3 years ago by trev

  • Blocking 5048 added

comment:2 Changed 3 years ago by wspee

  • Cc wspee added

comment:3 Changed 3 years ago by trev

  • Description modified (diff)

comment:4 Changed 3 years ago by trev

  • Description modified (diff)

comment:5 Changed 3 years ago by trev

  • Description modified (diff)

comment:6 Changed 3 years ago by trev

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

comment:7 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 5050 - Make legacy extension use WebExtensions I/O

comment:8 Changed 3 years ago by trev

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

comment:9 Changed 3 years ago by trev

  • Description modified (diff)

comment:10 Changed 3 years ago by Ross

  • Verified working set

This appears to be working as expected. Data is kept when upgrading from last release -> migration legacy build -> WebExtension build. Falling back to use /adblockplus/ if needed appears to work as expected (data is there, no FRP appears).

ABP 2.8.2.4231
ABP 2.8.2.4244
ABP 2.8.2.4246
ABP 1.13.2.1773
Firefox 53 / Firefox Dev (54) / Windows 7

Note: See TracTickets for help on using tickets.