examples: replace let with const (#403)
This commit is contained in:
parent
8c245eef4e
commit
7796ca50ee
@ -17,8 +17,8 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
function sniffDetector() {
|
||||
let userAgent = window.navigator.userAgent;
|
||||
let platform = window.navigator.platform;
|
||||
const userAgent = window.navigator.userAgent;
|
||||
const platform = window.navigator.platform;
|
||||
|
||||
window.navigator.__defineGetter__('userAgent', function() {
|
||||
window.navigator.sniffed = true;
|
||||
|
@ -20,7 +20,7 @@ const devices = require('puppeteer/DeviceDescriptors');
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
let page = await browser.newPage();
|
||||
const page = await browser.newPage();
|
||||
await page.emulate(devices['iPhone 6']);
|
||||
await page.goto('https://www.nytimes.com/');
|
||||
await page.screenshot({path: 'full.png', fullPage: true});
|
||||
|
Loading…
Reference in New Issue
Block a user