Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@horat1us/detect-ad-block
Advanced tools
Readme
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 9 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.