Dom Observer Pro
by @raghulpasupathi
Real-time DOM monitoring tool using MutationObserver and IntersectionObserver to detect and extract dynamic web content efficiently with minimal performance...
clawhub install dom-observer-proπ About This Skill
DOM Observer Pro
Metadata
@raghulpasupathi/dom-observer-proDescription
Efficient DOM monitoring system for real-time content detection in web browsers. Uses MutationObserver, IntersectionObserver, and intelligent debouncing to detect AI-generated content as it appears on web pages with minimal performance impact.Installation
Via ClawHub
https://clawhub.ai/raghulpasupathi/dom-observer-pro
Via npm
npm install @raghulpasupathi/dom-observer-pro
Features
Configuration
{
"enabled": true,
"settings": {
"observeMode": "mutation",
"targetSelectors": [
"article",
"p",
"div.content",
"span.text",
".comment",
".post"
],
"ignoreSelectors": [
"script",
"style",
"noscript",
".ads",
".navigation"
],
"mutation": {
"enabled": true,
"childList": true,
"subtree": true,
"characterData": true
},
"intersection": {
"enabled": true,
"threshold": 0.5,
"rootMargin": "50px"
},
"performance": {
"debounceDelay": 300,
"throttleDelay": 100,
"batchSize": 10,
"maxQueueSize": 100
},
"extraction": {
"minTextLength": 50,
"maxTextLength": 10000,
"extractImages": true,
"extractLinks": true
}
}
}
API Examples
See dom-observer-pro-examples.js for complete usage examples.
Dependencies
Performance
Use Cases
Best Practices
1. Use specifictargetSelectors to reduce noise
2. Always define ignoreSelectors for ads, navigation, etc.
3. Set appropriate debounceDelay to balance speed vs performance
4. Use IntersectionObserver for content in long pages
5. Implement batch processing for high-frequency changes
6. Call stop() when observer is no longer needed
7. Use WeakSet to track processed elements
8. Monitor performance metrics regularly
9. Handle errors gracefully to prevent observer failure
10. Test across different websites and frameworks
β‘ When to Use
βοΈ Configuration
{
"enabled": true,
"settings": {
"observeMode": "mutation",
"targetSelectors": [
"article",
"p",
"div.content",
"span.text",
".comment",
".post"
],
"ignoreSelectors": [
"script",
"style",
"noscript",
".ads",
".navigation"
],
"mutation": {
"enabled": true,
"childList": true,
"subtree": true,
"characterData": true
},
"intersection": {
"enabled": true,
"threshold": 0.5,
"rootMargin": "50px"
},
"performance": {
"debounceDelay": 300,
"throttleDelay": 100,
"batchSize": 10,
"maxQueueSize": 100
},
"extraction": {
"minTextLength": 50,
"maxTextLength": 10000,
"extractImages": true,
"extractLinks": true
}
}
}
π Tips & Best Practices
1. Use specific targetSelectors to reduce noise
2. Always define ignoreSelectors for ads, navigation, etc.
3. Set appropriate debounceDelay to balance speed vs performance
4. Use IntersectionObserver for content in long pages
5. Implement batch processing for high-frequency changes
6. Call stop() when observer is no longer needed
7. Use WeakSet to track processed elements
8. Monitor performance metrics regularly
9. Handle errors gracefully to prevent observer failure
10. Test across different websites and frameworks