Skip to content

Improve prevent-xhr scriptlet #199

Closed
@AdamWr

Description

@AdamWr

There is a website - AdguardTeam/AdguardFilters#111383 which detects adblockers when googletagmanager.com/gtag/ (xmlhttprequest) is blocked.

Unfortunately, streamingcommunity.site#%#//scriptlet('prevent-xhr', 'googletagmanager.com') doesn't work correctly in this case and video player is broken.

If I'm not wrong, it's because website uses loadend event, so I guess that adding:

const loadEndEvent = new Event('loadend');
thisArg.dispatchEvent(loadEndEvent);

here:

setTimeout(() => {
const stateEvent = new Event('readystatechange');
thisArg.dispatchEvent(stateEvent);
const loadEvent = new Event('load');
thisArg.dispatchEvent(loadEvent);
}, 1);

should fixes this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions