Add warning message for Mac users about App Nap

This commit is contained in:
toasted-nutbread 2019-10-13 17:32:28 -04:00
parent cb236a7430
commit 17e2f825f4
3 changed files with 23 additions and 8 deletions

View File

@ -158,14 +158,21 @@ input[type=checkbox]#storage-persist-button-checkbox {
height: 320px; height: 320px;
} }
[data-show-for-browser] { [data-show-for-browser],
[data-show-for-operating-system] {
display: none; display: none;
} }
[data-browser=edge] [data-show-for-browser~=edge], html:root[data-browser=edge] [data-show-for-browser~=edge],
[data-browser=chrome] [data-show-for-browser~=chrome], html:root[data-browser=chrome] [data-show-for-browser~=chrome],
[data-browser=firefox] [data-show-for-browser~=firefox], html:root[data-browser=firefox] [data-show-for-browser~=firefox],
[data-browser=firefox-mobile] [data-show-for-browser~=firefox-mobile] { 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; display: initial;
} }

View File

@ -848,9 +848,9 @@ async function isStoragePeristent() {
async function storageInfoInitialize() { async function storageInfoInitialize() {
storagePersistInitialize(); storagePersistInitialize();
const {browser} = await apiGetEnvironmentInfo(); const {browser, platform} = await apiGetEnvironmentInfo();
const container = document.querySelector('#storage-info'); document.documentElement.dataset.browser = browser;
container.setAttribute('data-browser', browser); document.documentElement.dataset.operatingSystem = platform.os;
await storageShowInfo(); await storageShowInfo();

View File

@ -505,6 +505,14 @@
<a href="https://foosoft.net/projects/anki-connect/" target="_blank" rel="noopener">AnkiConnect</a> plugin. <a href="https://foosoft.net/projects/anki-connect/" target="_blank" rel="noopener">AnkiConnect</a> plugin.
</p> </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="alert alert-danger" id="anki-error"></div>
<div class="checkbox"> <div class="checkbox">