Comments (5)
The behavior of the right-click context menu is a bit special. When you right click on the selection, the browser grabs the selected text and hands it directly to our context-menu event handler to read aloud. This is different from the other activation methods, which has to inject code into the page to grab the selected text.
For this reason, we can't make a keyboard shortcut that replicate the exact equivalent behavior. Our keyboard handler will hvae to inject code to grab the text. But the "Play/Pause" and "Activate the extension" shortcuts are already doing that.
Now since you don't want to popup to appear, you are left with the "Play/Pause" method. Your issue is you want the shortcut to start reading anew instead of pausing. Unfortunately Chrome only allows maximum 4 keyboard shortcuts. We cannot add another one without removing something.
A workaround you can use right now is to press the Stop shortcut first, and then the Play/Pause shortcut. But this leads me to this train of thought. Maybe we can change the "Play/Pause" shortcut to just "Play", and make it always play anew. Then change the "Stop" shortcut to "Pause/Resume". After all, the user doesn't care about the distinction between pause and stop. Let me think more about this.
from read-aloud.
Unfortunately Chrome only allows maximum 4 keyboard shortcuts.
Oh that explains why most extensions I see only have that many shortcuts. However, there're also many other plugins that allow more than 4 shortcuts (uBlock Origin — 7, Global Speed — 16), Tweaks for YouTube — ~ 20)
My current work around is exactly as you said — to use Stop and then Play. Your proposal to change around these shortcuts make sense to me. If there's difficulty choosing what functions to give to a shortcut, I'd recommend you to look at Global Speed. I really like how it allows users to really deeply customize its shortcuts.
The work around though doesn't work with selected text from pages such as https://www.autohotkey.com/docs/v2/Program.htm. But right click → Read aloud selected text work.
Btw, I have a somewhat related request: Is there a way to for the plugin to read aloud the clipboard content? I'm thinking if I can be in any app, copy text, and then use a global shortcut to have this extension read that block of text aloud. Let me know if I should make a separate feature request. This would also help with reading selected text from the autohokey page above (select text → copy → read instead of right click and select the Read aloud option). Thank you!
from read-aloud.
Ah thank you, I had the wrong assumption about the 4-shortcut limits. So we can have as many shortcuts defined as we want, but only 4 active at any one time, I suppose. I'll see what shortcuts to add that makes sense.
The behavior of the right-click context menu is a bit special. When you right click on the selection, the browser grabs the selected text and hands it directly to our context-menu event handler to read aloud. This is different from the other activation methods, which has to inject code into the page to grab the selected text.
On sites like autohotkey.com, the regular activation method is unable to grab the selected text because the selection is inside in iframe. Technically we could traverse all the frames and find which one has text selected, but if the frame is cross-domain, we won't be able to access it. In that case, only the right-click method will work.
from read-aloud.
Ah, you're right. Users can set as many as they want. Indeed only 4 can be declared by the extension.
from read-aloud.
but only 4 active at any one time
I've had 5 active shortcuts from an extension, so there can be more active shortcuts :D
from read-aloud.
Related Issues (20)
- Service doesn't start on selecting it HOT 6
- Google Docs Workspace version no longer works HOT 3
- Options to enable Google Studio voices HOT 8
- Phonic rules HOT 1
- New read request doesn't abort old requests.
- Stuck Extension after long pause HOT 1
- [Feature request] Can you add webpages text highlighting to Read Aloud HOT 3
- Increase speed/Reduce pauses when using Microsoft Natural Voices?
- Not working in Firefox, when Autoplay is set to Block, and the site has an exception. HOT 3
- Feature Request: Have number indicator for pitch setting.
- Sever Return 429 HOT 1
- Feature Request: Adjust(able) pause length between sentences HOT 2
- Save to mobile reading list
- "Read aloud selected text" right click context menu no longer visible in Firefox ESR/Tor Browser after disabling/reinstalling HOT 2
- Unordered List is read as Order HOT 6
- Not working in MS Edge with Copilot.
- Microsoft Edge - Error Unable to read any text on webpages. HOT 1
- Feature request: Support Piper voices in the custom voice backend HOT 9
- Better language detection strategy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from read-aloud.