Opened on 12/12/2017 at 11:04:39 AM

Closed on 02/20/2018 at 12:08:38 PM

Last modified on 03/16/2018 at 03:16:45 PM

#6183 closed defect (fixed)

Chrome throws "Receiving end does not exist" exception thrown in background page

Reported by: jsonesen Assignee: kzar
Priority: P2 Milestone: Adblock-Plus-3.0.3-for-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: kzar, sebastian, mjethani Blocked By:
Blocking: Platform: Chrome
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29636640/
https://codereview.adblockplus.org/29697671/

Description (last modified by kzar)

Environment

MacOS High Sierra, Ubuntu 16.04, Chrome 63
Adlbock Plus 3.0.2.1945

(Not reproducible with Firefox 57.)

How to reproduce

  1. Open a console to inspect the extension's background page
  2. Open a new Chrome tab, browse to https://www.reddit.com
  3. Keep refreshing the page

Observed behaviour

The following exception is quite often thrown:

polyfill.js:102 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
    at Object.descriptor.value [as sendMessage] (polyfill.js:78)
    at ext.Page.sendMessage (background.js:100)
    at ext.pages.onLoading.addListener.page (filterComposer.js:312)
    at ext._EventTarget._dispatch (common.js:41)
    at Object.browser.tabs.get [as callback] (background.js:170)
    at safeCallbackApply (extensions::uncaught_exception_handler:27)
    at handleResponse (extensions::sendRequest:67)
func.call.result @ polyfill.js:102
sendResponseAndClearCallback @ extensions::messaging:417
disconnectListener @ extensions::messaging:435
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
EventImpl.dispatch @ extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ extensions::utils:138
dispatchOnDisconnect @ extensions::messaging:378

Expected behaviour

The exception is not thrown.

Notes

Attachments (0)

Change History (21)

comment:1 Changed on 12/12/2017 at 11:12:45 AM by kzar

  • Component changed from Unknown to Platform
  • Description modified (diff)
  • Platform changed from Chrome to Unknown / Cross platform

Thanks for filing the issue.

Can you verify if the same happens in Firefox? (Until you check that I've marked the issue as cross platform.)

What makes you think the exception is being thrown only for cached pages? Please could you update the steps for reproduction to demonstrate that?

Are there any other symptoms other than the exception being thrown?

comment:2 Changed on 12/12/2017 at 11:29:27 AM by jsonesen

  • Description modified (diff)

No problem, thanks for the quick feedback.

In firefox there is an error thrown Error: Frame not found or missing host permission when navigating to IRCCloud, but this makes me think it is an unrelated issue.

Furthermore, maybe i was misusing cached and rather prerendered is better in that in the Error traceback, the third event from the bottom (which seems to be where the callback resolves after the initial attempt at sending the message in ext/background.js
https://hg.adblockplus.org/adblockpluschrome/file/tip/ext/background.js#l170
the comment describing this callback has to do with chrome's handling of prerendered tabs.

comment:3 Changed on 12/12/2017 at 11:35:52 AM by jsonesen

  • Description modified (diff)

comment:4 follow-up: Changed on 12/12/2017 at 11:37:43 AM by kzar

If you think the problem's only with prerendered tabs we could attempt to verify that. Please could you try:

  1. Opening a new tab, slowly typing the address in the address bar, hitting enter and seeing if the exception occurs.
  2. Refreshing that page, or loading the page by clicking on a link and confirming the exception doesn't occur.

If the exception appears / doesn't appear consistently it would indicate that you might be right.

comment:5 Changed on 12/12/2017 at 11:42:47 AM by jsonesen

  • Description modified (diff)

comment:6 in reply to: ↑ 4 Changed on 12/12/2017 at 11:45:32 AM by jsonesen

Replying to kzar:

If you think the problem's only with prerendered tabs we could attempt to verify that. Please could you try:

  1. Opening a new tab, slowly typing the address in the address bar, hitting enter and seeing if the exception occurs.
  2. Refreshing that page, or loading the page by clicking on a link and confirming the exception doesn't occur.

If the exception appears / doesn't appear consistently it would indicate that you might be right.

So, yeah slowly typing "youtube.com" or "irccloud.com" triggers the error but refreshing does not.

comment:7 Changed on 12/12/2017 at 11:51:35 AM by kzar

  • Description modified (diff)
  • Platform changed from Unknown / Cross platform to Chrome
  • Summary changed from Navigating to cached pages triggers "Uncaught (in promise) Error" to Chrome throws "Uncaught (in promise)" exception in background page for prerendered tabs

comment:8 Changed on 12/12/2017 at 11:53:37 AM by kzar

  • Description modified (diff)

comment:9 Changed on 12/12/2017 at 12:40:47 PM by kzar

  • Description modified (diff)
  • Priority changed from Unknown to P2
  • Ready set
  • Summary changed from Chrome throws "Uncaught (in promise)" exception in background page for prerendered tabs to Chrome throws "Receiving end does not exist" exception thrown in background page

comment:10 Changed on 12/12/2017 at 01:04:44 PM by sebastian

  • Cc sebastian added; snoack removed

comment:11 Changed on 12/12/2017 at 02:13:26 PM by kzar

OK it seems Manish already partially worked around this issue (see this codereview), but for some reason it's sometimes still happening on Chrome.

comment:12 Changed on 12/12/2017 at 02:18:36 PM by kzar

  • Description modified (diff)

comment:13 Changed on 12/12/2017 at 03:53:07 PM by kzar

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

comment:14 Changed on 12/12/2017 at 03:53:19 PM by kzar

  • Owner set to kzar

comment:15 Changed on 12/21/2017 at 12:39:38 PM by abpbot

A commit referencing this issue has landed:
Issue 6183 - Reduce "Receiving end does not exist" exceptions

comment:16 Changed on 12/21/2017 at 12:40:35 PM by kzar

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

comment:17 Changed on 02/08/2018 at 09:09:26 AM by Ross

This no longer seems to occur with prerendered tabs however it still occurs in the background page every time the Block element functionality is used.

ABP 3.0.2.1968
Chrome 64 / Windows 7

comment:18 Changed on 02/14/2018 at 04:20:07 PM by kzar

  • Resolution fixed deleted
  • Review URL(s) modified (diff)
  • Status changed from closed to reopened

This no longer seems to occur with prerendered tabs however it still occurs in the background page every time the Block element functionality is used.

Good point, I've opened a review to fix that as well.

comment:19 Changed on 02/20/2018 at 11:52:03 AM by abpbot

A commit referencing this issue has landed:
Issue 6183 - Avoid attempting to close the composer popup twice

comment:20 Changed on 02/20/2018 at 12:08:38 PM by kzar

  • Resolution set to fixed
  • Status changed from reopened to closed

How's that looking now Ross?

comment:21 Changed on 03/16/2018 at 03:16:45 PM by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed. I haven't seen this exception in at all in recent builds in general browsing or when using the block element functionality.

Block element in Chrome now triggers a different error (#6490) but doesn't break functionality.

ABP 3.0.2.1983
Firefox 53 / Firefox 58 / Windows 7
Chrome 49 / 65 / Windows 7
Chrome 64 / Ubuntu 16.04
Opera 36 / 51 / Windows 7

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 kzar.
 
Note: See TracTickets for help on using tickets.