Closed Bug 1339131 Opened 8 years ago Closed 8 years ago

Don't error out on unknown properties in the theme object

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: krupa--use, Assigned: mattw)

References

Details

(Whiteboard: [themes, triaged])

Attachments

(1 file)

Looks like "background_tab" and "background_tab_inactive" properties are not in the schema ( https://dxr.mozilla.org/mozilla-central/source/browser/components/extensions/schemas/theme.json) because of which Firefox throws an error if they are listed in the manifest.json We should not error out on unknown properties in the theme object.
I think bug 1244474 should already cover things here! This also fits in nicely with us not needing to implement stubs for unsupported Google Chrome theme properties. Nice!
Blocks: themingapi-framework
No longer blocks: themingapi
Whiteboard: [themes, triaged]
This is still broken. I added a "background_tab_jared" colors property and got the following error in about:debugging, Log.jsm:748 1488905516732 addons.webextension.<unknown> ERROR Loading extension 'null': Reading manifest: Error processing theme.colors: Unexpected property "background_tab_jared" controls.js:63:11 Error: Extension is invalid Stack trace: loadManifestFromWebManifest<@resource://gre/modules/addons/XPIProvider.jsm:975:11 TaskImpl_run@resource://gre/modules/Task.jsm:319:42 process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:922:23 walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:806:7 scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:742:11 This is the error I get when loading it in about:addons: Log.jsm:748 1488905679777 addons.webextension.<unknown> ERROR Loading extension 'null': Reading manifest: Error processing theme.colors: Unexpected property "background_tab_jared"
I believe we just need to add an `additionalProperties` section which references `UnrecognizedProperty` to each of the theme sections to fix this: http://searchfox.org/mozilla-central/source/browser/components/extensions/schemas/browser_action.json#14. I think a manifest test would be good to add also to make sure this works.
Comment on attachment 8844571 [details] Bug 1339131 - Provide warnings instead of throwing errors for unrecognized properties https://reviewboard.mozilla.org/r/117954/#review119700 Awesome, thanks!
Attachment #8844571 - Flags: review?(jaws) → review+
Comment on attachment 8844571 [details] Bug 1339131 - Provide warnings instead of throwing errors for unrecognized properties https://reviewboard.mozilla.org/r/117954/#review120034 BOOM! Nice one.
Attachment #8844571 - Flags: review?(mdeboer) → review+
Pushed by jwein@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb9bf4230afe Provide warnings instead of throwing errors for unrecognized properties r=jaws,mikedeboer
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: