Advice re data collection notifications pre-built-in experience#2244
Advice re data collection notifications pre-built-in experience#2244rebloor wants to merge 2 commits intomozilla:masterfrom
Conversation
|
|
||
| ## Supporting older Firefox versions | ||
|
|
||
| If your extension is available for Firefox for desktop 139 and earlier or Firefox for Android 141 and earlier, consider: |
There was a problem hiding this comment.
Does the word consider tell that you have to do either of the two? Do we need to make that more explicit?
There was a problem hiding this comment.
@wagnerand-moz, my understanding is that developers are not obliged to do either, is that incorrect?
There was a problem hiding this comment.
They are obliged. Having a data collection consent experience is mandatory if you are collecting data. Since there is no built-in one in the older versions of Firefox, developers have to provide a custom-built one. The policies haven't changed in that regard, the built-in consent only provides a much easier mechanism to meet the requirements, but it is only available in newer versions.
There was a problem hiding this comment.
@wagnerand-moz updated the advice. Also added the option of using strict_min_version.
| - turn off the data collection for old Firefox versions, as it's likely most users are on newer versions of Firefox. | ||
| - implement a custom data collection experience and display it when installing on an old version of Firefox. Your extension can determine the platform and Firefox version it's installed on by checking `os` from [runtime.getPlatformInfo()](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getPlatformInfo) and `version` from [runtime.getBrowserInfo()](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getBrowserInfo) in a [runtime.onInstalled](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled) listener, like this: | ||
|
|
||
| ```js |
There was a problem hiding this comment.
@rpl could you or someone in your team take a look at this code snippet?
…w built-in feature
|
|
||
| } | ||
|
|
||
| browser.runtime.onInstalled.addListener(handleInstalled) |
There was a problem hiding this comment.
For data collection, feature detection shouldn't be based on the Fx version. The browser.permissions.getAll() return value will contain data_collection if data collection is both supported and enabled.
There is an example to determine whether to show a custom consent page: https://github.com/willdurand/example-extensions/blob/061f0e4ccb70fe3884f2468a929a14a1d446e30f/data-collection-with-fallback/background.js#L24-L30
It's actually documented on EW already: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/#acessing-data-permissions-programmatically
There was a problem hiding this comment.
@willdurand thanks for pointing that out, I'm updating the copy.
This change adds advice for developers who implement the Firefox built-in data collection experience in extensions that also run in versions of the browser without the built-in experience.