Skip to content

Conversation

EmpiresHQ
Copy link
Contributor

@EmpiresHQ EmpiresHQ commented Jun 20, 2025

Hello!

This one is related to #415, it has slight differences from puppeteer implementation, especially in the Page.addScriptToEvaluateOnNewDocument where puppeteer uses a sophisticated logic to match if the script was already added to the frame (I did not quite get why they need that)

Besides that the implementation is fairly straightforward, I have added the CDP runner to the existing test suite using puppeteer as a chrome launcher, have also added simplified methods to align with test scenarios.

So far tests are mostly passing for me (there are 3 randomly failing tests, but they fail for me on master too)

I did not bump package versions nor updated the README, so far it's just to check it out and decide if you want to merge it

@EmpiresHQ EmpiresHQ marked this pull request as draft June 20, 2025 03:31
@EmpiresHQ EmpiresHQ changed the title Enable the chrome-remote-interface feat: Enable the chrome-remote-interface Jun 20, 2025
@EmpiresHQ EmpiresHQ changed the title feat: Enable the chrome-remote-interface feat: enable the chrome-remote-interface Jun 20, 2025
Copy link
Collaborator

@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.

Thank you for your contribution!

The PR looks mostly fine to me. We'll likely need to format / lint the changes. I also have a few questions:

@EmpiresHQ
Copy link
Contributor Author

Have resolved most issues and added a tweak:

        await page.addScriptToEvaluateOnNewDocument({
            source: this.getInjectableFingerprintFunction(enhancedFingerprint),
            // @ts-ignore unfortunately types are too old, its essential to guarantee script is executed immediately
            runImmediately: true,
        });

so that the script is executed immediately after the page loads. Otherwise it can be executed not in the first place, and other scripts in <head> have a chance to capture non-modified data

@B4nan B4nan requested a review from barjin July 28, 2025 09:38
@jvarela07
Copy link

What's the timeline on this PR? Been a few months and no movement.

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.

3 participants