mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +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
|
# 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:
|
Demonstrates:
|
||||||
|
|
||||||
* storing data with storage.sync
|
* 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,
|
To have Firefox read data from storage.managed, create a file with this content:
|
||||||
* 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:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "favourite-colour-examples@mozilla.org",
|
"name": "favourite-colour-examples@mozilla.org",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<meta name="color-scheme" content="dark light">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user