From 17e2f825f4620e31e89a14d72b84a733cd98a277 Mon Sep 17 00:00:00 2001
From: toasted-nutbread
Date: Sun, 13 Oct 2019 17:32:28 -0400
Subject: Add warning message for Mac users about App Nap
---
ext/bg/css/settings.css | 17 ++++++++++++-----
ext/bg/js/settings.js | 6 +++---
ext/bg/settings.html | 8 ++++++++
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/ext/bg/css/settings.css b/ext/bg/css/settings.css
index 21cbe256..f204681b 100644
--- a/ext/bg/css/settings.css
+++ b/ext/bg/css/settings.css
@@ -158,14 +158,21 @@ input[type=checkbox]#storage-persist-button-checkbox {
height: 320px;
}
-[data-show-for-browser] {
+[data-show-for-browser],
+[data-show-for-operating-system] {
display: none;
}
-[data-browser=edge] [data-show-for-browser~=edge],
-[data-browser=chrome] [data-show-for-browser~=chrome],
-[data-browser=firefox] [data-show-for-browser~=firefox],
-[data-browser=firefox-mobile] [data-show-for-browser~=firefox-mobile] {
+html:root[data-browser=edge] [data-show-for-browser~=edge],
+html:root[data-browser=chrome] [data-show-for-browser~=chrome],
+html:root[data-browser=firefox] [data-show-for-browser~=firefox],
+html:root[data-browser=firefox-mobile] [data-show-for-browser~=firefox-mobile],
+html:root[data-operating-system=mac] [data-show-for-operating-system~=mac],
+html:root[data-operating-system=win] [data-show-for-operating-system~=win],
+html:root[data-operating-system=android] [data-show-for-operating-system~=android],
+html:root[data-operating-system=cros] [data-show-for-operating-system~=cros],
+html:root[data-operating-system=linux] [data-show-for-operating-system~=linux],
+html:root[data-operating-system=openbsd] [data-show-for-operating-system~=openbsd] {
display: initial;
}
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index ba02641b..dc8c2690 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -848,9 +848,9 @@ async function isStoragePeristent() {
async function storageInfoInitialize() {
storagePersistInitialize();
- const {browser} = await apiGetEnvironmentInfo();
- const container = document.querySelector('#storage-info');
- container.setAttribute('data-browser', browser);
+ const {browser, platform} = await apiGetEnvironmentInfo();
+ document.documentElement.dataset.browser = browser;
+ document.documentElement.dataset.operatingSystem = platform.os;
await storageShowInfo();
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 15425b44..d12670e5 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -505,6 +505,14 @@
AnkiConnect plugin.
+
+
+ Notice for Mac OS X users:
+ If Yomichan has issues connecting to AnkiConnect, you may have to tweak some system settings.
+ See
this link for more details.
+
+
+
--
cgit v1.2.3