chore(examples): indent all examples (#1783)
Indented examples are easier to read.
This commit is contained in:
parent
891a5539bd
commit
d68033aeca
@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
"extends": "../.eslintrc.js",
|
||||
/**
|
||||
* ESLint rules
|
||||
*
|
||||
* All available rules: http://eslint.org/docs/rules/
|
||||
*
|
||||
* Rules take the following form:
|
||||
* "rule-name", [severity, { opts }]
|
||||
* Severity: 2 == error, 1 == warning, 0 == off.
|
||||
*/
|
||||
"rules": {
|
||||
"indent": [2, 2, { "SwitchCase": 1, "CallExpression": {"arguments": 2}, "MemberExpression": 2, "outerIIFEBody": 0 }],
|
||||
"strict": [2, "global"],
|
||||
}
|
||||
};
|
@ -19,7 +19,6 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.setRequestInterception(true);
|
||||
@ -33,6 +32,5 @@ await page.goto('https://news.google.com/news/');
|
||||
await page.screenshot({path: 'news.png', fullPage: true});
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
|
||||
@ -46,5 +45,4 @@ await listenFor('app-ready'); // Listen for "app-ready" custom event on page loa
|
||||
await page.goto('https://www.chromestatus.com/features', {waitUntil: 'networkidle2'});
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -34,7 +34,6 @@ function sniffDetector() {
|
||||
}
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.evaluateOnNewDocument(sniffDetector);
|
||||
@ -42,5 +41,4 @@ await page.goto('https://www.google.com', {waitUntil: 'networkidle2'});
|
||||
console.log('Sniffed: ' + (await page.evaluate(() => !!navigator.sniffed)));
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -19,7 +19,6 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
|
||||
@ -31,5 +30,4 @@ await page.pdf({
|
||||
});
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -19,7 +19,6 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch({
|
||||
// Launch chromium using a proxy server on port 9876.
|
||||
// More on proxying:
|
||||
@ -29,5 +28,4 @@ const browser = await puppeteer.launch({
|
||||
const page = await browser.newPage();
|
||||
await page.goto('https://google.com');
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -20,12 +20,10 @@ const puppeteer = require('puppeteer');
|
||||
const devices = require('puppeteer/DeviceDescriptors');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
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});
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -19,12 +19,9 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.goto('http://example.com');
|
||||
await page.screenshot({path: 'example.png'});
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
@ -24,7 +24,6 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
(async() => {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
|
||||
@ -53,5 +52,4 @@ const links = await page.evaluate(resultsSelector => {
|
||||
console.log(links.join('\n'));
|
||||
|
||||
await browser.close();
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user