Improve Engine and EngineSession settings API
Categories
(Firefox for Android :: Browser Engine, task, P5)
Tracking
()
People
(Reporter: csadilek, Unassigned)
Details
From github: https://github.com/mozilla-mobile/android-components/issues/7262.
Integrating the engine component into Focus I ran into some issues with the settings API and feel like we may be able to improve some things in that area.
I think what's unclear at times is where I have to apply a setting. Do I need to change the setting on
Engine.settingsor onEngineSettingsor on theDefaultSettingsthat I pass to theEngine. The latter surprised me the most.As an example I was trying to apply the tracking protection settings whenever the user changed something. I noticed that I could use
UpdateTrackingProtectionUseCasefor that. Internally I saw that it would apply it to the engine and every session. However it still didn't work for new sessions. After a while I noticed that the default settings I pass in andEngine.settingsare actually two distinct things. One of them applies things on the runtime, the other one is used for settings passed to a GeckoSession whenever we create one. Only after additionally keeping a reference to theDefaultSettingsand also changing them I could see the new settings being reflected on a new tab.However I am still not sure what
engine.settings.trackingProtectionPolicyis actually good for (it does set something on the runtime) since we set it on every session too. Then there's alsoEngineSession.settings.trackingProtectionPolicy, but alsoEngineSession.enableTrackingProtection(policy)- which seems redundant?I think what may have helped here is having separate types for settings of an engine vs. settings of an engine session (
EngineSettings,EngineSessionSettings?). This would make it more obvious whether things I pass intoEngineare for the engine itself, or are the defaults for new engine sessions. 🤔In Focus I want to continue with hooking up the "on/off" switch in the UI to enable/disabled tracking protection for the current tab and to be honest I have no clue where to do that. I assume not on the engine? Only on the session? But does this work with all the runtime settings applied too?
┆Issue is synchronized with this Jira Task
Change performed by the Move to Bugzilla add-on.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•