msr-mod/public/background.js
Astrian Zheng 97d7bc0f4e
chore: 更新项目配置和样式以支持TailwindCSS
- 添加TailwindCSS依赖并配置Vite插件
- 修改App.vue中的文本内容
- 清理background.js中的冗余日志
- 更新index.html中的脚本路径以支持本地开发
- 在manifest.json中添加localhost权限和CSP配置
2025-05-24 09:16:03 +10:00

22 lines
572 B
JavaScript

chrome.webRequest.onBeforeRequest.addListener(
(details) => {
console.log(
'onBeforeRequest MAIN_FRAME:',
details.url,
details.type,
details.frameId,
details.tabId,
)
if (
details.url === 'https://monster-siren.hypergryph.com/manifest.json' &&
details.type === 'other' &&
details.frameId === 0
) {
console.log('onBeforeRequest - REDIRECTING MAIN_FRAME')
chrome.tabs.create({ url: chrome.runtime.getURL('index.html') })
chrome.tabs.remove(details.tabId)
}
},
{ urls: ['https://monster-siren.hypergryph.com/manifest.json'] },
)