Opened on 03/17/2016 at 04:30:00 PM

Closed on 03/23/2016 at 01:36:12 PM

#3826 closed change (fixed)

Filter preference change events

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-1.12-for-Chrome-Opera-Safari
Module: Unknown Keywords:
Cc: greiner Blocked By: #3839
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kzar)


Some code currently responds to preference changes through Prefs.onChanged.addListener(), using always the same boilerplate to bail out unless a particular preference was changed. So it would be preferable if you could specify the preference when adding the callback which then only gets called for that preference.

Also, this is a good opportunity to align prefs.Prefs with messaging.Port (#3823), replacing Pref.onChanged.addListener/removeListener with Prefs.on/off.

What to change

  • Move the event emitter logic to a separate module.
  • Replace Prefs.onChanged with Prefs.on(pref, cb) and, cb).
  • Adapt existing code.

Attachments (0)

Change History (6)

comment:1 Changed on 03/17/2016 at 04:31:08 PM by sebastian

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

comment:2 Changed on 03/18/2016 at 11:00:36 AM by greiner

  • Cc greiner added

comment:3 Changed on 03/18/2016 at 03:36:35 PM by kzar

  • Description modified (diff)

comment:4 Changed on 03/19/2016 at 07:13:03 PM by sebastian

  • Blocked By 3839 added

comment:5 Changed on 03/23/2016 at 01:33:13 PM by abpbot

A commit referencing this issue has landed:

comment:6 Changed on 03/23/2016 at 01:36:12 PM by sebastian

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

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
Note: See TracTickets for help on using tickets.