How to make Firefox refresh every 5 minutes


hi family, i would like a configuration so that the firefox browser automatically refreshes after 5 min someone could help me please

Learn more, read the entire thread inside the IGEL Community o Slack

Hi @member, can you provide a little more detail, about your specific use case? I don’t believe there is anything within Firefox that would allow this, nor an “out of box” check box that allows this.

Are you running Firefox in appliance mode, or any sort of kiosk?

Does it have to be 5 minutes exactly, or just roughly every 5 minutes?

Is this after 5 minutes of idle? Does 5 minutes of OS User interface suffice?

How do you launch Firefox today?


in fact I have a web application that uses online data and I would like that automatically after about 5 minutes of inactivity there is a refresh


Do you care if a refresh happens while there is somebody using it? Or is this only being used as a dashboard, and refresh can happen every 5 minutes regardless of user interacting with it?


is this only being used as a dashboard,


I’ve posted a few “auto-scroller” and “tab-switcher” style examples on here before, both that use the “custom application section, with a few lines of script, to accomplish similar behaviour.

Are you intending to only use this on one or a few IGEL units?

Are you going to launch the website manually, login, and then just expect it to refresh every 5 minutes?


this is exactly what i want i will use it on 4 thins igel

can I have it?


Hi Désire,

a lot of great ideas there, from

@member : igelcommunity.slack.com/archives/C8GP9JHQE/p1678734771446189?thread_ts=1678321082.886249&channel=C8GP9JHQE&message_ts=1678734771.446189 igelcommunity.slack.com/archives/C8GP9JHQE/p1678734771446189?thread_ts=1678321082.886249&channel=C8GP9JHQE&message_ts=1678734771.446189


Hey Désire, if you need some help with this, I can certainly post something for you.

Hey @member,

I think this one should do the job: custom-firefox-refresher-ca.

Please be sure to review and understand what it’s doing before you use it. I like to include logging, and sometimes variables, so that changes may be made outside of the script itself.

0. I’ve included animated-gif to show it in action.

It’s a “custom-application” (runs as user). It can be run from the desktop shortcut, or the “hotkey” `”Ctrl-Alt-Shift q”`. I’ve included a “progress-bar” that shows the next time it will refresh the browser. This overlay progress-bar can be turned off by setting the variable `FFRefreshProgressbar = false`. The other variables control the refresh interval, and verbose debugging messages to the syslog (journalctl).

When it no-longer finds a visible firefox window, the custom-application exits.

1. UMS: Dynamic Variable settings:

There are a few variables you can override (also provided as attached VARIABLES XML file)

System -> Firmware Customization -> Environment Variables -> Additional:

“`Variable name: FFRefreshSecs

Variable value: 300

Variable name: FFRefreshProgressbar

Variable value: true

Variable name: FFRefreshDEBUG

Variable value: false“`

2. Script with Comments:

“`# DEBUG

DEBUG=${FFRefreshDEBUG:-false}; # when true, enables verbose logging (set from env variable or default)

if [ .”${DEBUG}”. = .true. ]; then set -x; fi; # set verbose logging – lots of messages in syslog

set -u; # do not allow use of unset variables

# V0.2: With comments

VER=0.2;

# Variables

T=”custom-firefox-refresher-v${VER}-ca”; # title for logging purposes

LOGIT=”logger -it ${T}”;

REFRESH_SECS=${FFRefreshSecs:-300}; # refresh interval in seconds: get from environmental variable, or if not found set to 300 seconds

if ! [ “${REFRESH_SECS}” -ge 5 ]; then REFRESH_SECS=300; fi; # check that it’s an integer >= 5 (seconds)

# Use visible countdown progress bar, or silent: unless environmental variable is set to NON-true, then use “yad” for visible progress bar

if [ .”${FFRefreshProgressbar:-true}”. = .true. ]; then

WAIT=”yad –timeout ${REFRESH_SECS} –geometry=+0+0 –timeout-indicator=top –no-buttons –no-escape –fixed –on-top –undecorated –skip-taskbar –no-focus”;

else

WAIT=”sleep ${REFRESH_SECS}”;

fi;

# iteration counter

i=0;

# loop until firefox closed

while true; do

i=$((i+1));

if ! xdotool search –onlyvisible firefox windowfocus 2> /dev/null; then

${LOGIT} “visible firefox window not found, exiting custom app, iteration=${i}”;

exit 0; # exit if firefox not running

fi;

xdotool search –onlyvisible firefox key F5 2> /dev/null;

CODE=$?;

if [ “.${DEBUG}.” = .true. ]; then ${LOGIT} “attempted firefox refresh via F5 key: returncode=${CODE}, iteration=${i}, REFRESH_SECS=${REFRESH_SECS}”; fi;

${WAIT}; # wait for next iteration

done;“`

3. Script ready to copy-and-paste into a custom-application:

(Same as above, but comments and line-breaks removed)

Also provided as attached XML file

“`DEBUG=${FFRefreshDEBUG:-false}; if [ .”${DEBUG}”. = .true. ]; then set -x; fi; set -u; VER=0.2; T=”custom-firefox-refresher-v${VER}-ca”; LOGIT=”logger -it ${T}”; REFRESH_SECS=${FFRefreshSecs:-300}; if ! [ “${REFRESH_SECS}” -ge 5 ]; then REFRESH_SECS=300; fi; if [ .”${FFRefreshProgressbar:-true}”. = .true. ]; then WAIT=”yad –timeout ${REFRESH_SECS} –geometry=+0+0 –timeout-indicator=top –no-buttons –no-escape –fixed –on-top –undecorated –skip-taskbar –no-focus”; else WAIT=”sleep ${REFRESH_SECS}”; fi; i=0; while true; do i=$((i+1)); if ! xdotool search –onlyvisible firefox windowfocus 2> /dev/null; then ${LOGIT} “visible firefox window not found, exiting custom app, iteration=${i}”; exit 0; fi; xdotool search –onlyvisible firefox key F5 2> /dev/null; CODE=$?; if [ “.${DEBUG}.” = .true. ]; then ${LOGIT} “attempted firefox refresh via F5 key: returncode=${CODE}, iteration=${i}, REFRESH_SECS=${REFRESH_SECS}”; fi; ${WAIT}; done;“`

