Skip to content

Instantly share code, notes, and snippets.

View ergcode's full-sized avatar

ergonomic.code ergcode

View GitHub Profile
@nicoandmee
nicoandmee / webgl-detection-bypass.js
Created January 26, 2020 13:07
[canvas-webgl-puppeteer-spoof]
() => {
function hookPrototypeMethods(prefix, object) {
// TODO: also hook getters
if (!object) return;
const originals = {};
const prototype = Object.getPrototypeOf(object);
Object
.getOwnPropertyNames(prototype)
.filter((n) => {
try {
@nicoandmee
nicoandmee / monitorExecution.js
Created November 9, 2019 13:54
inject js to examine detection strategies
const fingerprintingDetection = (function () {
const detectFingerprinting = function () {
function getCallerFile() {
let originalFunc = Error.prepareStackTrace;
let callerfile;
try {
const err = new Error();
let currentfile;
// This injects a box into the page that moves with the mouse;
// Useful for debugging
async function installMouseHelper(page) {
await page.evaluateOnNewDocument(() => {
// Install mouse helper only for top-level frame.
if (window !== window.parent)
return;
window.addEventListener('DOMContentLoaded', () => {
const box = document.createElement('puppeteer-mouse-pointer');
const styleElement = document.createElement('style');
@nicoandmee
nicoandmee / clickElementHandle.js
Last active September 16, 2020 12:32
clickElementHandle - puppeteer click without bot detect
async clickElementHandle(handle, {
selector,
} = {}) {
return puppeteerErrorRetry(async () => {
if (!handle) {
this.logger.warn('clickElementHandle-empty-handle', await this.dump({
selector,
}));
return false;
}
@nicoandmee
nicoandmee / puppeteer-bot.js
Created March 26, 2019 20:29
disguisePage - undetectable puppeteer
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Mobile Intel(R) 4 Seri