prevent-element-src-loading
Prevents targeted elements (script, img, iframe, link) from loading specific resources by intercepting src/href assignments and redirecting them to local mock data. Also neutralizes onerror handlers and error event listeners.
Parameters
|
Name |
Description |
Mandatory |
Default |
|---|---|---|---|
|
tagName |
The type of HTML element to target. Accepted values: |
Yes |
n.a. |
|
search |
String or regex to match the URL in the |
Yes |
n.a. |
Use cases
-
Neutralizing CV providers that use
onerrorattributes to detect blocked scripts/iframes. -
Preventing tracking pixels or scripts while keeping the DOM structure intact.
-
Silently blocking resource loads that would otherwise trigger walls and errors.
Filter examples
|
Filter |
Result |
|---|---|
|
|
Replaces the |
|
|
Replaces matching images with a transparent 1x1 GIF. |
|
|
Prevents matching iframes from loading. |
Debugging
|
# |
Message |
When |
Meaning |
|---|---|---|---|
|
1 |
|
After hooking setAttribute |
setAttribute calls for this tag type are intercepted. |
|
2 |
|
After hooking property |
Direct assignments are intercepted. |
|
3 |
|
During first call |
onerror callbacks on matched elements are intercepted. |
|
4 |
|
During first call |
error event listeners are intercepted. |
|
5 |
|
When URL matches |
The resource load was redirected to mock data. |
|
6 |
|
When site adds error listener |
The error listener was neutralized. |