Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/unsight.dev. Detect duplicate GitHub issues, areas of concern and more across related rep unsight.dev
Something went wrong. Try again.
575 B · 18 lines
TypeScript
at web-ext
12345678910111213141516171819import { isFirefox, isForbiddenUrl } from '~/env'
// Firefox fetch files from cache instead of reloading changes from disk,// hmr will not work as Chromium based browserbrowser.webNavigation.onCommitted.addListener(({ tabId, frameId, url }) => { // Filter out non main window events. if (frameId !== 0) return
if (isForbiddenUrl(url)) return
// inject the latest scripts browser.tabs.executeScript(tabId, { file: `${isFirefox ? '' : '.'}/dist/contentScripts/index.global.js`, runAt: 'document_end', }).catch(error => console.error(error))})