Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#5 closed defect (fixed)

Fix Element Hiding Helper integration with the Inspector tool

Reported by: trev Assignee: saroyanm
Priority: P1 Milestone: Element-Hiding-Helper-1.3
Module: Extensions-for-Adblock-Plus Keywords:
Cc: smultron45@… Blocked By: #316, #317
Blocking: Platform:
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):



Element Hiding Helper 1.2.3 in Firefox 27.

How to reproduce

  1. Right-click an element on some webpage and choose "Inspect Element" from the menu

Observed behaviour

No "Hide with ABP" button in the Inspector tool.

Expected behaviour

Element Hiding Helper was originally adding a "Hide with ABP" button but the Web Tools API changed in recent Firefox versions (a while ago actually). We should restore this functionality with the new API, backwards compatibility is not required. The new UI no longer has action buttons but we should be able to add an item to the element's menu.

Attachments (1)

scratchpad.js (974 bytes) - added by saroyanm 6 years ago.
Observer registration for inspector-opened topic

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by mapx

  • Cc smultron45@… added
  • in_progress set to 0
  • Ready unset

comment:2 Changed 6 years ago by saroyanm

  • Owner set to saroyanm
  • Status changed from new to assigned

Changed 6 years ago by saroyanm

Observer registration for inspector-opened topic

comment:3 Changed 6 years ago by saroyanm

I've implemented a scratchpad script that register Observer as described in current link:

The observe method is not being called when the inspector is being opened (see attachment),

I'm not sure whether it's a bug, actually there is a list of topics for Developer Tools, but no one is being called in observer:

Also tried to use "*" as a topic parameter in addObserver method and open inspector, as result no event were being fired related to Developer Tools.

@Wladimir What you think could this be a bug ?

comment:4 Changed 6 years ago by trev

The example code you are using doesn't implement the QueryInterface method. You better use the existing code in lib/inspectorObserver.js as an example.

However, I'm not sure whether listening to these notifications is even the right approach any more. See for more information.

comment:5 Changed 6 years ago by saroyanm

Also tried the existing code, with no success observer is not being called.

Okey, then will go with the DevToolsAPI, also thought we are not using the API because of the warning:
Warning: The DevTools API is not available yet. The DevTools API is still WIP. If you notice any inconsistency, please let The Firefox Developer Tools Team know.

But anyway will go with that approach and update the ticket.

comment:6 Changed 6 years ago by trev

I checked - the MDN page on observer notifications for the Developer Tools is clearly outdated, these notifications are no longer being used. Also, from the source code it seems that the best way to access gDevTools would be by importing the corresponding module:

let {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", null);
Last edited 6 years ago by trev (previous) (diff)

comment:7 Changed 6 years ago by saroyanm

Thanks for comments Wladimir, They was really helpful.
I was able to make inspector tool ABP button work,
Will clean the code, test correctly and upload the patch.

comment:8 Changed 6 years ago by saroyanm

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

comment:9 Changed 6 years ago by saroyanm

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

comment:10 Changed 6 years ago by trev

  • Blocked By 316 added

comment:11 Changed 6 years ago by trev

  • Blocked By 317 added

comment:12 Changed 6 years ago by trev

  • Milestone set to Element-Hiding-Helper-next

comment:13 Changed 6 years ago by ileonelperea

Hi my name is Leonel, I am new here and I am trying to contribute to your project. I made a diff patch. Please review it so we can make it better.

I've created the string in english and spanish.

Version 0, edited 6 years ago by ileonelperea (next)
Note: See TracTickets for help on using tickets.