How are network proxy configuration saved

In macOS we previously were using our agent to remove the the network proxy configurations set in the Firefox browser, and we replace them with our own. This was accomplished by directly changing the mozilla.cfg file and setting our own javascript in the /Applications/FireFox.app/Contents/Resources/default/pref.

That is no longer valid and we have noticed that a new prefs.js is introduced where the same configuration are set, but when directly editing that file, the same result cannot be achieved, opening the browser again automatically reverses the changes done.

Is there any new way that mozilla recommends where we can achieve the same result.