Skip to content

Commit

Permalink
✨feat: The new option `Delay single tap to wait for double tap on sha…
Browse files Browse the repository at this point in the history
…dow DOMs`
  • Loading branch information
utubo committed Mar 7, 2024
1 parent 977bfcf commit c361426
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
"delaySingleTapNote": {
"message": "Wenn das einfache Antippen nicht funktioniert, versuchen Sie es mit dem dreifachen Antippen."
},
"delaySingleTapOnShadowDOM": {
"message": "Einfaches Antippen verzögern, um auf doppeltes Antippen zu warten des schatten-DOMs"
},
"displayCommand": {
"message": "Befehl anzeigen"
},
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
"delaySingleTapNote": {
"message": "If single tap does not work, try triple tap."
},
"delaySingleTapOnShadowDOM": {
"message": "Delay single tap to wait for double tap on shadow DOMs"
},
"displayCommand": {
"message": "Display Command"
},
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
"delaySingleTapNote": {
"message": "通常のタップが効かないときは、トリプルタップを試してください"
},
"delaySingleTapOnShadowDOM": {
"message": "Shadow DOM上でもダブルタップを検知するために通常のタップを遅延させる"
},
"displayCommand": {
"message": "コマンドを表示する"
},
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
"delaySingleTapNote": {
"message": "如果单击不起作用,请尝试三击"
},
"delaySingleTapOnShadowDOM": {
"message": "在Shadow DOM上延迟单击以等待双击"
},
"displayCommand": {
"message": "显示命令"
},
Expand Down
7 changes: 6 additions & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var SimpleGesture = {};
timeout: 1500,
doubleTapMsec: 200,
delaySingleTap: false,
delaySingleTapOnShadowDOM: false,
toast: true,
blacklist: [],
disableWhileZoomedIn: false
Expand Down Expand Up @@ -287,7 +288,11 @@ var SimpleGesture = {};
const waitForDoubleTap = e => {
if (!isGestureEnabled) return;
if (doubleTap.count === ACCEPT_SINGLE_TAP) return;
var tg = 'composed' in e ? e.composedPath()[0] : e.target;
var tg = e.target;
if ('composed' in e) {
if (!SimpleGesture.ini.delaySingleTapOnShadowDOM) return;
tg = e.composedPath()[0];
}
if (!tg) return;
const onlyLinkTag = !SimpleGesture.ini.delaySingleTap
if (onlyLinkTag) {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "3.12.2",
"version": "3.13",
"default_locale": "en",
"icons": {
"64": "icon64.png"
Expand Down
7 changes: 7 additions & 0 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@
</label>
<span class="with-checkbox note note-info i18n">delaySingleTapNote</span>
</div>
<div class="sub-item experimental">
<label for="delaySingleTapOnShadowDOM" class="checkbox-label">
<span class="with-checkbox sub-caption icon-flask i18n">delaySingleTapOnShadowDOM</span>
<input id="delaySingleTapOnShadowDOM" class="checkbox js-binding" type="checkbox" value="true">
<label for="delaySingleTapOnShadowDOM" class="checkbox-image"></label>
</label>
</div>
</div>
<div class="item">
<label for="toast" class="checkbox-label">
Expand Down

0 comments on commit c361426

Please sign in to comment.