I like to send a shortcut for refreshing a tab to Firefox.
What I have:
- I have a Linux with working terminal, Firefox and installed xdotool
What I have found / tryed:
-
pressing F5 on keyboard refrshing the active tab on active Firefox on active workspace
-
pressing Ctrl + R on keyboard refrshing the active tab on active Firefox on active workspace too
Source: https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly?redirectslug=Keyboard+shortcuts&redirectlocale=en-US -
it should be able to send F5 or Ctrl + R by xdotool to active tab on active Firefox on active workspace
What I tryed on terminal (dont get error message, a its looks for me, like i dont realy get a reload of webpage). It can be it send the output of terminal to the terminal and not to the firefox.:
xdotool key F5
xdotool key Ctrl + R
Question:
- How to do this by terminal for active tab on active Firefox on active workspace ?
- How to do this by on workspace 2 running terminal for active tab on active Firefox on workspace 1 ?
Remark and new knowledge:
-
now I have found the follow, which are able to reload the active a tab from Firefox Browser on Debian (dont know it works on other Browser too)
-
dont know on this time it works on more than one browser on one or more workspaces and how to use this for one specific workspace, like run this on terminal or bash on workspace 2 and use it for one or more than one Firefox on workspace one.
xdotool search –onlyvisible –classname Navigator windowactivate –sync key F5
-
Now I changed the code from MarcoLucidi a little bit. Now it reload a a active tab (can be on active browser on workspace 1 ). I will test tomorrow a little bit. See the follow:
xdotool key –window "$(xdotool search –classname Navigator | head -1)" F5
2
Answers
Sample for send F5 to browser by bash, for reload the page:
Sample for send Ctrl+F5 to browser by bash, for reload cache and the page:
Remark:
The keyup fix the buggy xdotool a little bit.
Now found the bug on bug tracker:
Found the follow bug reason:
"The fact that xdotool doesn’t seem to work is probably related to applications detecting and discarding synthesized events:
Source: Automatic web-page refresh using xdotool – not sending key after window focus
Found the follow solution:
"With that in mind I was able to make it work with the series of commands below. This reloads both Chromium and Firefox.
"
Source: Automatic web-page refresh using xdotool – not sending key after window focus