Skip to content

Commit

Permalink
Update searchJumper.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Oct 6, 2024
1 parent a390fa9 commit 737ca07
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions searchJumper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -10429,7 +10429,12 @@
meta = e.metaKey;
shift = e.shiftKey;
if (!alt && !ctrl && !meta && !shift) {
if (openInNewTab === 2) {//隱身窗口
if (e.button == 1 || e.button == 2) {
alt = false;
ctrl = true;
meta = false;
shift = false;
} else if (openInNewTab === 2) {//隱身窗口
alt = false;
ctrl = true;
meta = false;
Expand All @@ -10444,11 +10449,6 @@
ctrl = true;
meta = false;
shift = false;
} else if (e.button == 1) {
alt = false;
ctrl = true;
meta = false;
shift = false;
}
}
if (showTips) {
Expand Down Expand Up @@ -10500,6 +10500,7 @@
}
ele.dispatchEvent(new Event("actionOver"));
if (clicked) {
if (e.preventDefault) e.preventDefault();
ele.click();
}
};
Expand Down Expand Up @@ -10800,8 +10801,14 @@
}
_url = jumpFrom;
} else {
submitByForm(data.charset, _url, ele.target || '_self');
return false;
if (ext) {
const jumpUrl = chrome.runtime.getURL('config/jump.html');
storage.setItem("postUrl", [_url + "#from{" + jumpUrl + "}", data.charset]);
_url = jumpUrl;
} else {
storage.setItem("postUrl", [_url, data.charset]);
_url = _url.replace(/(:\/\/.*?)\/[\s\S]*/, "$1").replace(/[:%]p{[\s\S]*/, '');
}
}
return _url;
};
Expand Down Expand Up @@ -10906,6 +10913,13 @@
}
}, true);

ele.addEventListener('contextmenu', e => {
if (clicked && e.preventDefault) {
e.preventDefault();
return false;
}
}, true);

let tipsStr = ele.dataset.name;
if (shortcut) {
tipsStr += ` (${data.ctrl ? "Ctrl + " : ""}${data.shift ? "Shift + " : ""}${data.alt ? "Alt + " : ""}${data.meta ? "Meta + " : ""}${shortcut.replace("Key", "")})`;
Expand Down

0 comments on commit 737ca07

Please sign in to comment.