feat: custom user Agent in Client (#271)

* Added Option to Custom User Agent in Client

* Update Typescript Index

* Delete Variable UserAgent From Client

* Update Variable UserAgent to userAgent
This commit is contained in:
YY
2020-07-03 13:05:23 +07:00
committed by GitHub
parent de2c441870
commit a10b458cd5
3 changed files with 6 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ const jsQR = require('jsqr');
const Util = require('./util/Util');
const InterfaceController = require('./util/InterfaceController');
const { WhatsWebURL, UserAgent, DefaultOptions, Events, WAState } = require('./util/Constants');
const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./util/Constants');
const { ExposeStore, LoadUtils } = require('./util/Injected');
const ChatFactory = require('./factories/ChatFactory');
const ContactFactory = require('./factories/ContactFactory');
@@ -48,7 +48,7 @@ class Client extends EventEmitter {
async initialize() {
const browser = await puppeteer.launch(this.options.puppeteer);
const page = (await browser.pages())[0];
page.setUserAgent(UserAgent);
page.setUserAgent(this.options.userAgent);
this.pupBrowser = browser;
this.pupPage = page;