Skip to content

Commit

Permalink
Add UI to grant contextual identities permission #53
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Feb 24, 2024
1 parent c55c092 commit ad8e314
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"config_examples_link_href": { "message": "https://github.com/piroor/copy-selected-tabs-to-clipboard/blob/trunk/README.md#example-copy-formats" },
"config_examples_after": { "message": " for more cases." },

"config_contextualIdentitiesPermissionGranted_label": { "message": "Allow to refer containers information" },
"config_allUrlsPermissionGranted_label": { "message": "Allow to collect data from page contents / Allow to copy data as rich text format" },

"config_showContextCommandOnTab_label": { "message": "Show context menu item in the context menu on tabs" },
Expand Down
1 change: 1 addition & 0 deletions _locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"config_examples_link_href": { "message": "https://github.com/piroor/copy-selected-tabs-to-clipboard/blob/trunk/README.md#example-copy-formats" },
"config_examples_after": { "message": "を参照して下さい。" },

"config_contextualIdentitiesPermissionGranted_label": { "message": "コンテナーの情報を参照することを許可する" },
"config_allUrlsPermissionGranted_label": { "message": "ページの内容からデータを取得することを許可する / データをリッチテキスト形式でコピーすることを許可する" },

"config_showContextCommandOnTab_label": { "message": "タブのコンテキストメニューにメニュー項目を表示する" },
Expand Down
1 change: 1 addition & 0 deletions common/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from './common.js';

export const ALL_URLS = { origins: ['<all_urls>'] };
export const CONTEXTUAL_IDENTITIES = { permissions: ['contextualIdentities'] };

export function clearRequest() {
configs.requestingPermissions = null;
Expand Down
4 changes: 4 additions & 0 deletions options/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ window.addEventListener('DOMContentLoaded', async () => {
(_event) => { restoreDefaultFormats(); }
);

Permissions.bindToCheckbox(
Permissions.CONTEXTUAL_IDENTITIES,
document.querySelector('#contextualIdentitiesPermissionGranted')
);
Permissions.bindToCheckbox(
Permissions.ALL_URLS,
document.querySelector('#allUrlsPermissionGranted')
Expand Down
4 changes: 4 additions & 0 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_accesskey__</p>
<p class="syntax-description copyable">__MSG_config_examples_before__<a href="__MSG_config_examples_link_href__">__MSG_config_examples_link__</a>__MSG_config_examples_after__</p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_placeholders__</p>
<p class="sub"
><label id="contextualIdentitiesPermissionCheck"><input id="contextualIdentitiesPermissionGranted"
type="checkbox">
__MSG_config_contextualIdentitiesPermissionGranted_label__</label></p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_placeholders_special__</p>
<p class="sub"
><label id="allUrlsPermissionCheck"><input id="allUrlsPermissionGranted"
Expand Down

0 comments on commit ad8e314

Please sign in to comment.