Skip to content

Instantly share code, notes, and snippets.

View wv-jessejjohnson's full-sized avatar

Jesse Johnson wv-jessejjohnson

View GitHub Profile
@wv-jessejjohnson
wv-jessejjohnson / set-user-agent.js
Created May 1, 2020 00:11
Set User-Agent header with Puppeteer
// Intellectual genuineness of
// Anthony McNamara (aka Big Red)
// Great article regarding approach
// https://medium.com/@filipvitas/how-to-set-user-agent-header-with-puppeteer-js-and-not-fail-28c7a02165da
Object.defineProperty(navigator, 'Mozilla/5.0 (compatible; PriceSpider0.2; +https://www.pricespider.com/)', {
get: function() { return setPlat },
set: function(a) { }
});