Closed Bug 1749038 Opened 4 months ago Closed 3 months ago

As a user of Firefox ReaderMode I would like a keyboard command to toggle narrate

Categories

(Toolkit :: Reader Mode, enhancement, P3)

Firefox 95
Desktop
All
enhancement

Tracking

()

VERIFIED FIXED
99 Branch
Tracking Status
relnote-firefox --- 99+
firefox99 --- verified

People

(Reporter: jp, Assigned: micha154)

References

(Blocks 1 open bug)

Details

(Whiteboard: [reader-mode-narrate] )

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

I tried to find a keyboard command to trigger narrate in ReaderMode

Actual results:

To the best of my knowledge this does not exist.

Expected results:

In addition to toggling the narration of the article while in ReaderMode, there should be some documentation online for how to do this.

For example , this can be accomplished by copying this JS into the console when viewing an article in ReaderMode:

document.addEventListener('keydown', function (event) {
    // Cmd + E to read the article
    if (event.metaKey && event.key === 'e') {
        document.querySelector("#toolbar .narrate-start-stop").click()
    }
});

Then activate the toggle by pressing Cmd + e on a Mac or Windows + e on a PC.

Blocks: 1748655
Severity: -- → N/A
Status: UNCONFIRMED → NEW
Component: Untriaged → Reader Mode
Ever confirmed: true
OS: Unspecified → All
Priority: -- → P3
Product: Firefox → Toolkit
Hardware: Unspecified → Desktop
Whiteboard: [reader-mode-narrate]
Assignee: nobody → micha154
Status: NEW → ASSIGNED

Is it possible to use cmd + e (i.e. event.metaKey && event.key === "e")? I'm am the original requestor of this issue. My workflow is to open a link in a new tab. Often this is a URL copy and paste. Then to toggle ReaderMode and finally toggle narration. Therefore, the keyboard commands on my mac are:

copy (cmd + c)
set firefox active (cmd + tab)
open new tab (cmd + t)
paste (cmd + v)
load URL (return)
toggle ReaderMode (option + cmd + r)
finally toggle narration

As you can see, in this entire sequence the control key is never pressed. While I'm sure that I will learn to press ctrl + y over time, it seems like it will feel unnatural or at the least more complicated. Is it possible to use cmd (aka metaKey)? cmd + e doesn't appear to be assigned to anything else and would be a very natural key press after enabling ReaderMode.

The meta key unfortunately doesn't work in Windows (see here) so it doesn't make sense to use the meta key.

Depends on D136068

Attachment #9259247 - Attachment description: Bug 1749038 - This is a commit from adding a keyboard command to toggle narrate. r=niklas,mtigley → Bug 1749038 - Adding a keyboard command to toggle narrate in reader mode. r=niklas,mtigley
Attachment #9259280 - Attachment is obsolete: true

After further consideration we are going to make the key command platform specific.

For Mac users it will be cmd + e
For non Mac users it will be ctrl + alt + e

(In reply to Niklas Baumgardner [:niklas] from comment #6)

After further consideration we are going to make the key command platform specific.

For Mac users it will be cmd + e
For non Mac users it will be ctrl + alt + e

We can't use ctrl+alt shortcuts on Windows, because for users where the keyboard language has an "AltGr" concept, cltr+alt is the same as "altgr" and can be used for typing accented characters and the like. This is why, when using such a modifier set for XUL <key> elements, we print a warning: https://searchfox.org/mozilla-central/rev/72c7cef167829b6f1e24cae216fa261934c455fc/dom/events/KeyEventHandler.cpp#632-638 .

Instead of using modifiers, could this just be a web-app style single key shortcut? That is, could we just have pressing the letter "n" key without modifiers work this way, if the document has focus, the focused element isn't in an inputfield, and no modifiers are pressed? That would also be a better mnemonic (n for narrate, instead of e for ... ?).

Also, can we make sure to list whatever shortcut key we land on in the tooltip for the play/pause narrate item?

Flags: needinfo?(nbaumgardner)

Thanks for info Gijs.

We will switch to a single key press of "n" to toggle narrate. I think "n" makes more sense for this case.

Flags: needinfo?(nbaumgardner)
Pushed by mtigley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7941091cc105
Adding a keyboard command to toggle narrate in reader mode. r=niklas,mtigley
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

Should we mention that feature in our release notes?

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Pascal Chevrel:pascalc from comment #11)

Should we mention that feature in our release notes?

Passing this question to Niklas.

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(nbaumgardner)

Yeah let's mention it!

Flags: needinfo?(nbaumgardner)

Release Note Request (optional, but appreciated)
[Why is this notable]:
[Affects Firefox for Android]: No
[Suggested wording]: You can now toggle Narrate in ReaderMode with the keyboard shortcut “n”
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
QA Whiteboard: [qa-99b-p2]

Verified that the implementation works as expected for the narrate in Reader mode when pressing the "n" key. Tests were performed on macOS 10.15.7, Ubuntu 20.04 and Windows 10.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-99b-p2]
You need to log in before you can comment on or make changes to this bug.