Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import domainPermissionToggle from 'webext-domain-permission-toggle';
import dynamicContentScripts from 'webext-dynamic-content-scripts';
import parseRepoUrl from './lib/parse-repo-url';
// GitHub Enterprise support
dynamicContentScripts.addToFutureTabs();
domainPermissionToggle.addContextMenu();
const cache = new Map();
const cacheLimit = 1000;
window.npmhubCache = cache;
// Trim cache twice-daily in long browser sessions
setInterval(() => {
for (const name of cache) {
if (cache.size < cacheLimit) {
return;
}
cache.delete(name);
}
url: 'https://github.com/sindresorhus/refined-github/issues/1137',
active: false
});
}
// Nuke old cache
// TODO: drop code in November
if (reason === 'update') {
const dataToPreserve = await browser.storage.local.get('unreadNotifications');
await browser.storage.local.clear();
browser.storage.local.set(dataToPreserve);
}
});
// GitHub Enterprise support
dynamicContentScripts.addToFutureTabs();
domainPermissionToggle.addContextMenu();