Opened on 10/02/2017 at 08:30:49 PM

Closed on 11/23/2017 at 02:24:08 PM

Last modified on 12/05/2017 at 10:00:41 AM

#5817 closed defect (fixed)

[webextension] "block element" produces only an empty window

Reported by: mapx Assignee: kzar
Priority: P1 Milestone: Adblock-Plus-3.0.2-for-Firefox
Module: Platform Keywords: externaldependencies
Cc: sebastian, trev, mjethani, kzar, hfiguiere Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29602561/
https://codereview.adblockplus.org/29613777/

Description (last modified by trev)

Environment

Windows 10
FF 57.0b4 (64-bit)
ABP 2.99.0.1867beta
Easylist

How to reproduce

go to google page
click ABP icon, click "block element"
select whatever element on page

Observed behaviour

  • an empty window opens - no filters are proposed
  • I tried to close the window => I have to click twice to get it closed

Expected behaviour

..normal behaviour

Situation also reported by the users in forum.

It seems nobody tested a crucial feature.

Background

This is a timing issue, the initialization message is sent to the pop-up before it is ready.

Attachments (2)

webext.PNG (19.1 KB) - added by mapx on 10/02/2017 at 08:31:20 PM.
webexterr.PNG (17.7 KB) - added by mapx on 10/02/2017 at 08:36:26 PM.

Download all attachments as: .zip

Change History (39)

Changed on 10/02/2017 at 08:31:20 PM by mapx

comment:1 Changed on 10/02/2017 at 08:35:49 PM by sebastian

  • Cc mjethani added

Changed on 10/02/2017 at 08:36:26 PM by mapx

comment:2 Changed on 10/02/2017 at 08:38:06 PM by mapx

  • Description modified (diff)

comment:3 Changed on 10/13/2017 at 02:07:21 PM by mapx

  • Description modified (diff)

comment:4 Changed on 10/17/2017 at 09:42:38 PM by sebastian

  • Component changed from Adblock-Plus-for-Firefox to Platform

comment:5 Changed on 10/26/2017 at 04:02:31 PM by mapx

  • Cc kzar hfiguiere added

comment:6 Changed on 10/26/2017 at 04:55:34 PM by mapx

Trying to close (clicking "Cancel" ) the empty window, I get (in the console)

Scripts may not close windows that were not opened by script. composer.js:64:2

Clicking the window "x" I get in the console (but however the window is then closed clicking twice):

Error: port.onDisconnect.hasListeners is not a function  undefined
Error: Could not establish connection. Receiving end does not exist.  undefined



comment:7 Changed on 10/27/2017 at 01:06:11 PM by trev

I can reproduce this issue in Nightly (58.0a1 2017-10-26 on Linux) but not on Firefox 56. It's not actually an empty window however, resizing it makes the content appear - seems to be a Firefox rendering bug. Also, clicking the Cancel button works correctly here.

comment:8 Changed on 10/27/2017 at 01:07:43 PM by trev

There is a browser error being reported which is likely the cause:

TypeError: invalid 'in' operand browser tabbrowser.xml:2437:1

comment:9 Changed on 10/27/2017 at 01:09:30 PM by mapx

as I said it happens in FF 57. No text in the window, "cancel" not working.

comment:10 Changed on 11/09/2017 at 01:53:21 PM by trev

  • Description modified (diff)
  • Owner set to trev
  • Priority changed from Unknown to P1
  • Ready set

comment:11 Changed on 11/09/2017 at 02:14:22 PM by trev

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

comment:12 Changed on 11/10/2017 at 06:28:44 PM by abpbot

comment:13 Changed on 11/10/2017 at 06:29:27 PM by trev

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

comment:14 Changed on 11/10/2017 at 07:01:16 PM by mapx

It was fixed for chrome but not for firefox (57 - on windows 10)

More: "Cancel" button does not work, I have to click "X" to close the window

comment:15 Changed on 11/10/2017 at 07:05:19 PM by mapx

pressing "Cancel" I get in console:

Scripts may not close windows that were not opened by script.

opening the window =>

TypeError: invalid 'in' operand browser[Learn More]  tabbrowser.xml:2426:1
	_insertBrowser chrome://browser/content/tabbrowser.xml:2426:1
	getRelatedElement chrome://browser/content/tabbrowser.xml:7146:11
	set_selectedIndex chrome://global/content/bindings/tabbox.xml:406:31
	tabs_XBL_Constructor chrome://global/content/bindings/tabbox.xml:275:13
	<anonymous> chrome://browser/content/tabbrowser.xml:46:9
	_updateNewTabVisibility chrome://browser/content/tabbrowser.xml:5828:15
	tabbrowser_XBL_Constructor chrome://browser/content/tabbrowser.xml:5885:11
NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]  ext-windows.js:19
Error: Could not establish connection. Receiving end does not exist.

comment:16 Changed on 11/10/2017 at 08:00:35 PM by trev

Please create a new issue on the Cancel button not working. It isn't reproducible for me, I suspect another extension interfering here.

comment:17 Changed on 11/10/2017 at 08:05:07 PM by mapx

it was reported here: https://issues.adblockplus.org/ticket/5979
by Ross

and the [Cancel] button does not do anything.

comment:18 Changed on 11/10/2017 at 08:07:26 PM by mapx

probably the same issue here:
https://issues.adblockplus.org/ticket/5988

