david-tejada / rango

🦎 The cross browser extension that helps you control your browser by voice. It blends in!
MIT License
127 stars 16 forks source link

Not Working in Firefox #73

Closed L4ma01bW13 closed 1 year ago

L4ma01bW13 commented 1 year ago

I'm using firefox 106.0.1 (64-bit) on ubuntu 22.04 LTS. It was working for some time but stopped working sometime around when the new firefox update came out. However, it does work if you're in keyboard mode and you use the prefix press or upper case but this only works for the alphabet to click links/hints and not for voice commands or the knausj_talon alphabet in text fields, the address bar, etc. The hot keys don't seem to be the issue because I didn't have problems in the beginning after installing but the default configuration is Ctrl+Shift+3 to get the talon request and Ctrl+Shift+Insert to get the talon request (legacy). Below is the output in REPL console of talon when I say, "x", "ab", and "crown af":

thread<139625494476352> | grammar.cfg_compile 0.097865s thread<139625494476352> | grammar.cfg_list user.rango_hint_styles: 0.000110s thread<139625494476352> | grammar.cfg_list user.rango_hint_weights: 0.000086s thread<139625494476352> | grammar.cfg_list user.rango_hints_toggle_levels: 0.000089s thread<139625494476352> | grammar.cfg_list user.rango_page_location_property: 0.000092s thread<139625494476352> | grammar.cfg_compile_and_link 0.098478s main | engine.phrase plex talon_plugins.subtitles | action speech.enabled() user/knausj_talon/apps/vscode/command_client/command_client.py | action user.emit_pre_phrase_signal() user/knausj_talon/plugin/command_history/command_history.py | action user.history_transform_phrase_text(['plex']) user/knausj_talon/plugin/command_history/command_history.py | action speech.enabled() main | action core.run_phrase(C(None, ['x'])) core | action core.run_command(CommandImpl(Rule("")), C(_la_ltuser_2erango_5ftarget_gt_ra, ['x'])) core | action core.run_talon_script(ResourceContext("user.rango-talon.rango_direct_clicking.talon"), TalonScript(code='user.rango_command_with_target("directClickElement", rango_target)'), C(_la_ltuser_2erango_5ftarget_gt_ra, ['x'])) user/rango-talon/rango_direct_clicking.talon | action user.rango_command_with_target('directClickElement', ['x']) user/rango-talon/rango.py | action key('ctrl-shift-insert') main | engine.phrase air bat talon_plugins.subtitles | action speech.enabled() user/knausj_talon/apps/vscode/command_client/command_client.py | action user.emit_pre_phrase_signal() user/knausj_talon/plugin/command_history/command_history.py | action user.history_transform_phrase_text(['air', 'bat']) user/knausj_talon/plugin/command_history/command_history.py | action speech.enabled() main | action core.run_phrase(C(None, ['ab'])) core | action core.run_command(CommandImpl(Rule("")), C(_la_ltuser_2erango_5ftarget_gt_ra, ['ab'])) core | action core.run_talon_script(ResourceContext("user.rango-talon.rango_direct_clicking.talon"), TalonScript(code='user.rango_command_with_target("directClickElement", rango_target)'), C(_la_ltuser_2erango_5ftarget_gt_ra, ['ab'])) user/rango-talon/rango_direct_clicking.talon | action user.rango_command_with_target('directClickElement', ['ab']) user/rango-talon/rango.py | action key('ctrl-shift-insert') main | engine.phrase crown air fine talon_plugins.subtitles | action speech.enabled() user/knausj_talon/apps/vscode/command_client/command_client.py | action user.emit_pre_phrase_signal() user/knausj_talon/plugin/command_history/command_history.py | action user.history_transform_phrase_text(['crown', 'air', 'fine']) user/knausj_talon/plugin/command_history/command_history.py | action speech.enabled() main | action core.run_phrase(C(None, crown ['af'])) core | action core.run_command(CommandImpl(Rule("crown ")), C(crown___ltuser_2erango_5ftarget_gt, crown ['af'])) core | action core.run_talon_script(ResourceContext("user.rango-talon.rango.talon"), TalonScript(code='user.rango_command_with_target("scrollElementToTop", rango_target)'), C(crown___ltuser_2erango_5ftarget_gt, crown ['af'])) user/rango-talon/rango.talon | action user.rango_command_with_target('scrollElementToTop', ['af']) user/rango-talon/rango.py | action key('ctrl-shift-insert') user/knausj_talon/plugin/mouse/mouse.py | action tracking.control_enabled() user/knausj_talon/plugin/mouse/mouse.py | action tracking.control1_enabled() user/knausj_talon/plugin/mouse/mouse.py | action tracking.control_enabled() user/knausj_talon/plugin/mouse/mouse.py | action tracking.control1_enabled() user/rango-talon/rango.py | context.refresh user.rango-talon.rango (tags)

