summaryrefslogtreecommitdiff
path: root/ext/js/pages/permissions-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-05-28 21:57:25 -0400
committerGitHub <noreply@github.com>2022-05-28 21:57:25 -0400
commit0d82c52a7624d80ec48dc774fb23db5244bc14f9 (patch)
treece8f7c24250d24c2c4d1eae6c48dfe319de46d57 /ext/js/pages/permissions-main.js
parent4e4fa49b0b1fd6ec5a018e742eb9910aa32e7637 (diff)
HTML page script refactoring (#2162)
* Move some common functionality * Move setupEnvironmentInfo into ExtensionContentController * Move background/environment.js to extension/environment.js
Diffstat (limited to 'ext/js/pages/permissions-main.js')
-rw-r--r--ext/js/pages/permissions-main.js15
1 files changed, 4 insertions, 11 deletions
diff --git a/ext/js/pages/permissions-main.js b/ext/js/pages/permissions-main.js
index 718b77ae..df4b07ee 100644
--- a/ext/js/pages/permissions-main.js
+++ b/ext/js/pages/permissions-main.js
@@ -17,6 +17,7 @@
/* global
* DocumentFocusController
+ * ExtensionContentController
* ModalController
* PermissionsOriginController
* PermissionsToggleController
@@ -66,18 +67,10 @@ function setupPermissionsToggles() {
const documentFocusController = new DocumentFocusController();
documentFocusController.prepare();
- setupPermissionsToggles();
-
- for (const node of document.querySelectorAll('.extension-id-example')) {
- node.textContent = chrome.runtime.getURL('/');
- }
+ const extensionContentController = new ExtensionContentController();
+ extensionContentController.prepare();
- 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);
- }
+ setupPermissionsToggles();
await yomichan.prepare();