Closed Bug 1330337 Opened 3 years ago Closed 3 years ago

Theming API - implement WebExtension framework

Categories

(WebExtensions :: Frontend, defect)

defect
Not set

Tracking

(firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: mikedeboer, Assigned: mattw)

References

(Blocks 1 open bug)

Details

(Whiteboard: user-story)

User Story

As a user I’d like to create a WebExtension that contains a manifest file which lists a set of properties and adheres to a schema definition and can be interpreted by the browser.
Example:
```json
{
  "manifest_version": 2,
  "version": "0.1",
  "name": "Crazy theme",
  "theme": {
    "colors": {
      "background_tab": [255, 255, 255, 0.6],
      "background_tab_inactive": [255, 255, 255, 0.2],
    },
    "images": {
      "theme_frame": "sample.jpeg"
    },
    "properties": {
      "square_tabs": true
    }
  }
}
```

Attachments

(1 file)

No description provided.
Summary: Theming API - Implement framework → Theming API - create a WebExtension schema
Assignee: nobody → mwein
Summary: Theming API - create a WebExtension schema → Theming API - implement WebExtension framework
Comment on attachment 8825916 [details]
Bug 1330337 - Add basic theme framework hidden behind pref

https://reviewboard.mozilla.org/r/103982/#review104888

Looks good to me, but can you also add a test for this? (for example, test flipping the pref)
Attachment #8825916 - Flags: review?(mdeboer) → review-
Comment on attachment 8825916 [details]
Bug 1330337 - Add basic theme framework hidden behind pref

https://reviewboard.mozilla.org/r/103982/#review105236

::: browser/components/extensions/test/browser/browser_ext_themes.js:14
(Diff revision 2)
> +  });
> +
> +  SimpleTest.waitForExplicitFinish();
> +  let waitForConsole = new Promise(resolve => {
> +    SimpleTest.monitorConsole(resolve, [{
> +      message: /Themes are not enabled/,

Neat! I am curious: Why didn't you use `extension.emit("test-theme-enabled")` instead? If it works, please use that so we can keep it indefinitely. I don't want to spam our browser console with theming API messages indefinitely.
Attachment #8825916 - Flags: review?(mdeboer) → review+
> Neat! I am curious: Why didn't you use
> `extension.emit("test-theme-enabled")` instead? If it works, please use that
> so we can keep it indefinitely. I don't want to spam our browser console
> with theming API messages indefinitely.

I tried this and it didn't work so I thought we didn't support it, but I just found out we have a way to send messages to tests using the event name "test-message". The second argument is then the event name you listen for. I'll update the patch to use this before adding checkin-needed :)
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3b0cc40ebbbf
Add basic theme framework hidden behind pref r=mikedeboer
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3b0cc40ebbbf
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Is manual testing necessary here? If yes, could you please provide some reliable steps and expected results in order to verify this bug?

I tried to load an extension that contains a manifest.json as it is described in User Story but I was unable to install it because of the following errors: http://pastebin.com/Lp4hGems

Am I missing something? Maybe some prefs?
Flags: needinfo?(mwein)
Since no support for any of the global properties - colors, images, etc - was added in this bug, I don't think it's necessary for us to have any manual testing. I think it will be very helpful in later bugs though!
Flags: needinfo?(mwein)
(In reply to Matthew Wein [:mattw] from comment #10)
> Since no support for any of the global properties - colors, images, etc -
> was added in this bug, I don't think it's necessary for us to have any
> manual testing. I think it will be very helpful in later bugs though!

Thanks Matthew for your reply. In this case I am making this bug as qe-verify -
For those bugs which you consider that need our attention, please assign me a needinfo (or as qa contact) and we will gladly test them.
Flags: qe-verify-
Thanks Vasilica, will do :)
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.