#5832 closed defect (fixed)

Exceptions being thrown in popup page

Reported by: kzar Assignee: mjethani
Priority: P2 Milestone: Adblock-Plus-3.0-for-Firefox
Module: Platform Keywords:
Cc: sebastian, greiner, mjethani Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29565717/

Description

Environment

Chrome 61, Linux, devbuild of adblockpluschrome from 585646051e9c.

How to reproduce

  1. Open a new tab, browse to some website E.g. https://reddit.com
  2. Right click on the ABP icon.
  3. Click "Inspect pop-up"
  4. Press refresh in your tab.


Observed behaviour

Exceptions are displayed in the console:

Error in event handler for runtime.onMessage: TypeError: Cannot read property 'id' of undefined
    at ext.PageMap.set (chrome-extension://ghggfhepnjpmpghomanfhkljmbalkebe/ext/background.js:46:26)
    at port.on (chrome-extension://ghggfhepnjpmpghomanfhkljmbalkebe/lib/adblockplus.js:378:14)
    at Port._onMessage (chrome-extension://ghggfhepnjpmpghomanfhkljmbalkebe/lib/adblockplus.js:1120:22)
    at ext._EventTarget._dispatch (chrome-extension://ghggfhepnjpmpghomanfhkljmbalkebe/ext/common.js:48:22)
    at chrome.runtime.onMessage.addListener (chrome-extension://ghggfhepnjpmpghomanfhkljmbalkebe/ext/content.js:14:26)

Expected behaviour

No exceptions are displayed.

Notes

Change History (6)

comment:1 Changed 23 months ago by mjethani

  • Owner set to mjethani

comment:2 Changed 23 months ago by mjethani

The culprit is ext/content.js, which was included in popup.html recently. There's no need to include it as such, we can use the browser APIs directly, so I'm removing it.

comment:3 Changed 23 months ago by mjethani

  • Review URL(s) modified (diff)

comment:4 Changed 23 months ago by kzar

  • Priority changed from Unknown to P2
  • Ready set
  • Status changed from new to reviewing

comment:5 Changed 23 months ago by abpbot

A commit referencing this issue has landed:
Issue 5832 - Use runtime.onMessage directly in popup

comment:6 Changed 23 months ago by mjethani

  • Milestone set to Adblock-Plus-for-Chrome-Opera-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.