mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
Automatic theme switching support in favorite colours (#567)
* Automatic theme switching support in favorite colours * Ref to dark theme Co-authored-by: Rob Wu <rob@robwu.nl> --------- Co-authored-by: Rob Wu <rob@robwu.nl>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
# Favourite Colour
|
||||
|
||||
Shows and stores your favourite colour, in storage.sync in the about:addons page for the add-on.
|
||||
Shows and stores your favourite colour, in storage.sync in the extension's about:addons page.
|
||||
|
||||
Demonstrates:
|
||||
|
||||
* storing data with storage.sync
|
||||
* reading data from storage.managed
|
||||
* creating an options page and opening it with `runtime.openOptionsPage()`
|
||||
* best practice for supporting automatic theme switching (dark theme) in the options page
|
||||
|
||||
* reading data from storage.managed,
|
||||
* creating an options page and opening it with `runtime.openOptionsPage()`.
|
||||
|
||||
To have Firefox read data from storage.managed, create a file with the following contents:
|
||||
To have Firefox read data from storage.managed, create a file with this content:
|
||||
|
||||
{
|
||||
"name": "favourite-colour-examples@mozilla.org",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="color-scheme" content="dark light">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user