buttons doing ..nothing

comment:19 Changed on 11/16/2017 at 07:45:50 PM by mapx

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:20 Changed on 11/16/2017 at 07:46:27 PM by mapx

The issue still hitting Windows users for firefox 57 + ABP 3

comment:21 Changed on 11/17/2017 at 03:38:40 PM by kzar

Yes, I've just tested and while Wladimir's fix works for me on Linux it doesn't seem to on Windows 10.

comment:22 Changed on 11/17/2017 at 03:50:12 PM by kzar

I can also reproduce the problem with the buttons on Windows, I've opened #6053 for that. (No it's not a duplicate of #5988 unfortunately.)

comment:23 Changed on 11/17/2017 at 03:53:00 PM by kzar

  • Summary changed from webextension: "block element" produces only an empty window to [webextension] "block element" produces only an empty window

comment:24 Changed on 11/18/2017 at 05:04:52 PM by kzar

I've been looking into why this problem is still happening on Windows 10. I notice that there's a Error: Could not establish connection. Receiving end does not exist. message showing up in the console when the "composer.dialog.init" message is sent, and the message is never received by the popup. I've tried adding a 100ms delay before sending the message, no dice. I then tried adding a 1 second delay and it worked.

Wladimir's fix seems correct to me, I guess we can't trust the onUpdated "complete" event :/.

comment:25 Changed on 11/18/2017 at 05:49:33 PM by kzar

  • Keywords externaldependencies added

I've opened a Firefox bug about that https://bugzilla.mozilla.org/show_bug.cgi?id=1418655

comment:26 Changed on 11/21/2017 at 12:55:42 PM by kzar

  • Owner changed from trev to kzar

comment:27 Changed on 11/21/2017 at 03:00:39 PM by kzar

Annoyingly the error is not a real exception so we can't catch it, looking into what else we can do to workaround the problem on Windows 10.

comment:28 Changed on 11/21/2017 at 03:04:48 PM by mapx

The "1 second delay" does not work always ?

comment:29 Changed on 11/21/2017 at 03:41:00 PM by kzar

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

Annoyingly the error is not a real exception so we can't catch it...

My mistake, the API was promisified I just had to call .catch()!

The "1 second delay" does not work always ?

Well it seems to work reliably for me, but who knows that it would work reliably on a different computer. Hard coding pauses like this is a nasty hack :/

comment:30 Changed on 11/23/2017 at 02:23:05 PM by abpbot

comment:31 Changed on 11/23/2017 at 02:24:08 PM by kzar

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

comment:32 Changed on 11/28/2017 at 02:55:32 PM by kzar

  • Milestone changed from Adblock-Plus-for-Firefox-next to Adblock-Plus-3.0.2-for-Chrome-Opera-Firefox

comment:33 follow-ups: Changed on 11/29/2017 at 10:55:30 AM by Ross

In Firefox 57 / Windows 7 on Google: The highlight never appears.
In Firefox 57 / Windows 7 on ArsTechnica: The highlight works and the dialog appears but it sits disabled displaying "Loading..." for ages.

In Chrome 62 / Windows 7 on Google: The highlight never appears.
In Chrome 62 / Windows 7 on ArsTechnica: The highlight works, dialog appears and filter suggested as expected.

ABP 3.0.1.1939

comment:34 Changed on 11/29/2017 at 11:15:07 AM by mapx

chrome 63 / w 7 => on google selected element is highlighted on page(2 different languages)
firefox 58 / w 7 => on google selected element is highlighted on page

ABP 3.0.1.1939

Last edited on 11/29/2017 at 11:15:58 AM by mapx

comment:35 in reply to: ↑ 33 Changed on 11/29/2017 at 11:32:09 AM by kzar

Replying to Ross:

In Firefox 57 / Windows 7 on ArsTechnica: The highlight works and the dialog appears but it sits disabled displaying "Loading..." for ages.

In Chrome 62 / Windows 7 on ArsTechnica: The highlight works, dialog appears and filter suggested as expected.

This is the expected behaviour, we work around the Firefox bug on Windows by retrying once every second for three seconds. That's why I added the "Loading..." message to make it clear what was happening. Not ideal, but the best we can do until Mozilla fix the underlying problem.

In Firefox 57 / Windows 7 on Google: The highlight never appears.
In Chrome 62 / Windows 7 on Google: The highlight never appears.

Please could you file a separate issue for that?

comment:36 in reply to: ↑ 33 Changed on 11/29/2017 at 11:54:58 AM by trev

Replying to Ross:

In Chrome 62 / Windows 7 on Google: The highlight never appears.
In Chrome 62 / Windows 7 on ArsTechnica: The highlight works, dialog appears and filter suggested as expected.

As Sebastian explained on IRC, this is also expected behavior. With Acceptable Ads enabled, hiding anything on this page isn't possible. You can only block things, which makes the logo the only selectable element on this page.

comment:37 Changed on 11/30/2017 at 01:22:57 PM by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed. Block element works as expected. There is an issue still with block element in older Firefox versions (#6113).

(Thank you for explanations).

ABP 3.0.1.1939
Firefox 52 / 57 / Windows 10
Chrome 52 / 62 / Windows 7
Opera 39 / 49 / Windows 7

Last edited on 12/05/2017 at 10:00:41 AM by Ross

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.