Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Jan 9, 2024
1 parent aa666a0 commit 2751f66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 8 additions & 4 deletions SearchJumper/searchJumper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@
var value;
if (ext) {
let result = await chrome.storage.local.get([key]);
value = result[key];
value = result && result[key];
} else if (this.supportGMPromise) {
value = await GM.getValue(key);
} else if (this.supportGM) {
Expand Down Expand Up @@ -7901,7 +7901,7 @@
let si = se.querySelector("img");
let data = sites[i];

if (localKeywords && data.kwFilter) {
if (data && localKeywords && data.kwFilter) {
if (new RegExp(data.kwFilter).test(localKeywords)) {
se.style.display = '';
} else {
Expand Down Expand Up @@ -10956,6 +10956,9 @@

async function cacheFontManager(noti) {
if (searchData.prefConfig.cacheSwitch) {
searchBar.con.classList.add("in-input");
searchBar.con.style.visibility = "hidden";
searchBar.appendBar();
let needCache = cacheFontPool.length > 0;
while (cacheFontPool.length > 0) {
await cacheAction(cacheFontPool.shift());
Expand Down Expand Up @@ -14394,6 +14397,7 @@
function checkVisibility() {
if (document.hidden) {
if (searchBar) searchBar.closeShowAll();
else return;
if (!searchData.prefConfig.globalSearchNow) return;
checkGlobalIntv = setInterval(async () => {
let oldGlobalInPageWords = globalInPageWords;
Expand All @@ -14416,14 +14420,14 @@
storage.getItem("globalInPageWords", data => {
globalInPageWords = (data || '');
if (oldGlobalInPageWords != globalInPageWords) {
searchBar.refreshPageWords();
if (searchBar) searchBar.refreshPageWords();
}
});
let oldNavEnable = navEnable || false;
storage.getItem("navEnable", data => {
navEnable = (typeof data === "undefined" ? true : data);
if (oldNavEnable != navEnable) {
searchBar.refreshNav();
if (searchBar) searchBar.refreshNav();
}
});
});
Expand Down
6 changes: 1 addition & 5 deletions SearchJumper/searchJumperDefaultConfig.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//Open setting page to change data, NOT HERE!
let lang = navigator.appName === "Netscape" ? navigator.language : navigator.userLanguage;
let sitesConfig = {};
switch (lang) {
Expand Down Expand Up @@ -223,11 +224,6 @@ switch (lang) {
"name": "F搜",
"url": "https://fsoufsou.com/search?q=%s",
"nobatch": true
},
{
"name": "中国搜索",
"url": "https://www.chinaso.com/newssearch/all/allResults?q=%s",
"nobatch": true
}
]
},
Expand Down

0 comments on commit 2751f66

Please sign in to comment.