The behavior is a consequence of the `storage.managed_schema` support. In Chrome, `managed_schema` describes the supported keys, with fallbacks if any. When the enterprise policy is not set, the keys specified in the schema JSON file (referenced by `storage.managed_schema` in manifest.json) are used, including their default value if any. In Firefox, `managed_schema` is not supported. The managed storage values are directly taken from the enterprise policy. If it does not exists, an error is raised. Even if we could silence the errors, extension developers should still be prepared to not have identical behavior between the browsers, until `managed_schema` is supported (bug 1771731). --- P.S. The catch vs no-catch in the report is not meaningful. When a promise rejects, the `.catch(() => {})` part is executed. The `{}` after the arrow function does not denote an object, but the delimiters of the arrow function's body. The following lines are equivalent: ``` console.log(await chrome.storage.managed.get().catch(() => {})); console.log(await chrome.storage.managed.get().catch(function () {})); console.log(await chrome.storage.managed.get().catch(function () { return undefined; })); ```
Bug 1868153 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The behavior is a consequence of the `storage.managed_schema` support. In Chrome, `managed_schema` describes the supported keys, with fallbacks if any. When the enterprise policy is not set, the keys specified in the schema JSON file (referenced by `storage.managed_schema` in manifest.json) are used, ~including their default value if any~ (EDIT: no default support, and keys are not included). In Firefox, `managed_schema` is not supported. The managed storage values are directly taken from the enterprise policy. If it does not exists, an error is raised. Even if we could silence the errors, extension developers should still be prepared to not have identical behavior between the browsers, until `managed_schema` is supported (bug 1771731). --- P.S. The catch vs no-catch in the report is not meaningful. When a promise rejects, the `.catch(() => {})` part is executed. The `{}` after the arrow function does not denote an object, but the delimiters of the arrow function's body. The following lines are equivalent: ``` console.log(await chrome.storage.managed.get().catch(() => {})); console.log(await chrome.storage.managed.get().catch(function () {})); console.log(await chrome.storage.managed.get().catch(function () { return undefined; })); ```