Open Bug 1366752 Opened 7 years ago Updated 2 years ago

ExtensionPanel.onSearch event is unimplemented

Categories

(WebExtensions :: Developer Tools, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jwkbugzilla, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: triaged)

devtools.panel.create() API has been implemented in bug 1300587. However, while the ExtensionPanel.onSearch event has been added to the schema, the implementation is currently merely a TODO comment: https://dxr.mozilla.org/mozilla-central/rev/74566d5345f4cab06c5683d4b620124104801e65/browser/components/extensions/ext-c-devtools-panels.js#120. This causes an exception in Adblock Plus with the current Nightly build.
See Also: → 1300587
Assignee: nobody → lgreco
Priority: -- → P2
Whiteboard: triaged
No longer blocks: 1211859
The main reason why the panel.onSearch event wasn't part of the initial subset of devtools API is due to some differences in the "search feature" between the Firefox Developer Toolbox and the Chrome one:

- on Chrome when the developer tools are focused and the user press Ctrl-F, a find bar appears 
  (usually on the bottom on the panel, on some panel it appears in a different mode and/or position)
- on Firefox every panel defines and manages its own search field (and the keyboard shortcut)

My feeling is that to implement this API properly, we should evaluate the changes from a "DevTools toolbox point of view" first:

most of the changes are probably going to be part of the devtools toolbox itself (e.g. the additional XUL elements that compose its UI, listening to the keyboard shortcut to make this find bar visible, and emitting an event on the toolbox when the
search field has been updated), and then wrapped into the WebExtensions panel.onSearch event.

For the above reasons, I would like to evaluate and double-check the priority (and interest) related to the these toolbox changes with the DevTools Team first, and then we will update the priority of this WebExtensions API accordingly.

Needinfo Bryan, as we agreed during a brief chat on the topic, to determine who are the best contacts from the DevTools Team for additional feedbacks and thoughts on this.
Flags: needinfo?(clarkbw)
Yes, I'm adding in Patrick here. I'll also bring this up with Victoria (our UX designer).  I don't think we'll be able to make this happen until later in the year.  However I want to say that I agree that we should implement this kind of UI first and then we can hook up the API to it afterward.
Flags: needinfo?(clarkbw)
Changing priority to P3, because it is currently blocked on the availability of the related devtools toolbox feature, which does not yet exist.

In the meantime, the possible workarounds for an extension that uses this API are:

- use the panel.onSearch event only if available
- provide its own search feature in the extension panel itself (e.g. if the feature cannot be disabled without distrupting a mandatory extension feature).
Priority: P2 → P3
Product: Toolkit → WebExtensions
Assignee: lgreco → nobody

How can I handle the onSearch event in my chrome devtools extension panel, which will fire when hitting Ctrl + F and typing some query string.

In my panel's background page I can listen for that event, but I dunno how to access it within the panel itself neither how to respond with the amount of matches to get the search navigation https://www.mybpcreditcard.review/

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.