Commit db5306c 1 parent 46131fb commit db5306c Copy full SHA for db5306c
File tree 1 file changed +32
-0
lines changed
extension-manifest-v3/src/store
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -242,8 +242,40 @@ async function migrateFromMV2() {
242
242
243
243
options . installDate = storage . install_date || '' ;
244
244
245
+ // Clear the storage
245
246
await chrome . storage . local . clear ( ) ;
246
247
248
+ try {
249
+ // Keep for the future use global and site specific tracker block/unblock lists
250
+ const trackers = storage . bugs . apps ;
251
+ const optionsFromV8 = {
252
+ selectedTrackers : Object . keys ( storage . selected_app_ids ) . map (
253
+ ( id ) => trackers [ id ] . trackerID ,
254
+ ) ,
255
+ siteSpecificBlocks : Object . entries ( storage . site_specific_blocks ) . map (
256
+ ( [ domain , ids ] ) => {
257
+ return {
258
+ domain,
259
+ trackers : ids . map ( ( id ) => trackers [ id ] . trackerID ) ,
260
+ } ;
261
+ } ,
262
+ ) ,
263
+ siteSpecificUnblocks : Object . entries (
264
+ storage . site_specific_unblocks ,
265
+ ) . map ( ( [ domain , ids ] ) => {
266
+ return {
267
+ domain,
268
+ trackers : ids . map ( ( id ) => trackers [ id ] . trackerID ) ,
269
+ } ;
270
+ } ) ,
271
+ } ;
272
+
273
+ // Save options for the future use
274
+ await chrome . storage . local . set ( { optionsFromV8 } ) ;
275
+ } catch ( e ) {
276
+ console . error ( `Error while migrating site specific tracker lists: ` , e ) ;
277
+ }
278
+
247
279
// Delete indexedDBs
248
280
// Notice: Doesn't wait to avoid blocking the migrated options
249
281
[
You can’t perform that action at this time.
0 commit comments