Opened 5 years ago

Closed 2 years ago

#2224 closed defect (rejected)

Notification click listeners added but never removed

Reported by: greiner Assignee:
Priority: Unknown Milestone:
Module: Adblock-Plus-for-Firefox Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):

Description

Environment

Ubuntu 14.04
Firefox 36.0.4
Adblock Plus 2.6.8.3917

How to reproduce

  1. In lib/ui.js replace
    let notification = Notification.getNextToShow(url);
    
    with
    let notification = {
      links: ["contribute"],
      message: "Click on <a>this link</a> to open window",
      title: "Notification",
      type: "information"
    };
    
  2. Build and load extension
  3. Go to any webpage, notification pops up
  4. Click on link in notification
  5. Reload webpage, notification pops up
  6. Click on link in notification

Observed behaviour

  • Step (4) opens one new window
  • Step (6) opens two new windows

Expected behaviour

  • Step (4) opens one new window
  • Step (6) opens one new window

Background

We attach a click listener to the notification to handle clicks on links contained inside the notification message. However, this listener is added each time a notification is shown without ever removing them which means that the more notifications are shown the more windows are being opened.

What to change

Move the click listener declaration in lib/ui.js from the _showNotification() method to the applyToWindow() method.

Change History (1)

comment:1 Changed 2 years ago by trev

  • Resolution set to rejected
  • Status changed from new to closed

Mass-closing all bugs in Adblock Plus for Firefox module, the codebase of Adblock Plus 3.0 belongs into Platform and User-Interface modules. Old bugs are unlikely to still apply.

Note: See TracTickets for help on using tickets.