Expose a shortcut to reload addons from any firefox window

ASSIGNED
Assigned to

Status

()

Firefox
Developer Tools: about:debugging
P3
normal
ASSIGNED
2 years ago
6 months ago

People

(Reporter: ochameau, Assigned: Towkir, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [btpp-backlog])

(Reporter)

Description

2 years ago
Today, the devtools reload addon implement a magic shortcut that can be hit from any top level window and will reload the devtools.
This trick would be very useful to any addon. That would allow to reload the addon without having to be on about:debuggingn, nor necessarely having to open it.
(Reporter)

Updated

2 years ago
Depends on: 1246030
Priority: -- → P3
Whiteboard: [btpp-backlog]

Updated

2 years ago
Mentor: poirot.alex@gmail.com
(Assignee)

Comment 1

2 years ago
Hi Alexandre,
I am willing to work on this, looks like you are mentoring this one. Can you please tell me where to start ? 
Thanks
Flags: needinfo?(poirot.alex)
(Reporter)

Comment 2

2 years ago
Hi Ahmed,

Sure. This bug isn't trivial, but it should be about migrating some logic that already exist in the devtools addon, which is document here:
  https://developer.mozilla.org/en-US/docs/Tools/Contributing/Contribute_on_nightly

Instead of implementing this "Ctrl+Alt+R" key shortcut, that reloads the addon, we should backport this feature to about:debugging so that all addons can be reloaded via this shortcut.
Take a look at chrome extensions, they have a similar feature.

The code doing that in the addon lives here:
  https://dxr.mozilla.org/mozilla-central/source/devtools/bootstrap.js

There is this "MultiWindowKeyListener" helper which helps catching the Ctrl+Alt+R shortcut:
  https://dxr.mozilla.org/mozilla-central/source/devtools/bootstrap.js#21-65
  https://dxr.mozilla.org/mozilla-central/source/devtools/bootstrap.js#199-203

Then you should modify about:debugging to listen for this shortcut from there. about:debugging lives here:
  https://dxr.mozilla.org/mozilla-central/source/devtools/client/aboutdebugging

The code defining the UI of the addons panel lives here:
  https://dxr.mozilla.org/mozilla-central/source/devtools/client/aboutdebugging/components/addons

You will most likely have to mimic what chrome does and have some checkboxes to indicates which is the "active" addon that is going to be reloaded when you press this shortcut.
Assignee: nobody → 3ugzilla
Status: NEW → ASSIGNED
Flags: needinfo?(poirot.alex)
You need to log in before you can comment on or make changes to this bug.