Opened 5 years ago

Closed 5 years ago

#1428 closed defect (fixed)

"Block Element" doesn't work for XML documents

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

http://codereview.adblockplus.org/4840054052618240

Description (last modified by sebastian)

Adapted from https://www.passbrains.com/dashboard/view-ticket.php?ticket_no=AOP-90

Environment

Windows + Vista 64bit + Opera + English
ABP version Adblock Plus Version 1.8.5.1227

How to reproduce

  1. Got to http://www.w3.org/Math/XSL/csmall2.xml http://www.w3.org/Math/XSL/csmall2.xml
  2. Right-click on the image highlighted with a red circle in the screenshot
  3. Choose Block Element

Observed behaviour

Nothing happens, beside the exception from comment:1 being logged to the console.

Also the "Block Element" option in the bubble does not work on that page.

Expected behaviour

Since this is an XML document we can't interact with the document as required to implement "Block Element". Therefore that code shouldn't run in the first place, that no exception shows up.

Also the "Block Element" option shouldn't be avaialable from the context menu and bubble on XML pages, which don't support that feature.

Attachments (1)

3659_1411069484_tablexml-image1.jpg (96.0 KB) - added by passbrains 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by passbrains

comment:1 Changed 5 years ago by philll

  • Description modified (diff)

The following exception is logged in the console:

Error in event handler for runtime.onMessage: Cannot set property 'left' of null
Stack trace: TypeError: Cannot set property 'left' of null
    at addElementOverlay (chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/include.postload.js:96:22)
    at chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/include.postload.js:528:28
    at Object.EventTarget._dispatch (chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/ext/common.js:52:37)
    at chrome-extension://ldcecbkkoecffmfljeihcmifjjdoepkn/ext/content.js:3:24
    at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
    at EventImpl.dispatchToListener (extensions::event_bindings:397:22)
    at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
    at Event.publicClass.(anonymous function) [as dispatchToListener] (extensions::utils:89:26)
    at EventImpl.dispatch_ (extensions::event_bindings:379:35)
    at EventImpl.dispatch (extensions::event_bindings:403:17) extensions::uncaught_exception_handler:9
handler extensions::uncaught_exception_handler:9
exports.handle extensions::uncaught_exception_handler:15
EventImpl.dispatch_ extensions::event_bindings:384
EventImpl.dispatch extensions::event_bindings:403
publicClass.(anonymous function) extensions::utils:89
messageListener extensions::messaging:190
EventImpl.dispatchToListener extensions::event_bindings:397
publicClass.(anonymous function) extensions::utils:89
EventImpl.dispatch_ extensions::event_bindings:379
EventImpl.dispatch extensions::event_bindings:403
publicClass.(anonymous function) extensions::utils:89
dispatchOnMessage extensions::messaging:304

comment:2 Changed 5 years ago by mapx

  • Cc mapx added

comment:3 Changed 5 years ago by sebastian

  • Owner set to sebastian

The problem is that it is an XML document. So we can't interact with the DOM the way we do with HTML documents to implement the "Block Element" feature.

First of all we should prevent that code from running on XML documents, to prevent errors like that. Then we should hide the "Block Element" option from the context menu and bubble on those pages, where that feature isn't supported there.

comment:4 Changed 5 years ago by sebastian

  • Component changed from Unknown to Platform
  • Description modified (diff)
  • Platform changed from Opera to Unknown
  • Priority changed from Unknown to P3
  • Ready set
  • Summary changed from Images in table does not get blocked to "Block Element" doesn't work for XML documents

comment:5 Changed 5 years ago by sebastian

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

comment:6 Changed 5 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.