MCPcopy Create free account
hub / github.com/Justineo/github-hovercard / bindInjector

Function bindInjector

extensions/edge/background.js:78–89  ·  view source on GitHub ↗
(domains)

Source from the content-addressed store, hash-verified

76}
77
78function bindInjector(domains) {
79 // always enable hovercard on GitHub
80 if (domains.indexOf(GITHUB_DOMAIN) === -1) {
81 domains.push(GITHUB_DOMAIN);
82 }
83 let filters = domains.map((domain) => { return { hostEquals: domain }; });
84 if (browser.webNavigation.onCommitted.hasListener(injector)) {
85 browser.webNavigation.onCommitted.removeListener(injector);
86 }
87 // rebind injector with different domains
88 browser.webNavigation.onCommitted.addListener(injector, { url: filters });
89}
90
91function init() {
92 storage.get({

Callers 1

initFunction · 0.70

Calls 3

hasListenerMethod · 0.45
removeListenerMethod · 0.45
addListenerMethod · 0.45

Tested by

no test coverage detected