aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/permissions.html
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-08 17:52:41 -0500
committerGitHub <noreply@github.com>2021-02-08 17:52:41 -0500
commit849e4fabe1dffc2851fcb338dae8400d6c8e46ca (patch)
treee49dbd86ec20a2a11fc8938b8f6a4e1a9c57501e /ext/bg/permissions.html
parent008809e0e73665249b7b3dd7c14a1761aa06bd39 (diff)
Native messaging optional permission (#1348)
* Refactor PermissionsToggleController to not require a setting * Update nativeMessaging to be optional on Chrome * Update parsing.enableMecabParser setting to request permissions * Update permissions page to use PermissionsToggleController * Update permissions documentation * Disable toggle for permissions which are not optional
Diffstat (limited to 'ext/bg/permissions.html')
-rw-r--r--ext/bg/permissions.html31
1 files changed, 19 insertions, 12 deletions
diff --git a/ext/bg/permissions.html b/ext/bg/permissions.html
index 57b4b215..45c65a65 100644
--- a/ext/bg/permissions.html
+++ b/ext/bg/permissions.html
@@ -86,17 +86,6 @@
</div></div>
<div class="settings-item"><div class="settings-item-inner">
<div class="settings-item-left">
- <div class="settings-item-label"><code>nativeMessaging</code></div>
- <div class="settings-item-description">
- Yomichan has the ability to communicate with an optional native messaging component in order to support
- parsing large blocks of Japanese text using
- <a href="https://en.wikipedia.org/wiki/MeCab" target="_blank" rel="noopener noreferrer">MeCab</a>.
- The installation of this component is optional and is not included by default.
- </div>
- </div>
- </div></div>
- <div class="settings-item"><div class="settings-item-inner">
- <div class="settings-item-left">
<div class="settings-item-label"><code>clipboardWrite</code></div>
<div class="settings-item-description">
Yomichan supports simulating the <code>Ctrl+C</code> (copy to clipboard) keyboard shortcut
@@ -115,7 +104,21 @@
</div>
</div>
<div class="settings-item-right">
- <label class="toggle"><input type="checkbox" id="permission-checkbox-clipboard-read"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
+ <label class="toggle"><input type="checkbox" class="permissions-toggle" data-required-permissions="clipboardRead"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
+ </div>
+ </div></div>
+ <div class="settings-item"><div class="settings-item-inner">
+ <div class="settings-item-left">
+ <div class="settings-item-label"><code>nativeMessaging</code> <span class="light" data-show-for-browser="chrome edge">(optional)</span></div>
+ <div class="settings-item-description">
+ Yomichan has the ability to communicate with an optional native messaging component in order to support
+ parsing large blocks of Japanese text using
+ <a href="https://en.wikipedia.org/wiki/MeCab" target="_blank" rel="noopener noreferrer">MeCab</a>.
+ The installation of this component is optional and is not included by default.
+ </div>
+ </div>
+ <div class="settings-item-right">
+ <label class="toggle"><input type="checkbox" class="permissions-toggle" data-required-permissions="nativeMessaging"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
</div>
</div></div>
<div class="settings-item"><div class="settings-item-inner">
@@ -164,6 +167,10 @@
<script src="/mixed/js/api.js"></script>
<script src="/mixed/js/document-focus-controller.js"></script>
+<script src="/mixed/js/html-template-collection.js"></script>
+
+<script src="/bg/js/settings/permissions-toggle-controller.js"></script>
+<script src="/bg/js/settings/settings-controller.js"></script>
<script src="/bg/js/permissions-main.js"></script>