feature/host-overrides (#161)
* configurable host overrides * base host overrides on name of service instead of key and hide the options by default * added unit tests * review changes * Refactor options * Refactor * Update Readme * Pump version and update Changelog Co-authored-by: Tobias Jacksteit <me@xtj7.de>
This commit is contained in:
@@ -12,7 +12,15 @@ import { createMatcher } from "utils/urlMatcher"
|
||||
import remoteServices from "remoteServices"
|
||||
import { queryTabs, isBrowserTab, getSettings, setStorage } from "utils/browser"
|
||||
|
||||
const matcher = createMatcher(remoteServices)
|
||||
let matcher
|
||||
|
||||
const initMatcher = (settings) => {
|
||||
matcher = createMatcher(remoteServices, settings.hostOverrides)
|
||||
}
|
||||
|
||||
getSettings().then((settings) => {
|
||||
initMatcher(settings)
|
||||
})
|
||||
|
||||
export function tabUpdated(tab, { messenger, settings }) {
|
||||
messenger.connectTab(tab)
|
||||
@@ -54,6 +62,8 @@ export function tabUpdated(tab, { messenger, settings }) {
|
||||
}
|
||||
|
||||
export function settingsChanged(settings, { messenger }) {
|
||||
initMatcher(settings)
|
||||
|
||||
queryTabs({ currentWindow: true })
|
||||
.then(reject(isBrowserTab))
|
||||
.then(
|
||||
|
||||
Reference in New Issue
Block a user