aboutsummaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-02 22:46:26 -0500
committerGitHub <noreply@github.com>2021-03-02 22:46:26 -0500
commit65c20382d34e0bf7fc68ce8853f36cbe531d1c58 (patch)
tree92557700791babf060f40e9b0f0639743f3e7eb8 /ext/js
parent3fe825cf30776b754ac6992dca3c8cc100870fb2 (diff)
Add clickable web browser settings links (#1481)
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/pages/permissions-main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/js/pages/permissions-main.js b/ext/js/pages/permissions-main.js
index 66fa1d42..3cf531a6 100644
--- a/ext/js/pages/permissions-main.js
+++ b/ext/js/pages/permissions-main.js
@@ -20,6 +20,7 @@
* PermissionsToggleController
* PersistentStorageController
* SettingsController
+ * SettingsDisplayController
*/
async function setupEnvironmentInfo() {
@@ -69,6 +70,13 @@ function setupPermissionsToggles() {
node.textContent = chrome.runtime.getURL('/');
}
+ const extensionId = chrome.runtime.id;
+ const idPattern = /\{id\}/g;
+ for (const node of document.querySelectorAll('.extension-settings-link[data-special-url]')) {
+ const {specialUrl} = node.dataset;
+ node.dataset.specialUrl = `${specialUrl}`.replace(idPattern, extensionId);
+ }
+
await yomichan.prepare();
setupEnvironmentInfo();
@@ -99,6 +107,9 @@ function setupPermissionsToggles() {
await promiseTimeout(100);
document.documentElement.dataset.loaded = 'true';
+
+ const settingsDisplayController = new SettingsDisplayController(settingsController, null);
+ settingsDisplayController.prepare();
} catch (e) {
log.error(e);
}