How to use webext-dynamic-content-scripts - 2 common examples

To help you get started, we’ve selected a few webext-dynamic-content-scripts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github npmhub / npmhub / source / background.js View on Github external
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);
  }
github sindresorhus / refined-github / source / background.js View on Github external
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();

webext-dynamic-content-scripts

WebExtension module: Automatically registers your `content_scripts` on domains added via `permission.request` or on `activeTab`

MIT
Latest version published 4 months ago

Package Health Score

65 / 100
Full package analysis

Popular webext-dynamic-content-scripts functions