Opened on 03/02/2015 at 11:52:23 AM

Closed on 03/03/2015 at 08:25:08 AM

#2071 closed defect (fixed)

Can't send messages from popup to background page

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.8.12-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: Blocked By:
Blocking: #2067 Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/5703008528629760

Description (last modified by sebastian)

How to reproduce

Call ext.backgroundPage.sendMessage() from popup.html. Currently this issue is only visible on the API-level. However, it's becoming user visible with #2067 and when we finally make the popup rely on messaging.

Observed behaviour

On Chrome, the message listener in the background page gets undefined. That is because we call chrome.runtime.sendMessage() with the chrome namespace from the background page.

On Safari, we get a TypeError, because only content scripts can send messages to the background page there. In order to work around that limitation, we would have to call the message listeners directly.

Expected behaviour

Calling ext.backgroundPage.sendMessage() from the popup should work as it does when called from content scripts. The message should be received by the message listeners registered in the background page.

Hint for testers

See #2067. If it's not merged yet, there shouldn't be any user visible effect. But make sure that the icon popup is still behaving correctly on Chrome and Safari.

Attachments (0)

Change History (3)

comment:1 Changed on 03/02/2015 at 11:57:41 AM by sebastian

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

comment:2 Changed on 03/02/2015 at 12:21:43 PM by sebastian

  • Description modified (diff)

comment:3 Changed on 03/03/2015 at 08:25:08 AM 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
Action
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.