Changeset View
Changeset View
Standalone View
Standalone View
extension/content-script.js
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
60 | 60 | | |||
61 | SettingsUtils.get().then((items) => { | 61 | SettingsUtils.get().then((items) => { | ||
62 | if (items.breezeScrollBars.enabled) { | 62 | if (items.breezeScrollBars.enabled) { | ||
63 | loadBreezeScrollBars(); | 63 | loadBreezeScrollBars(); | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | const mpris = items.mpris; | 66 | const mpris = items.mpris; | ||
67 | if (mpris.enabled) { | 67 | if (mpris.enabled) { | ||
68 | const origin = window.location.origin; | ||||
69 | | ||||
70 | const websiteSettings = mpris.websiteSettings || {}; | ||||
fvogt: Use `mpris.` instead of `items.mpris` | |||||
71 | | ||||
72 | let mprisAllowed = true; | ||||
73 | if (typeof MPRIS_WEBSITE_SETTINGS[origin] === "boolean") { | ||||
74 | mprisAllowed = MPRIS_WEBSITE_SETTINGS[origin]; | ||||
75 | } | ||||
76 | if (typeof websiteSettings[origin] === "boolean") { | ||||
77 | mprisAllowed = websiteSettings[origin]; | ||||
78 | } | ||||
79 | | ||||
80 | if (mprisAllowed) { | ||||
68 | loadMpris(); | 81 | loadMpris(); | ||
69 | if (items.mprisMediaSessions.enabled) { | 82 | if (items.mprisMediaSessions.enabled) { | ||
70 | loadMediaSessionsShim(); | 83 | loadMediaSessionsShim(); | ||
71 | } | 84 | } | ||
Is this guaranteed to be identical to new URL(window.location.href).hostname as used in utils? fvogt: Is this guaranteed to be identical to `new URL(window.location.href).hostname` as used in utils? | |||||
broulik: Good question, no idea, probably. :) | |||||
72 | } | 85 | } | ||
86 | } | ||||
73 | 87 | | |||
74 | if (items.purpose.enabled) { | 88 | if (items.purpose.enabled) { | ||
75 | sendMessage("settings", "getSubsystemStatus").then((status) => { | 89 | sendMessage("settings", "getSubsystemStatus").then((status) => { | ||
76 | if (status && status.purpose) { | 90 | if (status && status.purpose) { | ||
77 | loadPurpose(); | 91 | loadPurpose(); | ||
78 | } | 92 | } | ||
79 | }); | 93 | }); | ||
80 | } | 94 | } | ||
▲ Show 20 Lines • Show All 885 Lines • Show Last 20 Lines |
Use mpris. instead of items.mpris