david-tejada commented 1 year ago

Does saying click plex, for example, work? Do you get a timeout error in the talon log?

L4ma01bW13 commented 1 year ago

Yes I am getting a time out. This is what I get when I'm not in keyboard mode and try to click on hint h:

2022-10-22 15:16:34 INFO (SpeechSystem) Activating speech engine: W2lEngine(fast Conformer b108 (2021-09-15)) 2022-10-22 15:16:35 DEBUG Dispatched launch events at 2.9500s, done at 5.9868s 2022-10-22 15:16:53 WARNING list 'user.css_at_rule' skipped unknown tokens: ['-'] 2022-10-22 15:16:53 WARNING list 'user.punctuation' skipped unknown tokens: [',', ''] 2022-10-22 15:16:53 WARNING list 'user.symbol_key' skipped unknown tokens: [',', ''] 2022-10-22 15:17:26 WARNING [watchdog] "talon.scripting.speech_system._redispatch" @2.0s 38: lib/python3.9/threading.py:937 # cron thread 37: lib/python3.9/threading.py:980 36: lib/python3.9/threading.py:917 35: talon/cron.py:155| 34: talon/cron.py:106| 33: talon/vad.py:21 | 32: talon/scripting/speech_system.py:356| 31: talon/engines/w2l.py:709| 30: talon/scripting/dispatch.py:105| 29: talon/scripting/dispatch.py:144| 28: talon/scripting/dispatch.py:133| 27: talon/scripting/rctx.py:233| # 'phrase' main:_redispatch() 26: talon/scripting/speech_system.py:63 | 25: talon/scripting/dispatch.py:105| 24: talon/scripting/dispatch.py:144| 23: talon/scripting/dispatch.py:133| 22: talon/scripting/rctx.py:233| # 'phrase' main:engine_event() 21: talon/scripting/speech_system.py:410| 20: talon/scripting/actions.py:85 | # core.run_phrase() 19: talon/scripting/types.py:411| 18: talon/scripting/core/core.py:103| 17: talon/scripting/actions.py:85 | # core.run_command() 16: talon/scripting/types.py:411| 15: talon/scripting/core/core.py:132| 14: talon/scripting/actions.py:85 | # core.run_talon_script() 13: talon/scripting/types.py:411| 12: talon/scripting/core/core.py:139| 11: talon/scripting/talon_script.py:690| 10: talon/scripting/talon_script.py:589| 9: talon/scripting/talon_script.py:297| 8: talon/scripting/talon_script.py:556| 7: talon/scripting/actions.py:85 | # user.rango_command_with_target() 6: talon/scripting/types.py:411| 5: user/rango-talon/rango.py:174| send_request_and_wait_for_response(act.. 4: user/rango-talon/rango.py:134| response = read_json_response_with_tim.. 3: user/rango-talon/rango.py:110| actions.sleep(sleep_time) 2: talon/scripting/actions.py:165| 1: talon/lib/time.py:22 | 2022-10-22 15:17:26 WARNING [watchdog] "talon.scripting.speech_system.engine_event" @2.0s 38: lib/python3.9/threading.py:937 # cron thread 37: lib/python3.9/threading.py:980 36: lib/python3.9/threading.py:917 35: talon/cron.py:155| 34: talon/cron.py:106| 33: talon/vad.py:21 | 32: talon/scripting/speech_system.py:356| 31: talon/engines/w2l.py:709| 30: talon/scripting/dispatch.py:105| 29: talon/scripting/dispatch.py:144| 28: talon/scripting/dispatch.py:133| 27: talon/scripting/rctx.py:233| # 'phrase' main:_redispatch() 26: talon/scripting/speech_system.py:63 | 25: talon/scripting/dispatch.py:105| 24: talon/scripting/dispatch.py:144| 23: talon/scripting/dispatch.py:133| 22: talon/scripting/rctx.py:233| # 'phrase' main:engine_event() 21: talon/scripting/speech_system.py:410| 20: talon/scripting/actions.py:85 | # core.run_phrase() 19: talon/scripting/types.py:411| 18: talon/scripting/core/core.py:103| 17: talon/scripting/actions.py:85 | # core.run_command() 16: talon/scripting/types.py:411| 15: talon/scripting/core/core.py:132| 14: talon/scripting/actions.py:85 | # core.run_talon_script() 13: talon/scripting/types.py:411| 12: talon/scripting/core/core.py:139| 11: talon/scripting/talon_script.py:690| 10: talon/scripting/talon_script.py:589| 9: talon/scripting/talon_script.py:297| 8: talon/scripting/talon_script.py:556| 7: talon/scripting/actions.py:85 | # user.rango_command_with_target() 6: talon/scripting/types.py:411| 5: user/rango-talon/rango.py:174| send_request_and_wait_for_response(act.. 4: user/rango-talon/rango.py:134| response = read_json_response_with_tim.. 3: user/rango-talon/rango.py:110| actions.sleep(sleep_time) 2: talon/scripting/actions.py:165| 1: talon/lib/time.py:22 | 2022-10-22 15:17:27 ERROR 8: talon/scripting/talon_script.py:589| 7: talon/scripting/talon_script.py:297| 6: talon/scripting/talon_script.py:556| 5: talon/scripting/actions.py:85 | 4: talon/scripting/types.py:411| 3: user/rango-talon/rango.py:174| send_request_and_wait_for_response(act.. 2: user/rango-talon/rango.py:134| response = read_json_response_with_tim.. 1: user/rango-talon/rango.py:115| raise Exception("Timed out waiting for response") Exception: Timed out waiting for response

