Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#5381 closed defect (fixed)

CSS property filters error in old Chrome versions

Reported by: Ross Assignee: hfiguiere
Priority: P2 Milestone:
Module: Core Keywords:
Cc: kzar, hfiguiere, sebastian Blocked By:
Blocking: Platform: Chrome
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29481659

Description (last modified by hfiguiere)

Environment

ABP 1.13.2.1785
Chrome 49 / 50 / Windows 7
Opera 36 / 37 / Windows 7
Does not occur on Chrome 51+
Does not occur on Opera 38+

ABP 1.13.2 (Release)
Chrome 49 / Windows 7

How to reproduce

  1. Visit https://adblockplus.org
  2. Open the console.
  3. Add the filter to ABP: adblockplus.org#?#:-abp-properties(width: 76px)
  4. Refresh the page.

Observed behaviour

The CSS property filter is not applied (The ABP logo should be hidden) and the following errors appear in the console:

Error in event handler for (unknown): TypeError: stylesheets[Symbol.iterator] is not a function
at Object.addSelectors (chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/elemHideEmulation.js:408:26)
at getFiltersFunc.patterns (chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/elemHideEmulation.js:477:14)

Expected behaviour

No errors to occur and the CSS property filter to be applied.

Change History (12)

comment:1 Changed 2 years ago by sebastian

  • Cc kzar hfiguiere sebastian added

comment:2 Changed 2 years ago by hfiguiere

So in Chrome 50 and below, document.styleSheets is not iterable....

comment:3 Changed 2 years ago by Ross

  • Description modified (diff)

(Added relevant Opera versions too)

Last edited 2 years ago by Ross (previous) (diff)

comment:4 Changed 2 years ago by Ross

  • Description modified (diff)

This also occurs with the old syntax with the last release.

comment:5 Changed 2 years ago by hfiguiere

  • Description modified (diff)
  • Owner set to hfiguiere

I can fix that, how far back do I have to test?

comment:6 Changed 2 years ago by hfiguiere

  • Description modified (diff)

comment:7 Changed 2 years ago by sebastian

  • Component changed from Platform to Core
  • Priority changed from Unknown to P2
  • Ready set

Ok, since this is not a regression introduced since the last release (as per Ross' comment above), we don't need to fix this before releasing Adblock Plus 1.13.3. However, it would be great if we could include a fix with Adblock Plus 1.13.4.

The oldest supported version as of now is Chrome 49. You find the compatibility information here.

comment:8 Changed 2 years ago by hfiguiere

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

comment:9 Changed 2 years ago by abpbot

A commit referencing this issue has landed:
Issue 5381 - iterate stylesheet with an array subscript

comment:10 Changed 2 years ago by hfiguiere

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

comment:11 Changed 2 years ago by Ross

This no longer causes an error in old versions, but element hiding filters do not appear to work in old versions (which is not a regression).

ABP 1.13.3.1838
Chrome 49 / 61 / Windows 10
Opera 36 / 47 / Windows 10

Last edited 2 years ago by Ross (previous) (diff)

comment:12 Changed 2 years ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Marking this verified as the error itself is fixed. Opened a new issue for the filter application itself #5773.

Note: See TracTickets for help on using tickets.