Update info (#1108)

* Show language

* Show extension manifest name + version
This commit is contained in:
toasted-nutbread 2020-12-13 12:46:36 -05:00 committed by GitHub
parent 14b9e0621b
commit dabe5fa899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -30,6 +30,7 @@
<li>Extension version: <span id="version"></span></li> <li>Extension version: <span id="version"></span></li>
<li>Platform: <span id="platform"></span></li> <li>Platform: <span id="platform"></span></li>
<li>Browser: <span id="browser"></span></li> <li>Browser: <span id="browser"></span></li>
<li>Language: <span id="language"></span></li>
<li>User agent: <span id="user-agent"></span></li> <li>User agent: <span id="user-agent"></span></li>
<li>AnkiConnect version: <span id="anki-connect-version-container"><span id="anki-connect-version">...</span><em class="light" id="anki-connect-version-unknown-message" hidden> (Anki not running or connected)</em></span></li> <li>AnkiConnect version: <span id="anki-connect-version-container"><span id="anki-connect-version">...</span><em class="light" id="anki-connect-version-unknown-message" hidden> (Anki not running or connected)</em></span></li>
<li>Installed dictionaries: <span id="installed-dictionaries">...</span><em id="installed-dictionaries-none" hidden>None installed</em></li> <li>Installed dictionaries: <span id="installed-dictionaries">...</span><em id="installed-dictionaries-none" hidden>None installed</em></li>

View File

@ -50,20 +50,22 @@ function getOperatingSystemDisplayName(os) {
document.querySelector('#content-scroll-focus').focus(); document.querySelector('#content-scroll-focus').focus();
const manifest = chrome.runtime.getManifest(); const manifest = chrome.runtime.getManifest();
const language = chrome.i18n.getUILanguage();
api.forwardLogsToBackend(); api.forwardLogsToBackend();
await yomichan.prepare(); await yomichan.prepare();
const {userAgent} = navigator; const {userAgent} = navigator;
const {version} = manifest; const {name, version} = manifest;
const {browser, platform: {os}} = await api.getEnvironmentInfo(); const {browser, platform: {os}} = await api.getEnvironmentInfo();
const thisVersionLink = document.querySelector('#release-notes-this-version-link'); const thisVersionLink = document.querySelector('#release-notes-this-version-link');
thisVersionLink.href = thisVersionLink.dataset.hrefFormat.replace(/\{version\}/g, version); thisVersionLink.href = thisVersionLink.dataset.hrefFormat.replace(/\{version\}/g, version);
document.querySelector('#version').textContent = `${version}`; document.querySelector('#version').textContent = `${name} ${version}`;
document.querySelector('#browser').textContent = getBrowserDisplayName(browser); document.querySelector('#browser').textContent = getBrowserDisplayName(browser);
document.querySelector('#platform').textContent = getOperatingSystemDisplayName(os); document.querySelector('#platform').textContent = getOperatingSystemDisplayName(os);
document.querySelector('#language').textContent = `${language}`;
document.querySelector('#user-agent').textContent = userAgent; document.querySelector('#user-agent').textContent = userAgent;
(async () => { (async () => {