|
4 | 4 | // @name:zh-TW 搜尋醬 |
5 | 5 | // @name:ja 検索ちゃん - SearchJumper |
6 | 6 | // @namespace hoothin |
7 | | -// @version 1.6.30.4 |
| 7 | +// @version 1.6.30.5 |
8 | 8 | // @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. |
9 | 9 | // @description:zh-CN 高效搜索辅助,在搜索时一键切换搜索引擎,支持划词右键搜索、页内关键词查找与高亮、可视化操作模拟、高级自定义等 |
10 | 10 | // @description:zh-TW 高效搜尋輔助,在搜尋時一鍵切換搜尋引擎,支援劃詞右鍵搜尋、頁內關鍵詞查找與高亮、可視化操作模擬、高級自定義等 |
|
7814 | 7814 | if (e.stopPropagation) e.stopPropagation(); |
7815 | 7815 | if (targetUrlData === false) return false; |
7816 | 7816 | let postHandler = _url => { |
7817 | | - let postBody = _url.match(/[:%]P{(.*?)}/), postParam = {}; |
| 7817 | + let postBody = _url.match(/[:%]P{(.*)}/), postParam = ""; |
7818 | 7818 | if (postBody) { |
7819 | 7819 | _url = _url.replace(postBody[0], ''); |
7820 | 7820 | 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 | + } |
7825 | 7831 | } |
7826 | 7832 | _GM_xmlhttpRequest({ |
7827 | | - method: "POST", url: _url, data: JSON.stringify(postParam), |
| 7833 | + method: "POST", url: _url, data: postParam, |
7828 | 7834 | onload: (d) => { |
7829 | | - _GM_notification(i18n("postOver") + d.statusText); |
| 7835 | + debug(d); |
| 7836 | + //_GM_notification(i18n("postOver") + d.statusText); |
7830 | 7837 | }, |
7831 | 7838 | onerror: (e) => { |
7832 | 7839 | _GM_notification(i18n("postError") + (e.statusText || e.error)); |
|
0 commit comments