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

Function bindInjector

extensions/chrome/background.js:77–88  ·  view source on GitHub ↗
(domains = [])

Source from the content-addressed store, hash-verified

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

Callers 1

initFunction · 0.70

Calls 3

hasListenerMethod · 0.45
removeListenerMethod · 0.45
addListenerMethod · 0.45

Tested by

no test coverage detected