
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
webext-detect-page
Advanced tools
Detects where the current browser extension code is being run. Compatible with Firefox, Chrome and derivates.
Detects where the current browser extension code is being run. Chrome and Firefox.
You can just download the standalone bundle (it might take a minute to download) and include the file in your manifest.json.
Or use npm:
npm install webext-detect-page
// This module is only offered as a ES Module
import {
isBackgroundPage,
isContentScript,
isOptionsPage
} from 'webext-detect-page';
import {isBackgroundPage} from 'webext-detect-page';
if (isBackgroundPage()) {
// Run background code, e.g.
browser.runtime.onMessage.addListener(console.log);
} else if (isContentScript) {
// Run content script code, e.g.
browser.runtime.sendMessage('wow!');
}
Returns a boolean that indicates whether the code is being run in a background page.
Returns a boolean that indicates whether the code is being run in a content script.
Returns a boolean that indicates whether the code is being run in an options page. This only works if the URL matches the one specified in the extension's manifest.json
content_scripts on custom domains.Awesome WebExtensions: A curated list of awesome resources for Web Extensions developmentMIT © Federico Brigante
FAQs
The package was renamed to `webext-detect`
We found that webext-detect-page demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.