aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-13 17:32:28 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-13 17:32:28 -0400
commit17e2f825f4620e31e89a14d72b84a733cd98a277 (patch)
tree5d90598c433d4cb3e4e8bf4a787889549320b7fb /ext/bg
parentcb236a743081e8ea4809a8a559abf9f0f22e771c (diff)
Add warning message for Mac users about App Nap
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/css/settings.css17
-rw-r--r--ext/bg/js/settings.js6
-rw-r--r--ext/bg/settings.html8
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 @@
<a href="https://foosoft.net/projects/anki-connect/" target="_blank" rel="noopener">AnkiConnect</a> plugin.
</p>
+ <div data-show-for-operating-system="win">
+ <div class="alert alert-warning" id="anki-mac-warning">
+ Notice for Mac OS X users:
+ If Yomichan has issues connecting to AnkiConnect, you may have to tweak some system settings.
+ See <a href="https://foosoft.net/projects/anki-connect/#notes-for-mac-os-x-users" target="_blank" rel="noopener">this link</a> for more details.
+ </div>
+ </div>
+
<div class="alert alert-danger" id="anki-error"></div>
<div class="checkbox">