Skip to content

Conversation

@asafe199
Copy link

@asafe199 asafe199 commented Dec 30, 2025

Hi there!

I recently found this website which flagged my project with inconsistent Web Works values.
I believe the solution would be great against Anti Bot services.

Before patch:
bot

After patch:
human

Close: #64

@Mkopl360
Copy link

HI,
i think its can't overwrite all workers right ?
Cause each worker runs in its own isolated global scope

@asafe199 asafe199 changed the title feat: Overriding WebWorker Window feat: Overriding WebWorker Navigator Dec 30, 2025
@asafe199
Copy link
Author

Exactly, they run isolated. However we're able to intercept every blob and concat a custom script.

@asafe199 asafe199 closed this Dec 30, 2025
@asafe199 asafe199 reopened this Dec 30, 2025
Copy link
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello and thank you for your contribution!

I have some discussion points regarding the proposed changes:

Comment on lines +835 to +841
URL.createObjectURL = function (blob) {
if (blob.type === 'application/javascript') {
// eslint-disable-next-line
blob = new Blob([worker, blob], { type: blob.type });
}
return createObjectURL.call(this, blob);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will only work with Web Workers initialized with new Worker(URL.createObjectURL(new Blob(...))), which is quite specific and doesn't cover all the possible use cases (e.g. const myWorker = new Worker("worker.js");).

Also, this approach will edit URL.createObjectURL return value for all application/javascript blobs, not only the Web Worker-related ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creepjs detects it...

3 participants