Skip to content

Commit 02eb539

Browse files
committed
Update searchJumper.user.js
1 parent 6f58024 commit 02eb539

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

SearchJumper/searchJumper.user.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 搜尋醬
55
// @name:ja 検索ちゃん - SearchJumper
66
// @namespace hoothin
7-
// @version 1.6.30.4
7+
// @version 1.6.30.5
88
// @description Assistant that assists with the seamless transition between search engines, providing the ability to swiftly navigate to any platform and conduct searches effortlessly. Additionally, it allows for the selection of text, images, or links to be searched on any search engine with a simple right-click or by utilizing a range of menus and shortcuts.
99
// @description:zh-CN 高效搜索辅助,在搜索时一键切换搜索引擎,支持划词右键搜索、页内关键词查找与高亮、可视化操作模拟、高级自定义等
1010
// @description:zh-TW 高效搜尋輔助,在搜尋時一鍵切換搜尋引擎,支援劃詞右鍵搜尋、頁內關鍵詞查找與高亮、可視化操作模擬、高級自定義等
@@ -7814,19 +7814,26 @@
78147814
if (e.stopPropagation) e.stopPropagation();
78157815
if (targetUrlData === false) return false;
78167816
let postHandler = _url => {
7817-
let postBody = _url.match(/[:%]P{(.*?)}/), postParam = {};
7817+
let postBody = _url.match(/[:%]P{(.*)}/), postParam = "";
78187818
if (postBody) {
78197819
_url = _url.replace(postBody[0], '');
78207820
postBody = postBody[1];
7821-
postBody = new URLSearchParams(postBody);
7822-
postBody.forEach((v, k) => {
7823-
postParam[k] = v;
7824-
});
7821+
if (postBody.charAt(0) === '"' && postBody.charAt(postBody.length - 1) === '"') {
7822+
postParam = postBody.substring(1, postBody.length - 1);
7823+
} else {
7824+
postBody = new URLSearchParams(postBody);
7825+
let postDict = {};
7826+
postBody.forEach((v, k) => {
7827+
postDict[k] = v;
7828+
});
7829+
postParam = JSON.stringify(postDict);
7830+
}
78257831
}
78267832
_GM_xmlhttpRequest({
7827-
method: "POST", url: _url, data: JSON.stringify(postParam),
7833+
method: "POST", url: _url, data: postParam,
78287834
onload: (d) => {
7829-
_GM_notification(i18n("postOver") + d.statusText);
7835+
debug(d);
7836+
//_GM_notification(i18n("postOver") + d.statusText);
78307837
},
78317838
onerror: (e) => {
78327839
_GM_notification(i18n("postError") + (e.statusText || e.error));

0 commit comments

Comments
 (0)