Opened on 11/26/2014 at 09:47:23 AM

Closed on 11/26/2014 at 05:10:35 PM

#1609 closed defect (fixed)

"Block element" throws errors when generating filters for elements without selectors

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.8.8-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5896265296510976

Description

How to reproduce

  1. Go to http://9gag.com/gif
  2. Click ABP icon
  3. Choose "Block element"
  4. Select one of the videos

Observed behaviour

You get following error on the JavaScript console:

Uncaught SyntaxError: Failed to execute 'querySelectorAll' on 'Document': The provided selector is empty.

That is because no selector (for highlighting purposes) can be generated for that element. Hence document.querySelectorAll() is called with an empty string, resulting in this error.

Expected behaviour

The case of no selectors must be handled, that no error is thrown.

Attachments (0)

Change History (2)

comment:1 Changed on 11/26/2014 at 09:49:44 AM by sebastian

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

comment:2 Changed on 11/26/2014 at 05:10:35 PM by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • 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 sebastian.
 
Note: See TracTickets for help on using tickets.