搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

How to modify the 'permissions.default.image' preference based on website host in Firefox for Android?

  • 4 回覆
  • 0 有這個問題
  • 36 次檢視
  • 最近回覆由 Paul

more options

I am currently trying to customize the Firefox browser for Android and have encountered a hurdle. Specifically, I want to change the 'permissions.default.image' setting according to the host of the website being visited.

I have searched through the source code, but I'm unable to locate where this preference is being modified, which is adding to my difficulties. I'm uncertain about the next steps to take.

Could anyone please guide me on how to implement this functionality, or direct me towards relevant resources or documentation that could help me? Any leads or suggestions would be greatly appreciated.

Thank you in advance for your assistance.

Best regards

I've already attempted to implement this in the GeckoEngineSession in the override fun onLoadRequest method, as that's where the host is loaded. Unfortunately, I haven't had any success with this approach.

I am currently trying to customize the Firefox browser for Android and have encountered a hurdle. Specifically, I want to change the 'permissions.default.image' setting according to the host of the website being visited. I have searched through the source code, but I'm unable to locate where this preference is being modified, which is adding to my difficulties. I'm uncertain about the next steps to take. Could anyone please guide me on how to implement this functionality, or direct me towards relevant resources or documentation that could help me? Any leads or suggestions would be greatly appreciated. Thank you in advance for your assistance. Best regards I've already attempted to implement this in the GeckoEngineSession in the override fun onLoadRequest method, as that's where the host is loaded. Unfortunately, I haven't had any success with this approach.

所有回覆 (4)

more options

it's really very strange, it's like this permission did not exist in the source code. I can't find anything about:config values anywhere. https://github.com/search?q=repo%3Amozilla-mobile%2Ffirefox-android%20permissions.default.image&type=code

more options

Hi

Some of the preferences are set in the GeckoView engine. The docs at https://mozilla.github.io/geckoview/ may be of use in looking into this further.

more options

Hello, thank you for your answer, indeed the permission appears in the geckoview engine https://searchfox.org/mozilla-central/search?q=permissions.default.image&path=&case=false&regexp=false but I still can't change the value of permissions.default.image from geckoEngineSession.kt . Do you know if it's possible?

more options

Hi

This is something that you would be better raising with our developers. I recommend that you join our Matrix instance at https://chat.mozilla.org and head to the "Fenix" room.