[The below error was raised while handling the above exception(s)] 2022-10-22 15:17:27 ERROR cb error topic="phrase" cb=<bound method SpeechSystem.engine_event of <talon.scripting.speech_system.SpeechSystem object at 0x7fd41b693630>> 30: lib/python3.9/threading.py:937 # cron thread 29: lib/python3.9/threading.py:980 28: lib/python3.9/threading.py:917* 27: talon/cron.py:155| 26: talon/cron.py:106| 25: talon/vad.py:21 | 24: talon/scripting/speech_system.py:356| 23: talon/engines/w2l.py:709| 22: talon/scripting/dispatch.py:105| 21: talon/scripting/dispatch.py:144| 20: talon/scripting/dispatch.py:133| 19: talon/scripting/rctx.py:233| # 'phrase' main:_redispatch() 18: talon/scripting/speech_system.py:63 | 17: talon/scripting/dispatch.py:105| 16: talon/scripting/dispatch.py:144| 15: talon/scripting/dispatch.py:133| 14: ------------------------------------# [stack splice] 13: talon/scripting/rctx.py:233| # 'phrase' main:engine_event() 12: talon/scripting/speech_system.py:410| 11: talon/scripting/actions.py:85 | 10: talon/scripting/types.py:411| 9: talon/scripting/core/core.py:103| 8: talon/scripting/actions.py:85 | 7: talon/scripting/types.py:411| 6: talon/scripting/core/core.py:132| 5: talon/scripting/actions.py:85 | 4: talon/scripting/types.py:411| 3: talon/scripting/core/core.py:139| 2: talon/scripting/talon_script.py:690| 1: talon/scripting/talon_script.py:593| talon.scripting.talon_script.TalonScriptError: in script at /home/boartzie/.talon/user/rango-talon/rango_direct_clicking.talon:5:

