Opened on 10/27/2017 at 09:33:23 PM

Closed on 11/03/2017 at 01:17:19 PM

#5956 closed defect (fixed)

[webextension] :-abp-has() fail in Firefox

Reported by: hfiguiere Assignee: hfiguiere
Priority: Unknown Milestone:
Module: Core Keywords:
Cc: arthur, trev, kzar, sebastian Blocked By:
Blocking: Platform: Firefox
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29590629/
https://codereview.adblockplus.org/29596576/

Description

Environment

Firefox nightly
Latest dev build of the webextension (900)

How to reproduce

  1. Add the filter eyeo.com#?#.column:-abp-has(#mission)
  2. Go to eyeo.com

Observed behaviour

The page in unchanged.

Expected behaviour

The "Our mission" section is hidden.

Regression

Doesn't happen on Chrome.

Attachments (0)

Change History (9)

comment:1 Changed on 10/27/2017 at 09:47:37 PM by hfiguiere

In the dev tools debugger, pausing on exception and reloading the page trigger a "InvalidAccessError: A parameter or an operation is not supported by the underlying object".
It occurs when enumerating the stylesheets.

If I just add a try { } catch () block things will work.

A delay in running this _addSelectors() (like a breakpoint) will also work around by not having the error.

comment:2 Changed on 10/27/2017 at 11:29:15 PM by hfiguiere

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

comment:3 Changed on 11/02/2017 at 03:18:58 PM by hfiguiere

I have seen this problem happening also on Facebook.

comment:4 Changed on 11/03/2017 at 08:33:46 AM by trev

#5974 has a different set of steps to reproduce, affecting Firefox 56 and older versions as well apparently.

comment:5 Changed on 11/03/2017 at 08:52:17 AM by trev

I looked into this and the root cause appears to be our content script running too early, while the document is still loading. I tried checking for document.readyState == "loading" and delaying until DOMContentLoaded event in this case, it fixes the issue in both scenarios.

comment:6 Changed on 11/03/2017 at 08:53:43 AM by trev

  • Review URL(s) modified (diff)

comment:7 Changed on 11/03/2017 at 01:03:12 PM by hfiguiere

  • Summary changed from :-abp-has() fail in Firefox to [webextension] :-abp-has() fail in Firefox

comment:8 Changed on 11/03/2017 at 01:16:55 PM by abpbot

comment:9 Changed on 11/03/2017 at 01:17:19 PM by trev

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