Firefox and gsettings

I am using a notebook in different environments, some of it allowing internet access only via proxy. For this reason I’ve created a small script which reacts to changes on the network connections (in etc/NetworkManager/dispatcher.d/) and adjusts the right settings for me. For the Web it uses gsettings set org.gnome.system.proxy gsettings set org.gnome.system.proxy autoconfig-url

(It is a bit tricky because the sript is running as root and I have to change settings for a user and there are a lot of other places where you have to adjust the proxy like apt, nextcloud, wget…)

In Firefox the proxy is set to “Use system proxy settings”.

It worked in Ubuntu 20.04 (native firefox), but does not work in 22.04 with firefox snap. Looks like a running firefox instance does not react to changes in the gsettings.

Is this expected behavior? Is there a way to inform firefox about changes in the network without restarting it?

Mathias