Hope it works well, please let me know if you have some questions or comments! :)

Hey @member,

I think this one should do the job: custom-firefox-refresher-ca.

Please be sure to review and understand what it’s doing before you use it. I like to include logging, and sometimes variables, so that changes may be made outside of the script itself.

0. I’ve included animated-gif to show it in action.

It’s a “custom-application” (runs as user). It can be run from the desktop shortcut, or the “hotkey” `”Ctrl-Alt-Shift q”`. I’ve included a “progress-bar” that shows the next time it will refresh the browser. This overlay progress-bar can be turned off by setting the variable `FFRefreshProgressbar = false`. The other variables control the refresh interval, and verbose debugging messages to the syslog (journalctl).

When it no-longer finds a visible firefox window, the custom-application exits.

1. UMS: Dynamic Variable settings:

There are a few variables you can override (also provided as attached VARIABLES XML file)

System -> Firmware Customization -> Environment Variables -> Additional:

“`Variable name: FFRefreshSecs

Variable value: 300

Variable name: FFRefreshProgressbar

Variable value: true

Variable name: FFRefreshDEBUG

Variable value: false“`

2. Script with Comments:

“`# DEBUG

DEBUG=${FFRefreshDEBUG:-false}; # when true, enables verbose logging (set from env variable or default)

if [ .”${DEBUG}”. = .true. ]; then set -x; fi; # set verbose logging – lots of messages in syslog

set -u; # do not allow use of unset variables

# V0.2: With comments

VER=0.2;

# Variables

T=”custom-firefox-refresher-v${VER}-ca”; # title for logging purposes

LOGIT=”logger -it ${T}”;

REFRESH_SECS=${FFRefreshSecs:-300}; # refresh interval in seconds: get from environmental variable, or if not found set to 300 seconds

if ! [ “${REFRESH_SECS}” -ge 5 ]; then REFRESH_SECS=300; fi; # check that it’s an integer >= 5 (seconds)

# Use visible countdown progress bar, or silent: unless environmental variable is set to NON-true, then use “yad” for visible progress bar

if [ .”${FFRefreshProgressbar:-true}”. = .true. ]; then

WAIT=”yad –timeout ${REFRESH_SECS} –geometry=+0+0 –timeout-indicator=top –no-buttons –no-escape –fixed –on-top –undecorated –skip-taskbar –no-focus”;

else

WAIT=”sleep ${REFRESH_SECS}”;

fi;

# iteration counter

i=0;

# loop until firefox closed

while true; do

i=$((i+1));

if ! xdotool search –onlyvisible firefox windowfocus 2> /dev/null; then

${LOGIT} “visible firefox window not found, exiting custom app, iteration=${i}”;

exit 0; # exit if firefox not running

fi;

xdotool search –onlyvisible firefox key F5 2> /dev/null;

CODE=$?;

if [ “.${DEBUG}.” = .true. ]; then ${LOGIT} “attempted firefox refresh via F5 key: returncode=${CODE}, iteration=${i}, REFRESH_SECS=${REFRESH_SECS}”; fi;

${WAIT}; # wait for next iteration

done;“`

3. Script ready to copy-and-paste into a custom-application:

(Same as above, but comments and line-breaks removed)

Also provided as attached XML file

“`DEBUG=${FFRefreshDEBUG:-false}; if [ .”${DEBUG}”. = .true. ]; then set -x; fi; set -u; VER=0.2; T=”custom-firefox-refresher-v${VER}-ca”; LOGIT=”logger -it ${T}”; REFRESH_SECS=${FFRefreshSecs:-300}; if ! [ “${REFRESH_SECS}” -ge 5 ]; then REFRESH_SECS=300; fi; if [ .”${FFRefreshProgressbar:-true}”. = .true. ]; then WAIT=”yad –timeout ${REFRESH_SECS} –geometry=+0+0 –timeout-indicator=top –no-buttons –no-escape –fixed –on-top –undecorated –skip-taskbar –no-focus”; else WAIT=”sleep ${REFRESH_SECS}”; fi; i=0; while true; do i=$((i+1)); if ! xdotool search –onlyvisible firefox windowfocus 2> /dev/null; then ${LOGIT} “visible firefox window not found, exiting custom app, iteration=${i}”; exit 0; fi; xdotool search –onlyvisible firefox key F5 2> /dev/null; CODE=$?; if [ “.${DEBUG}.” = .true. ]; then ${LOGIT} “attempted firefox refresh via F5 key: returncode=${CODE}, iteration=${i}, REFRESH_SECS=${REFRESH_SECS}”; fi; ${WAIT}; done;“`

Hope it works well, please let me know if you have some questions or comments! :)


Hi @member !! As always: THANK YOU so much!!!

If you don‘t interfere, I would like to create a Blogpost out of it 😇


@member You are welcome! No problem! 😁

Continue reading and comment on the thread ‘How to make Firefox refresh every 5 minutes’.  Not a member? Join Here!

Learn more, search the IGEL Knowledge Base



Ask a question or comment on the above message thread?

Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.

Submit a question, or Join Today!


Popular Message Threads


Categories & Tags: