Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#3964 closed defect (fixed)

Console errors when using CSS property filters

Reported by: Ross Assignee: trev
Priority: P1 Milestone: Adblock-Plus-2.7.3-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29340718/

Description (last modified by trev)

Environment

ABP 2.7.2.4165

Reproduced with:
Firefox 44 / 45 / Windows 8

How to reproduce

  1. Launch Firefox open the Firefox console (CTRL+SHIFT+J).
  2. Install the latest ABP dev build.
  3. Add custom filter: testpages.adblockplus.org##[-abp-properties='width: 64px;']
  4. Navigate to https://testpages.adblockplus.org
  5. Refresh the page several times.
  6. Observe the logo is sometimes hidden but often not.
  7. Observe errors in console related to CSS property filters.

Observed behaviour

The initial behaviour of the filter looks correct and hides the logo. But after refreshing the page the filter no longer seems to apply to the page and several errors are printed into the console:

InvalidAccessError: A parameter or an operation is not supported by the underlying object cssProperties.js 79:0
(This error also appears with a source of "<unknown>".

Expected behaviour

Errors to not occur when using CSS property filters.

Background

CSS properties content script expects to run when all the stylesheets are already loaded. We are currently running it on DOMContentLoaded event in Firefox however, so there is chance that it will access a stylesheet that isn't loaded yet and trigger the exception above.

What to change

Run the content script from load event handler, not DOMContentLoaded.

Change History (5)

comment:1 Changed 3 years ago by trev

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

comment:2 Changed 3 years ago by trev

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

comment:3 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockplus/rev/f5520175f5e3

comment:4 Changed 3 years ago by trev

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

comment:5 Changed 3 years ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

CSS property filters now work as expected and no longer cause errors shown the console.

ABP 2.7.2.4166
Firefox 45 / Windows 8

Note: See TracTickets for help on using tickets.