Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@horat1us/detect-ad-block
Advanced tools
Simple module to detect advertising block add-on in browser using Promise.
Require Promise to be supported or polifylled.
Inspired by FuckAdBlock@4.0.0-beta3.
Using npm:
npm i @horat1us/detect-ad-block@^1.0
import { DetectAdBlock } from "@horat1us/detect-ad-block";
function detect() {
const detectAdBlock = DetectAdBlock();
detectAdBlock.perform({ timeout: 1000 })
.then((result) => {
console.log(result ? `AdBlock Detected` : `AdBlock Not Found`);
})
.catch((error) => {
console.error(`Error while AdBlock checking: `, error);
});
}
const timeout = 5000;
// You may use window.onload, document.onreadystatechange etc.
if (window.requestIdleCallback) {
window.requestIdleCallback(detect, timeout);
} else {
setTimeout(detect, timeout)
}
Note: You should not run adblock checking directly on or after page load.
You may use built-in plugins:
Also, you may implement custom plugin using DetectPlugin interface.
import { DetectAdBlock, plugins } from "@horat1us/detect-ad-block";
const detectAdBlock = DetectAdBlock([
// your plugins list
plugins.ajax,
plugins.script,
plugins.html,
// using built-in plugin with custom options
plugins.Html({
name: "custom-html",
baitStyle: "...",
baitClass: "...",
interval: 100,
timeout: 950,
}),
// or custom plugin
{
name: "custom-plugin",
version: 1,
detect(resolve) {
const result = performSomeCheck();
resolve(result);
},
},
])
FAQs
Browser Ad Block add-ons detector
The npm package @horat1us/detect-ad-block receives a total of 6 weekly downloads. As such, @horat1us/detect-ad-block popularity was classified as not popular.
We found that @horat1us/detect-ad-block demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.