Skip to content

Commit

Permalink
fix: 修复无 schema 的配置无法注入
Browse files Browse the repository at this point in the history
  • Loading branch information
oustn committed Nov 19, 2024
1 parent 3770ddf commit b525db4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/contents/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
CONFIG_CHANGE_EVENT,
onStorageChanged,
RESOLVE_STORAGE,
resolveConfig,
resolveConfig, resolveUrls,
SPY_ID, SYNC_STORAGE,
URL_CHANGE_MESSAGE,
} from '@src/common';
Expand Down Expand Up @@ -95,7 +95,7 @@ chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const source = Object.entries(config.rules).find(([_, value]) => {
return value.find(u => u.host === host && u.activated)
return value.find(u => (u.host === host || resolveUrls(u.host)?.includes(host)) && u.activated)
})?.[0]
if (!source) return
console.log(`Current host: ${host}, source: ${source}`, `Try to resolve ${source} storages`)
Expand Down

0 comments on commit b525db4

Please sign in to comment.