Skip to content

Commit 8297998

Browse files
committed
fix mouse conflict
1 parent b49bf70 commit 8297998

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

doc/description.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Mouseover Translate Any Language At Once
1919
English, Russian, Japanese, Chinese and so on
2020

2121
# Change Log
22+
- 0.1.209
23+
- fix mouse button conflict
2224
- 0.1.208
2325
- add button to exclude current website (requested by coffeechococake7)
2426
- make smooth setting tab transition

src/contentScript.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,9 @@ async function killAutoReader() {
756756
isStopAutoReaderOn = false;
757757
}
758758
function disableEdgeMiniMenu(e) {
759-
e.preventDefault();
759+
if (util.isEdge() && mouseKeyMap[e.button] == "ClickLeft") {
760+
e.preventDefault();
761+
}
760762
}
761763

762764

src/util/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ export function isCharKey(key) {
353353
}
354354

355355
export function isEdge() {
356-
return /Edg\//.test(window.navigator.userAgent);
356+
return (
357+
typeof window.StyleMedia !== "undefined" ||
358+
(typeof window.external === "object" &&
359+
typeof window.external.AddSearchProvider === "function")
360+
);
357361
}
358362

359363
export function extractTextFromHtml(html) {

0 commit comments

Comments
 (0)