user.rango_command_with_target('directClickElement', rango_target) Exception: Timed out waiting for response

L4ma01bW13 commented 1 year ago

It's raising an exception and timing out, for example, when I say 'h' or 'click h' but not if I say 'press h'.

david-tejada commented 1 year ago

Yeah, press is a knausj command so that's to be expected. That really sounds like the command isn't going through. Are you sure you have the right shortcut set?

L4ma01bW13 commented 1 year ago

Yes it's the same as I stated in the first comment. It's possible it's a problem elsewhere. I've been running into a lot of trouble with commands in general and aegis said this when trying to select a word in sublime editor:

thread<140706551166528> | grammar.cfg_compile_and_link 0.000246s main | engine.phrase select word talon_plugins.subtitles | action speech.enabled() user/knausj_talon/apps/vscode/command_client/command_client.py | action user.emit_pre_phrase_signal() user/knausj_talon/plugin/command_history/command_history.py | action user.history_transform_phrase_text(['select', 'word']) user/knausj_talon/plugin/command_history/command_history.py | action speech.enabled() main | action core.run_phrase(C(None, select word)) core | action core.run_command(CommandImpl(Rule("select word")), C(selectword, select word)) core | action core.run_talon_script(ResourceContext("user.knausj_talon.core.edit.edit.talon"), TalonScript(code='edit.select_word()'), C(selectword, select word)) user/knausj_talon/core/edit/edit.talon | action edit.select_word() user/knausj_talon/core/edit/edit_linux.py | action edit.right() user/knausj_talon/core/edit/edit_linux.py | action key('right') user/knausj_talon/core/edit/edit_linux.py | action edit.word_left() user/knausj_talon/core/edit/edit_linux.py | action key('ctrl-left') user/knausj_talon/core/edit/edit_linux.py | action edit.extend_word_right() user/knausj_talon/core/edit/edit_linux.py | action key('ctrl-shift-right')

https://github.com/talonvoice/talon/issues/227 See the bug I linked above The bug above isn't a talon bug, it's somewhere in X or the input stack of Linux xdotool exhibits the same behavior in the case of that bug. So you might try simulating the same input to sublime using xdotool

L4ma01bW13 commented 1 year ago

Haven't looked into this yet but I might. But I would also consider a different Linux distribution if it has better compatibility with talon. Was hoping to use Linux as my daily driver but I'm also a beginner so I was using ubuntu thinking this was the best chance for me

L4ma01bW13 commented 1 year ago

The thing holding me back from looking into it right away is I'm not sure how he determined it's an error in X or the input stack of Linux. Seeing that I'm running into a lot of problems I might fix something in X or the Linux input stack but still have a lot of bugs coming elsewhere. I'm also a beginning programmer and don't want to waste a lot of time. I might take it up with aegis again

david-tejada commented 1 year ago

Let's try something and we will see if it's a talon problem or a rango problem. Copy this to the clipboard and then press control-shift-insert with Firefox focused.

{
  "version": 1,
  "type": "request",
  "action": {
    "type": "directClickElement",
    "target": [
      "x"
    ]
  }
}

If that works and the link with the "x" hint gets pressed then we know Rango is working fine.

david-tejada commented 1 year ago

Something else. At some point I think I messed up backwards compatibility so if you haven't pulled rango-talon recently that might help

L4ma01bW13 commented 1 year ago

That worked so it's not Rango but unfortunately pulling the repo didn't help. I will close this issue for now and look into what to do next. Thank you for your help

david-tejada commented 1 year ago

Sorry to hear that, I hope you solve your issues with the control key. Meanwhile, if your want to use rango you could try changing the shortcut key for something that doesn't use the control key. You will have to change the shortcut in the extension and in rango-talon.

https://github.com/david-tejada/rango-talon/blob/ea5eb223743adf2df4ca6a1dbff3609bdb254126/rango.py#L133

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values

L4ma01bW13 commented 1 year ago

Thank you that worked. At least now I know the bug is causing at least two or three problems so I will likely look into it