Skip to content

Commit

Permalink
1.9.15
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Jul 15, 2024
1 parent d366773 commit 881eb5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions searchJumper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @name:ja SearchJumper
// @name:ru SearchJumper
// @namespace hoothin
// @version 1.9.14
// @version 1.9.15
// @description Search for everything in different search engines, conduct searches for selected text/image/link effortlessly, over 300 features available.
// @description:zh-CN 万能聚合搜索,一键切换搜索引擎,超过300种功能,可组合或自定义划词、页面、图片菜单,并有页内关键词查找与高亮、可视化搜索、超级拖拽等功能。
// @description:zh-TW 萬能聚合搜尋,一鍵切換搜尋引擎,超過300種功能,可組合或自訂劃詞、頁面、圖片選單,並有頁內關鍵字查找與高亮、可視化搜索、超級拖曳等功能。
Expand Down Expand Up @@ -866,8 +866,12 @@
const reader = d.response.getReader();
let json = () => {
try {
if (buffer && /^({.*} *\n)* *{.*}$/.test(buffer.trim())) {
buffer = buffer.split("\n").pop();
if (buffer) {
if (/^({.*} *\n)* *{.*}$/.test(buffer.trim())) {
buffer = buffer.split("\n").pop();
} else if (/^\[[\s\S]+[^\]]$/.test(buffer.trim())) {
buffer = buffer + "]";
}
}
return JSON.parse(buffer);
} catch (e) {
Expand Down Expand Up @@ -10741,12 +10745,14 @@
fetchOption.onstream = async data => {
let result = isJson ? calcJson(data.json(), template) : data.text;
self.tipsPos(target, result);
self.tips.style.pointerEvents = "all";
resolve && resolve(result);
};
if (ext) {
self.streamUpdateCallBack = data => {
let result = isJson ? calcJson(data.json, template) : data.text;
self.tipsPos(target, result);
self.tips.style.pointerEvents = "all";
resolve && resolve(result);
};
fetchData = new Promise((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion src/Version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "1.9.14";
export const version = "1.9.15";

0 comments on commit 881eb5b

Please sign in to comment.