Closed Bug 1367453 Opened 2 years ago Closed 2 years ago

browserSetting.remove should not throw an exception if the setting was not previously set

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

References

Details

(Whiteboard: [browserSetting] triaged)

Attachments

(1 file)

Currently, if an extension tries to clear a browserSetting (e.g., privacy.network.webRTCIPHandlingPolicy) that it has not previously set, an exception is thrown. We should not be throwing an exception in that case.

This was uncovered through Luca's testing of uBlock-origin on Android, but the bug exists on both desktop and Android and requires a fix to ExtensionSettingsStore.jsm in the alterSetting method [1].

[1] http://searchfox.org/mozilla-central/source/toolkit/components/extensions/ExtensionSettingsStore.jsm#129
Comment on attachment 8870891 [details]
Bug 1367453 - Do not throw an exception from ExtensionSettingsStore when trying to remove a setting that was not previously set,

https://reviewboard.mozilla.org/r/142460/#review146158
Attachment #8870891 - Flags: review?(mixedpuppy) → review+
Pushed by bsilverberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bff7c4b4d2d9
Do not throw an exception from ExtensionSettingsStore when trying to remove a setting that was not previously set, r=mixedpuppy
https://hg.mozilla.org/mozilla-central/rev/bff7c4b4d2d9
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.