-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathscheme.js
64 lines (63 loc) · 1.38 KB
/
scheme.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
!(function (e) {
var t = {};
function r(n) {
if (t[n]) return t[n].exports;
var o = (t[n] = {
i: n,
l: !1,
exports: {},
});
return e[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports;
}
(r.m = e),
(r.c = t),
(r.d = function (e, t, n) {
r.o(e, t) ||
Object.defineProperty(e, t, {
configurable: !1,
enumerable: !0,
get: n,
});
}),
(r.r = function (e) {
Object.defineProperty(e, "__esModule", {
value: !0,
});
}),
(r.n = function (e) {
var t =
e && e.__esModule
? function () {
return e.default;
}
: function () {
return e;
};
return r.d(t, "a", t), t;
}),
(r.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t);
}),
(r.p = ""),
r((r.s = 833));
})({
575: function (e, t, r) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0,
});
t.SET_SCHEME = "SET_SCHEME";
},
833: function (e, t, r) {
"use strict";
var n = r(575);
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", ({ matches: e }) => {
chrome.runtime.sendMessage({
type: n.SET_SCHEME,
scheme: e ? "dark" : "light",
});
});
},
});