├── .github └── workflows │ └── nightly.yml ├── .gitignore ├── .pnp.js ├── .vscode ├── extensions.json └── settings.json ├── .yarn ├── build-state.yml ├── install-state.gz ├── plugins │ └── @yarnpkg │ │ └── plugin-typescript.cjs ├── releases │ └── yarn-berry.js ├── sdks │ ├── integrations.yml │ └── typescript │ │ ├── bin │ │ ├── tsc │ │ └── tsserver │ │ ├── lib │ │ ├── tsc.js │ │ ├── tsserver.js │ │ └── typescript.js │ │ └── package.json └── unplugged │ └── playwright-npm-1.1.1-eadb08ceef │ └── node_modules │ └── playwright │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── browsers.json │ ├── index.d.ts │ ├── index.js │ ├── install.js │ ├── lib │ ├── accessibility.js │ ├── api.js │ ├── browser.js │ ├── browserContext.js │ ├── chromium │ │ ├── crAccessibility.js │ │ ├── crBrowser.js │ │ ├── crConnection.js │ │ ├── crCoverage.js │ │ ├── crExecutionContext.js │ │ ├── crInput.js │ │ ├── crNetworkManager.js │ │ ├── crPage.js │ │ ├── crPdf.js │ │ ├── crProtocolHelper.js │ │ └── events.js │ ├── console.js │ ├── debug │ │ ├── crDevTools.js │ │ ├── debugSupport.js │ │ ├── sourceMap.js │ │ └── stackTrace.js │ ├── deviceDescriptors.js │ ├── dialog.js │ ├── dom.js │ ├── download.js │ ├── errors.js │ ├── events.js │ ├── extendedEventEmitter.js │ ├── fileChooser.js │ ├── firefox │ │ ├── ffAccessibility.js │ │ ├── ffBrowser.js │ │ ├── ffConnection.js │ │ ├── ffExecutionContext.js │ │ ├── ffInput.js │ │ ├── ffNetworkManager.js │ │ └── ffPage.js │ ├── frames.js │ ├── generated │ │ ├── injectedScriptSource.js │ │ └── utilityScriptSource.js │ ├── helper.js │ ├── hints.js │ ├── input.js │ ├── install │ │ ├── browserFetcher.js │ │ ├── browserPaths.js │ │ └── installer.js │ ├── javascript.js │ ├── logger.js │ ├── macEditingCommands.js │ ├── network.js │ ├── page.js │ ├── progress.js │ ├── screenshotter.js │ ├── selectors.js │ ├── server │ │ ├── browserServer.js │ │ ├── browserType.js │ │ ├── chromium.js │ │ ├── electron.js │ │ ├── electronLoader.js │ │ ├── firefox.js │ │ ├── pipeTransport.js │ │ ├── playwright.js │ │ ├── processLauncher.js │ │ └── webkit.js │ ├── timeoutSettings.js │ ├── transport.js │ ├── types.js │ ├── usKeyboardLayout.js │ ├── utilityScriptSerializers.js │ └── webkit │ │ ├── wkAccessibility.js │ │ ├── wkBrowser.js │ │ ├── wkConnection.js │ │ ├── wkExecutionContext.js │ │ ├── wkInput.js │ │ ├── wkInterceptableRequest.js │ │ ├── wkPage.js │ │ ├── wkProvisionalPage.js │ │ └── wkWorkers.js │ ├── package.json │ └── types │ ├── protocol.d.ts │ └── types.d.ts ├── .yarnrc.yml ├── images └── .gitkeep ├── package.json ├── run.ts ├── web ├── bg.png └── index.html └── yarn.lock /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: Update nightly 2 | 3 | # For testing 4 | # on: push 5 | 6 | on: 7 | schedule: 8 | - cron: "0 4 * * *" 9 | 10 | jobs: 11 | run: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@master 16 | - uses: actions/setup-node@v1 17 | - run: sudo apt-get install graphicsmagick 18 | - run: | 19 | git config --global user.email "git@orta.io" 20 | git config --global user.name "Orta" 21 | 22 | - run: yarn install 23 | - run: yarn ts-node run.ts 24 | env: 25 | GITHUB_API_TOKEN: ${{ secrets.GIST_GITHUB_API_TOKEN }} 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cache 2 | dd2892cdc1b724f5434cf674fa83f3a8 3 | images/*.png 4 | images/*.gif 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "arcanis.vscode-zipfs" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": ".yarn/sdks/typescript/lib", 3 | "typescript.enablePromptUseWorkspaceTsdk": true 4 | } 5 | -------------------------------------------------------------------------------- /.yarn/build-state.yml: -------------------------------------------------------------------------------- 1 | # Warning: This file is automatically generated. Removing it is fine, but will 2 | # cause all your builds to become invalidated. 3 | 4 | # playwright@npm:1.1.1 5 | "eadb08ceefda27f13b3b4f1cc5af9434f24b9fd5e061cc668116acbf6e62380e32ffe048cc1f0b682ec1b858ac991e84608328e43debfc81efc515cfa7802c1f": 6 | 495588c07a94157558d9f96ab0668cfe70864ccb36fefcc057979bb0d83c7bd198207fb94d13135ef052b94d456edfc472a7d4cedf46b2bb55cceb997f931faa 7 | -------------------------------------------------------------------------------- /.yarn/install-state.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orta/nightly-profile-updater/78c9073716bb072db646d73263a841c0cb2a0500/.yarn/install-state.gz -------------------------------------------------------------------------------- /.yarn/sdks/integrations.yml: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by PnPify. 2 | # Manual changes will be lost! 3 | 4 | integrations: 5 | - vscode 6 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsc 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsc your application uses 20 | module.exports = absRequire(`typescript/bin/tsc`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsserver 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsserver your application uses 20 | module.exports = absRequire(`typescript/bin/tsserver`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/tsc.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/tsc.js your application uses 20 | module.exports = absRequire(`typescript/lib/tsc.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsserver.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | const moduleWrapper = tsserver => { 13 | // VSCode sends the zip paths to TS using the "zip://" prefix, that TS 14 | // doesn't understand. This layer makes sure to remove the protocol 15 | // before forwarding it to TS, and to add it back on all returned paths. 16 | 17 | const {isAbsolute} = require(`path`); 18 | 19 | const Session = tsserver.server.Session; 20 | const {onMessage: originalOnMessage, send: originalSend} = Session.prototype; 21 | 22 | return Object.assign(Session.prototype, { 23 | onMessage(/** @type {string} */ message) { 24 | return originalOnMessage.call(this, JSON.stringify(JSON.parse(message), (key, value) => { 25 | return typeof value === 'string' ? removeZipPrefix(value) : value; 26 | })); 27 | }, 28 | 29 | send(/** @type {any} */ msg) { 30 | return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => { 31 | return typeof value === 'string' ? addZipPrefix(value) : value; 32 | }))); 33 | } 34 | }); 35 | 36 | function addZipPrefix(str) { 37 | // We add the `zip:` prefix to both `.zip/` paths and virtual paths 38 | if (isAbsolute(str) && !str.match(/^zip:/) && (str.match(/\.zip\//) || str.match(/\$\$virtual\//))) { 39 | // Absolute VSCode `Uri.fsPath`s need to start with a slash. 40 | // VSCode only adds it automatically for supported schemes, 41 | // so we have to do it manually for the `zip` scheme. 42 | return `zip:${str.replace(/^\/?/, `/`)}`; 43 | } else { 44 | return str; 45 | } 46 | } 47 | 48 | function removeZipPrefix(str) { 49 | return str.replace(/^zip:/, ``); 50 | } 51 | }; 52 | 53 | if (existsSync(absPnpApiPath)) { 54 | if (!process.versions.pnp) { 55 | // Setup the environment to be able to require typescript/lib/tsserver.js 56 | require(absPnpApiPath).setup(); 57 | } 58 | } 59 | 60 | // Defer to the real typescript/lib/tsserver.js your application uses 61 | module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`)); 62 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/typescript.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/typescript.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/typescript.js your application uses 20 | module.exports = absRequire(`typescript/lib/typescript.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript", 3 | "version": "3.9.5-pnpify", 4 | "main": "./lib/typescript.js", 5 | "type": "commonjs" 6 | } -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/NOTICE: -------------------------------------------------------------------------------- 1 | Playwright 2 | Copyright (c) Microsoft Corporation 3 | 4 | This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), 5 | available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). 6 | -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/README.md: -------------------------------------------------------------------------------- 1 | # 🎭 Playwright 2 | 3 | [![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg) [![Chromium version](https://img.shields.io/badge/chromium-85.0.4165.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-77.0b3-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-13.2-blue.svg?logo=safari)](https://webkit.org/) 4 | 5 | ##### [Docs](docs/README.md) | [API reference](docs/api.md) | [Changelog](https://github.com/microsoft/playwright/releases) 6 | 7 | Playwright is a Node library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**. 8 | 9 | | | Linux | macOS | Windows | 10 | | :--- | :---: | :---: | :---: | 11 | | Chromium 85.0.4165.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | 12 | | WebKit 13.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | 13 | | Firefox 77.0b3 | :white_check_mark: | :white_check_mark: | :white_check_mark: | 14 | 15 | Headless execution is supported for all the browsers on all platforms. 16 | 17 | ## Usage 18 | 19 | ``` 20 | npm i -D playwright 21 | ``` 22 | 23 | This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Once installed, you can `require` Playwright in a Node.js script and automate web browser interactions. 24 | 25 | * [Getting started](docs/intro.md) 26 | * [Installation configuration](docs/installation.md) 27 | * [API reference](docs/api.md) 28 | 29 | ## Capabilities 30 | 31 | Playwright is built to automate the broad and growing set of web browser capabilities used by Single Page Apps and Progressive Web Apps. 32 | 33 | * Scenarios that span multiple page, domains and iframes 34 | * Auto-wait for elements to be ready before executing actions (like click, fill) 35 | * Intercept network activity for stubbing and mocking network requests 36 | * Emulate mobile devices, geolocation, permissions 37 | * Support for web components via shadow-piercing selectors 38 | * Native input events for mouse and keyboard 39 | * Upload and download files 40 | 41 | ## Examples 42 | 43 | #### Page screenshot 44 | 45 | This code snippet navigates to whatsmyuseragent.org in Chromium, Firefox and WebKit, and saves 3 screenshots. 46 | 47 | ```js 48 | const playwright = require('playwright'); 49 | 50 | (async () => { 51 | for (const browserType of ['chromium', 'firefox', 'webkit']) { 52 | const browser = await playwright[browserType].launch(); 53 | const context = await browser.newContext(); 54 | const page = await context.newPage(); 55 | await page.goto('http://whatsmyuseragent.org/'); 56 | await page.screenshot({ path: `example-${browserType}.png` }); 57 | await browser.close(); 58 | } 59 | })(); 60 | ``` 61 | 62 | #### Mobile and geolocation 63 | 64 | This snippet emulates Mobile Safari on a device at a given geolocation, navigates to maps.google.com, performs action and takes a screenshot. 65 | 66 | ```js 67 | const { webkit, devices } = require('playwright'); 68 | const iPhone11 = devices['iPhone 11 Pro']; 69 | 70 | (async () => { 71 | const browser = await webkit.launch(); 72 | const context = await browser.newContext({ 73 | ...iPhone11, 74 | geolocation: { longitude: 12.492507, latitude: 41.889938 }, 75 | permissions: ['geolocation'] 76 | }); 77 | const page = await context.newPage(); 78 | await page.goto('https://maps.google.com'); 79 | await page.click('text="Your location"'); 80 | await page.waitForRequest(/.*preview\/pwa/); 81 | await page.screenshot({ path: 'colosseum-iphone.png' }); 82 | await browser.close(); 83 | })(); 84 | ``` 85 | 86 | #### Evaluate in browser context 87 | 88 | This code snippet navigates to example.com in Firefox, and executes a script in the page context. 89 | 90 | ```js 91 | const { firefox } = require('playwright'); 92 | 93 | (async () => { 94 | const browser = await firefox.launch(); 95 | const context = await browser.newContext(); 96 | const page = await context.newPage(); 97 | await page.goto('https://www.example.com/'); 98 | const dimensions = await page.evaluate(() => { 99 | return { 100 | width: document.documentElement.clientWidth, 101 | height: document.documentElement.clientHeight, 102 | deviceScaleFactor: window.devicePixelRatio 103 | } 104 | }); 105 | console.log(dimensions); 106 | 107 | await browser.close(); 108 | })(); 109 | ``` 110 | 111 | #### Intercept network requests 112 | 113 | This code snippet sets up request routing for a WebKit page to log all network requests. 114 | 115 | ```js 116 | const { webkit } = require('playwright'); 117 | 118 | (async () => { 119 | const browser = await webkit.launch(); 120 | const context = await browser.newContext(); 121 | const page = await context.newPage(); 122 | 123 | // Log and continue all network requests 124 | page.route('**', route => { 125 | console.log(route.request().url()); 126 | route.continue(); 127 | }); 128 | 129 | await page.goto('http://todomvc.com'); 130 | await browser.close(); 131 | })(); 132 | ``` 133 | 134 | ## Resources 135 | 136 | * [Documentation](docs/README.md) 137 | * [API reference](docs/api.md) 138 | * [Example recipes](docs/examples/README.md) 139 | * [Contributing](CONTRIBUTING.md) 140 | * [Community showcase](docs/showcase.md) 141 | -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/browsers.json: -------------------------------------------------------------------------------- 1 | { 2 | "browsers": [ 3 | { 4 | "name": "chromium", 5 | "revision": "775089" 6 | }, 7 | { 8 | "name": "firefox", 9 | "revision": "1106" 10 | }, 11 | { 12 | "name": "webkit", 13 | "revision": "1269" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import * as types from './types/types'; 18 | 19 | export * from './types/types'; 20 | export const webkit: types.BrowserType; 21 | export const chromium: types.BrowserType; 22 | export const firefox: types.BrowserType; 23 | -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const { Playwright } = require('./lib/server/playwright'); 18 | 19 | module.exports = new Playwright(__dirname, require('./browsers.json')['browsers']); 20 | -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/install.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const { installBrowsersWithProgressBar } = require('./lib/install/installer'); 18 | 19 | installBrowsersWithProgressBar(__dirname); 20 | -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/accessibility.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | class Accessibility { 4 | constructor(getAXTree) { 5 | this._getAXTree = getAXTree; 6 | } 7 | async snapshot(options = {}) { 8 | const { interestingOnly = true, root = null, } = options; 9 | const { tree, needle } = await this._getAXTree(root || undefined); 10 | if (!interestingOnly) { 11 | if (root) 12 | return needle && serializeTree(needle)[0]; 13 | return serializeTree(tree)[0]; 14 | } 15 | const interestingNodes = new Set(); 16 | collectInterestingNodes(interestingNodes, tree, false); 17 | if (root && (!needle || !interestingNodes.has(needle))) 18 | return null; 19 | return serializeTree(needle || tree, interestingNodes)[0]; 20 | } 21 | } 22 | exports.Accessibility = Accessibility; 23 | function collectInterestingNodes(collection, node, insideControl) { 24 | if (node.isInteresting(insideControl)) 25 | collection.add(node); 26 | if (node.isLeafNode()) 27 | return; 28 | insideControl = insideControl || node.isControl(); 29 | for (const child of node.children()) 30 | collectInterestingNodes(collection, child, insideControl); 31 | } 32 | function serializeTree(node, whitelistedNodes) { 33 | const children = []; 34 | for (const child of node.children()) 35 | children.push(...serializeTree(child, whitelistedNodes)); 36 | if (whitelistedNodes && !whitelistedNodes.has(node)) 37 | return children; 38 | const serializedNode = node.serialize(); 39 | if (children.length) 40 | serializedNode.children = children; 41 | return [serializedNode]; 42 | } 43 | //# sourceMappingURL=accessibility.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/api.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | var accessibility_1 = require("./accessibility"); 19 | exports.Accessibility = accessibility_1.Accessibility; 20 | var console_1 = require("./console"); 21 | exports.ConsoleMessage = console_1.ConsoleMessage; 22 | var dialog_1 = require("./dialog"); 23 | exports.Dialog = dialog_1.Dialog; 24 | var download_1 = require("./download"); 25 | exports.Download = download_1.Download; 26 | var dom_1 = require("./dom"); 27 | exports.ElementHandle = dom_1.ElementHandle; 28 | var fileChooser_1 = require("./fileChooser"); 29 | exports.FileChooser = fileChooser_1.FileChooser; 30 | var errors_1 = require("./errors"); 31 | exports.TimeoutError = errors_1.TimeoutError; 32 | var frames_1 = require("./frames"); 33 | exports.Frame = frames_1.Frame; 34 | var input_1 = require("./input"); 35 | exports.Keyboard = input_1.Keyboard; 36 | exports.Mouse = input_1.Mouse; 37 | var javascript_1 = require("./javascript"); 38 | exports.JSHandle = javascript_1.JSHandle; 39 | var network_1 = require("./network"); 40 | exports.Request = network_1.Request; 41 | exports.Response = network_1.Response; 42 | exports.Route = network_1.Route; 43 | var page_1 = require("./page"); 44 | exports.Page = page_1.Page; 45 | exports.Worker = page_1.Worker; 46 | var selectors_1 = require("./selectors"); 47 | exports.Selectors = selectors_1.Selectors; 48 | var crBrowser_1 = require("./chromium/crBrowser"); 49 | exports.ChromiumBrowser = crBrowser_1.CRBrowser; 50 | var crBrowser_2 = require("./chromium/crBrowser"); 51 | exports.ChromiumBrowserContext = crBrowser_2.CRBrowserContext; 52 | var crCoverage_1 = require("./chromium/crCoverage"); 53 | exports.ChromiumCoverage = crCoverage_1.CRCoverage; 54 | var crConnection_1 = require("./chromium/crConnection"); 55 | exports.CDPSession = crConnection_1.CRSession; 56 | var ffBrowser_1 = require("./firefox/ffBrowser"); 57 | exports.FirefoxBrowser = ffBrowser_1.FFBrowser; 58 | var wkBrowser_1 = require("./webkit/wkBrowser"); 59 | exports.WebKitBrowser = wkBrowser_1.WKBrowser; 60 | var browserServer_1 = require("./server/browserServer"); 61 | exports.BrowserServer = browserServer_1.BrowserServer; 62 | //# sourceMappingURL=api.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const events_1 = require("events"); 19 | const download_1 = require("./download"); 20 | const events_2 = require("./events"); 21 | class BrowserBase extends events_1.EventEmitter { 22 | constructor(options) { 23 | super(); 24 | this._downloads = new Map(); 25 | this._defaultContext = null; 26 | this._options = options; 27 | } 28 | async newPage(options) { 29 | const context = await this.newContext(options); 30 | const page = await context.newPage(); 31 | page._ownedContext = context; 32 | return page; 33 | } 34 | _downloadCreated(page, uuid, url, suggestedFilename) { 35 | const download = new download_1.Download(page, this._options.downloadsPath || '', uuid, url, suggestedFilename); 36 | this._downloads.set(uuid, download); 37 | } 38 | _downloadFilenameSuggested(uuid, suggestedFilename) { 39 | const download = this._downloads.get(uuid); 40 | if (!download) 41 | return; 42 | download._filenameSuggested(suggestedFilename); 43 | } 44 | _downloadFinished(uuid, error) { 45 | const download = this._downloads.get(uuid); 46 | if (!download) 47 | return; 48 | download._reportFinished(error); 49 | this._downloads.delete(uuid); 50 | } 51 | async close() { 52 | if (this._options.ownedServer) { 53 | await this._options.ownedServer.close(); 54 | } 55 | else { 56 | await Promise.all(this.contexts().map(context => context.close())); 57 | this._disconnect(); 58 | } 59 | if (this.isConnected()) 60 | await new Promise(x => this.once(events_2.Events.Browser.Disconnected, x)); 61 | } 62 | _isLogEnabled(log) { 63 | return this._options.logger._isLogEnabled(log); 64 | } 65 | _log(log, message, ...args) { 66 | return this._options.logger._log(log, message, ...args); 67 | } 68 | } 69 | exports.BrowserBase = BrowserBase; 70 | //# sourceMappingURL=browser.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/chromium/crExecutionContext.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const crProtocolHelper_1 = require("./crProtocolHelper"); 20 | const js = require("../javascript"); 21 | const debugSupport = require("../debug/debugSupport"); 22 | const stackTrace_1 = require("../debug/stackTrace"); 23 | const utilityScriptSerializers_1 = require("../utilityScriptSerializers"); 24 | class CRExecutionContext { 25 | constructor(client, contextPayload) { 26 | this._client = client; 27 | this._contextId = contextPayload.id; 28 | } 29 | async rawEvaluate(expression) { 30 | const { exceptionDetails, result: remoteObject } = await this._client.send('Runtime.evaluate', { 31 | expression: debugSupport.ensureSourceUrl(expression), 32 | contextId: this._contextId, 33 | }).catch(rewriteError); 34 | if (exceptionDetails) 35 | throw new Error('Evaluation failed: ' + crProtocolHelper_1.getExceptionMessage(exceptionDetails)); 36 | return remoteObject.objectId; 37 | } 38 | async evaluateWithArguments(expression, returnByValue, utilityScript, values, objectIds) { 39 | const { exceptionDetails, result: remoteObject } = await this._client.send('Runtime.callFunctionOn', { 40 | functionDeclaration: expression, 41 | objectId: utilityScript._objectId, 42 | arguments: [ 43 | { objectId: utilityScript._objectId }, 44 | ...values.map(value => ({ value })), 45 | ...objectIds.map(objectId => ({ objectId })), 46 | ], 47 | returnByValue, 48 | awaitPromise: true, 49 | userGesture: true 50 | }).catch(rewriteError); 51 | if (exceptionDetails) 52 | throw new Error('Evaluation failed: ' + crProtocolHelper_1.getExceptionMessage(exceptionDetails)); 53 | return returnByValue ? utilityScriptSerializers_1.parseEvaluationResultValue(remoteObject.value) : utilityScript._context.createHandle(remoteObject); 54 | } 55 | async getProperties(handle) { 56 | const objectId = handle._objectId; 57 | if (!objectId) 58 | return new Map(); 59 | const response = await this._client.send('Runtime.getProperties', { 60 | objectId, 61 | ownProperties: true 62 | }); 63 | const result = new Map(); 64 | for (const property of response.result) { 65 | if (!property.enumerable || !property.value) 66 | continue; 67 | result.set(property.name, handle._context.createHandle(property.value)); 68 | } 69 | return result; 70 | } 71 | createHandle(context, remoteObject) { 72 | return new js.JSHandle(context, remoteObject.subtype || remoteObject.type, remoteObject.objectId, potentiallyUnserializableValue(remoteObject)); 73 | } 74 | async releaseHandle(handle) { 75 | if (!handle._objectId) 76 | return; 77 | await crProtocolHelper_1.releaseObject(this._client, handle._objectId); 78 | } 79 | } 80 | exports.CRExecutionContext = CRExecutionContext; 81 | function rewriteError(error) { 82 | if (error.message.includes('Object reference chain is too long')) 83 | return { result: { type: 'undefined' } }; 84 | if (error.message.includes('Object couldn\'t be returned by value')) 85 | return { result: { type: 'undefined' } }; 86 | if (error.message.endsWith('Cannot find context with specified id') || error.message.endsWith('Inspected target navigated or closed') || error.message.endsWith('Execution context was destroyed.')) 87 | throw new Error('Execution context was destroyed, most likely because of a navigation.'); 88 | if (error instanceof TypeError && error.message.startsWith('Converting circular structure to JSON')) 89 | stackTrace_1.rewriteErrorMessage(error, error.message + ' Are you passing a nested JSHandle?'); 90 | throw error; 91 | } 92 | function potentiallyUnserializableValue(remoteObject) { 93 | const value = remoteObject.value; 94 | const unserializableValue = remoteObject.unserializableValue; 95 | return unserializableValue ? js.parseUnserializableValue(unserializableValue) : value; 96 | } 97 | //# sourceMappingURL=crExecutionContext.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/chromium/crInput.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const input = require("../input"); 20 | function toModifiersMask(modifiers) { 21 | let mask = 0; 22 | if (modifiers.has('Alt')) 23 | mask |= 1; 24 | if (modifiers.has('Control')) 25 | mask |= 2; 26 | if (modifiers.has('Meta')) 27 | mask |= 4; 28 | if (modifiers.has('Shift')) 29 | mask |= 8; 30 | return mask; 31 | } 32 | class RawKeyboardImpl { 33 | constructor(client) { 34 | this._client = client; 35 | } 36 | async keydown(modifiers, code, keyCode, keyCodeWithoutLocation, key, location, autoRepeat, text) { 37 | await this._client.send('Input.dispatchKeyEvent', { 38 | type: text ? 'keyDown' : 'rawKeyDown', 39 | modifiers: toModifiersMask(modifiers), 40 | windowsVirtualKeyCode: keyCodeWithoutLocation, 41 | code, 42 | key, 43 | text, 44 | unmodifiedText: text, 45 | autoRepeat, 46 | location, 47 | isKeypad: location === input.keypadLocation 48 | }); 49 | } 50 | async keyup(modifiers, code, keyCode, keyCodeWithoutLocation, key, location) { 51 | await this._client.send('Input.dispatchKeyEvent', { 52 | type: 'keyUp', 53 | modifiers: toModifiersMask(modifiers), 54 | key, 55 | windowsVirtualKeyCode: keyCodeWithoutLocation, 56 | code, 57 | location 58 | }); 59 | } 60 | async sendText(text) { 61 | await this._client.send('Input.insertText', { text }); 62 | } 63 | } 64 | exports.RawKeyboardImpl = RawKeyboardImpl; 65 | class RawMouseImpl { 66 | constructor(client) { 67 | this._client = client; 68 | } 69 | async move(x, y, button, buttons, modifiers) { 70 | await this._client.send('Input.dispatchMouseEvent', { 71 | type: 'mouseMoved', 72 | button, 73 | x, 74 | y, 75 | modifiers: toModifiersMask(modifiers) 76 | }); 77 | } 78 | async down(x, y, button, buttons, modifiers, clickCount) { 79 | await this._client.send('Input.dispatchMouseEvent', { 80 | type: 'mousePressed', 81 | button, 82 | x, 83 | y, 84 | modifiers: toModifiersMask(modifiers), 85 | clickCount 86 | }); 87 | } 88 | async up(x, y, button, buttons, modifiers, clickCount) { 89 | await this._client.send('Input.dispatchMouseEvent', { 90 | type: 'mouseReleased', 91 | button, 92 | x, 93 | y, 94 | modifiers: toModifiersMask(modifiers), 95 | clickCount 96 | }); 97 | } 98 | } 99 | exports.RawMouseImpl = RawMouseImpl; 100 | //# sourceMappingURL=crInput.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/chromium/crPdf.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const helper_1 = require("../helper"); 20 | const crProtocolHelper_1 = require("./crProtocolHelper"); 21 | const PagePaperFormats = { 22 | letter: { width: 8.5, height: 11 }, 23 | legal: { width: 8.5, height: 14 }, 24 | tabloid: { width: 11, height: 17 }, 25 | ledger: { width: 17, height: 11 }, 26 | a0: { width: 33.1, height: 46.8 }, 27 | a1: { width: 23.4, height: 33.1 }, 28 | a2: { width: 16.54, height: 23.4 }, 29 | a3: { width: 11.7, height: 16.54 }, 30 | a4: { width: 8.27, height: 11.7 }, 31 | a5: { width: 5.83, height: 8.27 }, 32 | a6: { width: 4.13, height: 5.83 }, 33 | }; 34 | const unitToPixels = { 35 | 'px': 1, 36 | 'in': 96, 37 | 'cm': 37.8, 38 | 'mm': 3.78 39 | }; 40 | function convertPrintParameterToInches(parameter) { 41 | if (typeof parameter === 'undefined') 42 | return undefined; 43 | let pixels; 44 | if (helper_1.helper.isNumber(parameter)) { 45 | // Treat numbers as pixel values to be aligned with phantom's paperSize. 46 | pixels = parameter; 47 | } 48 | else if (helper_1.helper.isString(parameter)) { 49 | const text = parameter; 50 | let unit = text.substring(text.length - 2).toLowerCase(); 51 | let valueText = ''; 52 | if (unitToPixels.hasOwnProperty(unit)) { 53 | valueText = text.substring(0, text.length - 2); 54 | } 55 | else { 56 | // In case of unknown unit try to parse the whole parameter as number of pixels. 57 | // This is consistent with phantom's paperSize behavior. 58 | unit = 'px'; 59 | valueText = text; 60 | } 61 | const value = Number(valueText); 62 | helper_1.assert(!isNaN(value), 'Failed to parse parameter value: ' + text); 63 | pixels = value * unitToPixels[unit]; 64 | } 65 | else { 66 | throw new Error('page.pdf() Cannot handle parameter type: ' + (typeof parameter)); 67 | } 68 | return pixels / 96; 69 | } 70 | class CRPDF { 71 | constructor(client) { 72 | this._client = client; 73 | } 74 | async generate(options = {}) { 75 | const { scale = 1, displayHeaderFooter = false, headerTemplate = '', footerTemplate = '', printBackground = false, landscape = false, pageRanges = '', preferCSSPageSize = false, margin = {}, path = null } = options; 76 | let paperWidth = 8.5; 77 | let paperHeight = 11; 78 | if (options.format) { 79 | const format = PagePaperFormats[options.format.toLowerCase()]; 80 | helper_1.assert(format, 'Unknown paper format: ' + options.format); 81 | paperWidth = format.width; 82 | paperHeight = format.height; 83 | } 84 | else { 85 | paperWidth = convertPrintParameterToInches(options.width) || paperWidth; 86 | paperHeight = convertPrintParameterToInches(options.height) || paperHeight; 87 | } 88 | const marginTop = convertPrintParameterToInches(margin.top) || 0; 89 | const marginLeft = convertPrintParameterToInches(margin.left) || 0; 90 | const marginBottom = convertPrintParameterToInches(margin.bottom) || 0; 91 | const marginRight = convertPrintParameterToInches(margin.right) || 0; 92 | const result = await this._client.send('Page.printToPDF', { 93 | transferMode: 'ReturnAsStream', 94 | landscape, 95 | displayHeaderFooter, 96 | headerTemplate, 97 | footerTemplate, 98 | printBackground, 99 | scale, 100 | paperWidth, 101 | paperHeight, 102 | marginTop, 103 | marginBottom, 104 | marginLeft, 105 | marginRight, 106 | pageRanges, 107 | preferCSSPageSize 108 | }); 109 | return await crProtocolHelper_1.readProtocolStream(this._client, result.stream, path); 110 | } 111 | } 112 | exports.CRPDF = CRPDF; 113 | //# sourceMappingURL=crPdf.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/chromium/crProtocolHelper.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const fs = require("fs"); 20 | const util = require("util"); 21 | function getExceptionMessage(exceptionDetails) { 22 | if (exceptionDetails.exception) 23 | return exceptionDetails.exception.description || String(exceptionDetails.exception.value); 24 | let message = exceptionDetails.text; 25 | if (exceptionDetails.stackTrace) { 26 | for (const callframe of exceptionDetails.stackTrace.callFrames) { 27 | const location = callframe.url + ':' + callframe.lineNumber + ':' + callframe.columnNumber; 28 | const functionName = callframe.functionName || ''; 29 | message += `\n at ${functionName} (${location})`; 30 | } 31 | } 32 | return message; 33 | } 34 | exports.getExceptionMessage = getExceptionMessage; 35 | async function releaseObject(client, objectId) { 36 | await client.send('Runtime.releaseObject', { objectId }).catch(error => { }); 37 | } 38 | exports.releaseObject = releaseObject; 39 | async function readProtocolStream(client, handle, path) { 40 | let eof = false; 41 | let fd; 42 | if (path) 43 | fd = await util.promisify(fs.open)(path, 'w'); 44 | const bufs = []; 45 | while (!eof) { 46 | const response = await client.send('IO.read', { handle }); 47 | eof = response.eof; 48 | const buf = Buffer.from(response.data, response.base64Encoded ? 'base64' : undefined); 49 | bufs.push(buf); 50 | if (path) 51 | await util.promisify(fs.write)(fd, buf); 52 | } 53 | if (path) 54 | await util.promisify(fs.close)(fd); 55 | await client.send('IO.close', { handle }); 56 | return Buffer.concat(bufs); 57 | } 58 | exports.readProtocolStream = readProtocolStream; 59 | function toConsoleMessageLocation(stackTrace) { 60 | return stackTrace && stackTrace.callFrames.length ? { 61 | url: stackTrace.callFrames[0].url, 62 | lineNumber: stackTrace.callFrames[0].lineNumber, 63 | columnNumber: stackTrace.callFrames[0].columnNumber, 64 | } : {}; 65 | } 66 | exports.toConsoleMessageLocation = toConsoleMessageLocation; 67 | function exceptionToError(exceptionDetails) { 68 | const messageWithStack = getExceptionMessage(exceptionDetails); 69 | const lines = messageWithStack.split('\n'); 70 | const firstStackTraceLine = lines.findIndex(line => line.startsWith(' at')); 71 | let message = ''; 72 | let stack = ''; 73 | if (firstStackTraceLine === -1) { 74 | message = messageWithStack; 75 | } 76 | else { 77 | message = lines.slice(0, firstStackTraceLine).join('\n'); 78 | stack = messageWithStack; 79 | } 80 | const match = message.match(/^[a-zA-Z0-0_]*Error: (.*)$/); 81 | if (match) 82 | message = match[1]; 83 | const err = new Error(message); 84 | err.stack = stack; 85 | return err; 86 | } 87 | exports.exceptionToError = exceptionToError; 88 | //# sourceMappingURL=crProtocolHelper.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/chromium/events.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2019 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | exports.Events = { 20 | CRBrowserContext: { 21 | BackgroundPage: 'backgroundpage', 22 | ServiceWorker: 'serviceworker', 23 | } 24 | }; 25 | //# sourceMappingURL=events.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/console.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const util = require("util"); 19 | class ConsoleMessage { 20 | constructor(type, text, args, location) { 21 | this._type = type; 22 | this._text = text; 23 | this._args = args; 24 | this._location = location || {}; 25 | } 26 | type() { 27 | return this._type; 28 | } 29 | text() { 30 | if (this._text === undefined) 31 | this._text = this._args.map(arg => arg._handleToString(false /* includeType */)).join(' '); 32 | return this._text; 33 | } 34 | args() { 35 | return this._args; 36 | } 37 | location() { 38 | return this._location; 39 | } 40 | [util.inspect.custom]() { 41 | return this.text(); 42 | } 43 | } 44 | exports.ConsoleMessage = ConsoleMessage; 45 | //# sourceMappingURL=console.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/debug/crDevTools.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const fs = require("fs"); 19 | const util = require("util"); 20 | const kBindingName = '__pw_devtools__'; 21 | // This class intercepts preferences-related DevTools embedder methods 22 | // and stores preferences as a json file in the browser installation directory. 23 | class CRDevTools { 24 | constructor(preferencesPath) { 25 | this._preferencesPath = preferencesPath; 26 | this._savePromise = Promise.resolve(); 27 | } 28 | async install(session) { 29 | session.on('Runtime.bindingCalled', async (event) => { 30 | if (event.name !== kBindingName) 31 | return; 32 | const parsed = JSON.parse(event.payload); 33 | let result = undefined; 34 | if (this.__testHookOnBinding) 35 | this.__testHookOnBinding(parsed); 36 | if (parsed.method === 'getPreferences') { 37 | if (this._prefs === undefined) { 38 | try { 39 | const json = await util.promisify(fs.readFile)(this._preferencesPath, 'utf8'); 40 | this._prefs = JSON.parse(json); 41 | } 42 | catch (e) { 43 | this._prefs = {}; 44 | } 45 | } 46 | result = this._prefs; 47 | } 48 | else if (parsed.method === 'setPreference') { 49 | this._prefs[parsed.params[0]] = parsed.params[1]; 50 | this._save(); 51 | } 52 | else if (parsed.method === 'removePreference') { 53 | delete this._prefs[parsed.params[0]]; 54 | this._save(); 55 | } 56 | else if (parsed.method === 'clearPreferences') { 57 | this._prefs = {}; 58 | this._save(); 59 | } 60 | session.send('Runtime.evaluate', { 61 | expression: `window.DevToolsAPI.embedderMessageAck(${parsed.id}, ${JSON.stringify(result)})`, 62 | contextId: event.executionContextId 63 | }).catch(e => null); 64 | }); 65 | await Promise.all([ 66 | session.send('Runtime.enable'), 67 | session.send('Runtime.addBinding', { name: kBindingName }), 68 | session.send('Page.enable'), 69 | session.send('Page.addScriptToEvaluateOnNewDocument', { source: ` 70 | (() => { 71 | const init = () => { 72 | // Lazy init happens when InspectorFrontendHost is initialized. 73 | // At this point DevToolsHost is ready to be used. 74 | const host = window.DevToolsHost; 75 | const old = host.sendMessageToEmbedder.bind(host); 76 | host.sendMessageToEmbedder = message => { 77 | if (['getPreferences', 'setPreference', 'removePreference', 'clearPreferences'].includes(JSON.parse(message).method)) 78 | window.${kBindingName}(message); 79 | else 80 | old(message); 81 | }; 82 | }; 83 | let value; 84 | Object.defineProperty(window, 'InspectorFrontendHost', { 85 | configurable: true, 86 | enumerable: true, 87 | get() { return value; }, 88 | set(v) { value = v; init(); }, 89 | }); 90 | })() 91 | ` }), 92 | session.send('Runtime.runIfWaitingForDebugger'), 93 | ]).catch(e => null); 94 | } 95 | _save() { 96 | // Serialize saves to avoid corruption. 97 | this._savePromise = this._savePromise.then(async () => { 98 | await util.promisify(fs.writeFile)(this._preferencesPath, JSON.stringify(this._prefs)).catch(e => null); 99 | }); 100 | } 101 | } 102 | exports.CRDevTools = CRDevTools; 103 | //# sourceMappingURL=crDevTools.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/debug/debugSupport.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const sourceMap = require("./sourceMap"); 19 | const helper_1 = require("../helper"); 20 | const events_1 = require("../events"); 21 | const selectors_1 = require("../selectors"); 22 | let debugMode; 23 | function isDebugMode() { 24 | if (debugMode === undefined) 25 | debugMode = !!helper_1.getFromENV('PLAYWRIGHT_DEBUG_UI'); 26 | return debugMode; 27 | } 28 | exports.isDebugMode = isDebugMode; 29 | let sourceUrlCounter = 0; 30 | const playwrightSourceUrlPrefix = '__playwright_evaluation_script__'; 31 | const sourceUrlRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; 32 | function generateSourceUrl() { 33 | return `\n//# sourceURL=${playwrightSourceUrlPrefix}${sourceUrlCounter++}\n`; 34 | } 35 | exports.generateSourceUrl = generateSourceUrl; 36 | function isPlaywrightSourceUrl(s) { 37 | return s.startsWith(playwrightSourceUrlPrefix); 38 | } 39 | exports.isPlaywrightSourceUrl = isPlaywrightSourceUrl; 40 | function ensureSourceUrl(expression) { 41 | return sourceUrlRegex.test(expression) ? expression : expression + generateSourceUrl(); 42 | } 43 | exports.ensureSourceUrl = ensureSourceUrl; 44 | async function generateSourceMapUrl(functionText, generatedText) { 45 | if (!isDebugMode()) 46 | return generateSourceUrl(); 47 | const sourceMapUrl = await sourceMap.generateSourceMapUrl(functionText, generatedText); 48 | return sourceMapUrl || generateSourceUrl(); 49 | } 50 | exports.generateSourceMapUrl = generateSourceMapUrl; 51 | async function installConsoleHelpers(context) { 52 | if (!isDebugMode()) 53 | return; 54 | const installInFrame = async (frame) => { 55 | try { 56 | const mainContext = await frame._mainContext(); 57 | const injectedScript = await mainContext.injectedScript(); 58 | await injectedScript.evaluate(installPlaywrightObjectOnWindow, selectors_1.parseSelector.toString()); 59 | } 60 | catch (e) { 61 | } 62 | }; 63 | context.on(events_1.Events.BrowserContext.Page, (page) => { 64 | installInFrame(page.mainFrame()); 65 | page.on(events_1.Events.Page.FrameNavigated, installInFrame); 66 | }); 67 | } 68 | exports.installConsoleHelpers = installConsoleHelpers; 69 | function installPlaywrightObjectOnWindow(injectedScript, parseSelectorFunctionString) { 70 | const parseSelector = new Function('...args', 'return (' + parseSelectorFunctionString + ')(...args)'); 71 | const highlightContainer = document.createElement('div'); 72 | highlightContainer.style.cssText = 'position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 10000;'; 73 | function checkSelector(parsed) { 74 | for (const { name } of parsed.parts) { 75 | if (!injectedScript.engines.has(name)) 76 | throw new Error(`Unknown engine "${name}"`); 77 | } 78 | } 79 | function highlightElements(elements = [], target) { 80 | const scrollLeft = document.scrollingElement ? document.scrollingElement.scrollLeft : 0; 81 | const scrollTop = document.scrollingElement ? document.scrollingElement.scrollTop : 0; 82 | highlightContainer.textContent = ''; 83 | for (const element of elements) { 84 | const rect = element.getBoundingClientRect(); 85 | const highlight = document.createElement('div'); 86 | highlight.style.position = 'absolute'; 87 | highlight.style.left = (rect.left + scrollLeft) + 'px'; 88 | highlight.style.top = (rect.top + scrollTop) + 'px'; 89 | highlight.style.height = rect.height + 'px'; 90 | highlight.style.width = rect.width + 'px'; 91 | highlight.style.pointerEvents = 'none'; 92 | if (element === target) { 93 | highlight.style.background = 'hsla(30, 97%, 37%, 0.3)'; 94 | highlight.style.border = '3px solid hsla(30, 97%, 37%, 0.6)'; 95 | } 96 | else { 97 | highlight.style.background = 'hsla(120, 100%, 37%, 0.3)'; 98 | highlight.style.border = '3px solid hsla(120, 100%, 37%, 0.8)'; 99 | } 100 | highlight.style.borderRadius = '3px'; 101 | highlightContainer.appendChild(highlight); 102 | } 103 | document.body.appendChild(highlightContainer); 104 | } 105 | function $(selector) { 106 | if (typeof selector !== 'string') 107 | throw new Error(`Usage: playwright.query('Playwright >> selector').`); 108 | const parsed = parseSelector(selector); 109 | checkSelector(parsed); 110 | const elements = injectedScript.querySelectorAll(parsed, document); 111 | highlightElements(elements, elements[0]); 112 | return elements[0]; 113 | } 114 | function $$(selector) { 115 | if (typeof selector !== 'string') 116 | throw new Error(`Usage: playwright.$$('Playwright >> selector').`); 117 | const parsed = parseSelector(selector); 118 | checkSelector(parsed); 119 | const elements = injectedScript.querySelectorAll(parsed, document); 120 | highlightElements(elements); 121 | return elements; 122 | } 123 | function inspect(selector) { 124 | if (typeof window.inspect !== 'function') 125 | return; 126 | if (typeof selector !== 'string') 127 | throw new Error(`Usage: playwright.inspect('Playwright >> selector').`); 128 | highlightElements(); 129 | window.inspect($(selector)); 130 | } 131 | function clear() { 132 | highlightContainer.remove(); 133 | } 134 | window.playwright = { $, $$, inspect, clear }; 135 | } 136 | //# sourceMappingURL=debugSupport.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/debug/sourceMap.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const fs = require("fs"); 19 | const util = require("util"); 20 | const stackTrace_1 = require("./stackTrace"); 21 | async function generateSourceMapUrl(functionText, generatedText) { 22 | const filePath = stackTrace_1.getCallerFilePath(); 23 | if (!filePath) 24 | return; 25 | try { 26 | const generatedIndex = generatedText.indexOf(functionText); 27 | if (generatedIndex === -1) 28 | return; 29 | const compiledPosition = findPosition(generatedText, generatedIndex); 30 | const source = await util.promisify(fs.readFile)(filePath, 'utf8'); 31 | const sourceIndex = source.indexOf(functionText); 32 | if (sourceIndex === -1) 33 | return; 34 | const sourcePosition = findPosition(source, sourceIndex); 35 | const delta = findPosition(functionText, functionText.length); 36 | const sourceMap = generateSourceMap(filePath, sourcePosition, compiledPosition, delta); 37 | return `\n//# sourceMappingURL=data:application/json;base64,${Buffer.from(sourceMap).toString('base64')}\n`; 38 | } 39 | catch (e) { 40 | } 41 | } 42 | exports.generateSourceMapUrl = generateSourceMapUrl; 43 | const VLQ_BASE_SHIFT = 5; 44 | const VLQ_BASE = 1 << VLQ_BASE_SHIFT; 45 | const VLQ_BASE_MASK = VLQ_BASE - 1; 46 | const VLQ_CONTINUATION_BIT = VLQ_BASE; 47 | const BASE64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 48 | function base64VLQ(value) { 49 | if (value < 0) 50 | value = ((-value) << 1) | 1; 51 | else 52 | value <<= 1; 53 | let result = ''; 54 | do { 55 | let digit = value & VLQ_BASE_MASK; 56 | value >>>= VLQ_BASE_SHIFT; 57 | if (value > 0) 58 | digit |= VLQ_CONTINUATION_BIT; 59 | result += BASE64_DIGITS[digit]; 60 | } while (value > 0); 61 | return result; 62 | } 63 | function generateSourceMap(filePath, sourcePosition, compiledPosition, delta) { 64 | const mappings = []; 65 | let lastCompiled = { line: 0, column: 0 }; 66 | let lastSource = { line: 0, column: 0 }; 67 | for (let line = 0; line < delta.line; line++) { 68 | // We need at least a mapping per line. This will yield an execution line at the start of each line. 69 | // Note: for more granular mapping, we can do word-by-word. 70 | const source = advancePosition(sourcePosition, { line, column: 0 }); 71 | const compiled = advancePosition(compiledPosition, { line, column: 0 }); 72 | while (lastCompiled.line < compiled.line) { 73 | mappings.push(';'); 74 | lastCompiled.line++; 75 | lastCompiled.column = 0; 76 | } 77 | mappings.push(base64VLQ(compiled.column - lastCompiled.column)); 78 | mappings.push(base64VLQ(0)); // Source index. 79 | mappings.push(base64VLQ(source.line - lastSource.line)); 80 | mappings.push(base64VLQ(source.column - lastSource.column)); 81 | lastCompiled = compiled; 82 | lastSource = source; 83 | } 84 | return JSON.stringify({ 85 | version: 3, 86 | sources: ['file://' + filePath], 87 | names: [], 88 | mappings: mappings.join(''), 89 | }); 90 | } 91 | function findPosition(source, offset) { 92 | const result = { line: 0, column: 0 }; 93 | let index = 0; 94 | while (true) { 95 | const newline = source.indexOf('\n', index); 96 | if (newline === -1 || newline >= offset) 97 | break; 98 | result.line++; 99 | index = newline + 1; 100 | } 101 | result.column = offset - index; 102 | return result; 103 | } 104 | function advancePosition(position, delta) { 105 | return { 106 | line: position.line + delta.line, 107 | column: delta.column + (delta.line ? 0 : position.column), 108 | }; 109 | } 110 | //# sourceMappingURL=sourceMap.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/debug/stackTrace.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const path = require("path"); 19 | // NOTE: update this to point to playwright/lib when moving this file. 20 | const PLAYWRIGHT_LIB_PATH = path.normalize(path.join(__dirname, '..')); 21 | const APICOVERAGE = path.normalize(path.join(__dirname, '..', '..', 'test', 'apicoverage')); 22 | function parseStackFrame(frame) { 23 | frame = frame.trim(); 24 | if (!frame.startsWith('at ')) 25 | return null; 26 | frame = frame.substring('at '.length); 27 | if (frame.startsWith('async ')) 28 | frame = frame.substring('async '.length); 29 | let location; 30 | let functionName; 31 | if (frame.endsWith(')')) { 32 | const from = frame.indexOf('('); 33 | location = frame.substring(from + 1, frame.length - 1); 34 | functionName = frame.substring(0, from).trim(); 35 | } 36 | else { 37 | location = frame; 38 | functionName = ''; 39 | } 40 | const match = location.match(/^(?:async )?([^(]*):(\d+):(\d+)$/); 41 | if (!match) 42 | return null; 43 | const filePath = match[1]; 44 | return { filePath, functionName }; 45 | } 46 | function getCallerFilePath(ignorePrefix = PLAYWRIGHT_LIB_PATH) { 47 | const error = new Error(); 48 | const stackFrames = (error.stack || '').split('\n').slice(1); 49 | // Find first stackframe that doesn't point to ignorePrefix. 50 | for (const frame of stackFrames) { 51 | const parsed = parseStackFrame(frame); 52 | if (!parsed) 53 | return null; 54 | if (parsed.filePath.startsWith(ignorePrefix) || parsed.filePath === __filename) 55 | continue; 56 | return parsed.filePath; 57 | } 58 | return null; 59 | } 60 | exports.getCallerFilePath = getCallerFilePath; 61 | function getCurrentApiCall(prefix = PLAYWRIGHT_LIB_PATH) { 62 | const error = new Error(); 63 | const stackFrames = (error.stack || '').split('\n').slice(1); 64 | // Find last stackframe that points to prefix - that should be the api call. 65 | let apiName = ''; 66 | for (const frame of stackFrames) { 67 | const parsed = parseStackFrame(frame); 68 | if (!parsed || (!parsed.filePath.startsWith(prefix) && !parsed.filePath.startsWith(APICOVERAGE) && parsed.filePath !== __filename)) 69 | break; 70 | apiName = parsed.functionName; 71 | } 72 | const parts = apiName.split('.'); 73 | if (parts.length && parts[0].length) { 74 | parts[0] = parts[0][0].toLowerCase() + parts[0].substring(1); 75 | if (parts[0] === 'webKit') 76 | parts[0] = 'webkit'; 77 | } 78 | return parts.join('.'); 79 | } 80 | exports.getCurrentApiCall = getCurrentApiCall; 81 | function rewriteErrorMessage(e, newMessage) { 82 | if (e.stack) { 83 | const index = e.stack.indexOf(e.message); 84 | if (index !== -1) 85 | e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length); 86 | } 87 | e.message = newMessage; 88 | return e; 89 | } 90 | exports.rewriteErrorMessage = rewriteErrorMessage; 91 | //# sourceMappingURL=stackTrace.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/dialog.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const helper_1 = require("./helper"); 20 | class Dialog { 21 | constructor(type, message, onHandle, defaultValue) { 22 | this._handled = false; 23 | this._type = type; 24 | this._message = message; 25 | this._onHandle = onHandle; 26 | this._defaultValue = defaultValue || ''; 27 | } 28 | type() { 29 | return this._type; 30 | } 31 | message() { 32 | return this._message; 33 | } 34 | defaultValue() { 35 | return this._defaultValue; 36 | } 37 | async accept(promptText) { 38 | helper_1.assert(!this._handled, 'Cannot accept dialog which is already handled!'); 39 | this._handled = true; 40 | await this._onHandle(true, promptText); 41 | } 42 | async dismiss() { 43 | helper_1.assert(!this._handled, 'Cannot dismiss dialog which is already handled!'); 44 | this._handled = true; 45 | await this._onHandle(false); 46 | } 47 | } 48 | exports.Dialog = Dialog; 49 | //# sourceMappingURL=dialog.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/download.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const path = require("path"); 19 | const fs = require("fs"); 20 | const util = require("util"); 21 | const events_1 = require("./events"); 22 | const helper_1 = require("./helper"); 23 | class Download { 24 | constructor(page, downloadsPath, uuid, url, suggestedFilename) { 25 | this._failure = null; 26 | this._deleted = false; 27 | this._page = page; 28 | this._downloadsPath = downloadsPath; 29 | this._uuid = uuid; 30 | this._url = url; 31 | this._suggestedFilename = suggestedFilename; 32 | this._finishedCallback = () => { }; 33 | this._finishedPromise = new Promise(f => this._finishedCallback = f); 34 | page._browserContext._downloads.add(this); 35 | this._acceptDownloads = !!this._page._browserContext._options.acceptDownloads; 36 | if (suggestedFilename !== undefined) 37 | this._page.emit(events_1.Events.Page.Download, this); 38 | } 39 | _filenameSuggested(suggestedFilename) { 40 | helper_1.assert(this._suggestedFilename === undefined); 41 | this._suggestedFilename = suggestedFilename; 42 | this._page.emit(events_1.Events.Page.Download, this); 43 | } 44 | url() { 45 | return this._url; 46 | } 47 | suggestedFilename() { 48 | return this._suggestedFilename; 49 | } 50 | async path() { 51 | if (!this._acceptDownloads) 52 | throw new Error('Pass { acceptDownloads: true } when you are creating your browser context.'); 53 | const fileName = path.join(this._downloadsPath, this._uuid); 54 | await this._finishedPromise; 55 | if (this._failure) 56 | return null; 57 | return fileName; 58 | } 59 | async failure() { 60 | if (!this._acceptDownloads) 61 | return 'Pass { acceptDownloads: true } when you are creating your browser context.'; 62 | await this._finishedPromise; 63 | return this._failure; 64 | } 65 | async createReadStream() { 66 | const fileName = await this.path(); 67 | return fileName ? fs.createReadStream(fileName) : null; 68 | } 69 | async delete() { 70 | if (!this._acceptDownloads) 71 | return; 72 | const fileName = await this.path(); 73 | if (this._deleted) 74 | return; 75 | this._deleted = true; 76 | if (fileName) 77 | await util.promisify(fs.unlink)(fileName).catch(e => { }); 78 | } 79 | _reportFinished(error) { 80 | this._failure = error || null; 81 | this._finishedCallback(); 82 | } 83 | } 84 | exports.Download = Download; 85 | //# sourceMappingURL=download.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/errors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2018 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | class CustomError extends Error { 20 | constructor(message) { 21 | super(message); 22 | this.name = this.constructor.name; 23 | Error.captureStackTrace(this, this.constructor); 24 | } 25 | } 26 | class NotConnectedError extends CustomError { 27 | constructor() { 28 | super('Element is not attached to the DOM'); 29 | } 30 | } 31 | exports.NotConnectedError = NotConnectedError; 32 | class TimeoutError extends CustomError { 33 | } 34 | exports.TimeoutError = TimeoutError; 35 | //# sourceMappingURL=errors.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/events.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2019 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | exports.Events = { 20 | Browser: { 21 | Disconnected: 'disconnected' 22 | }, 23 | BrowserContext: { 24 | Close: 'close', 25 | Page: 'page', 26 | }, 27 | BrowserServer: { 28 | Close: 'close', 29 | }, 30 | Page: { 31 | Close: 'close', 32 | Crash: 'crash', 33 | Console: 'console', 34 | Dialog: 'dialog', 35 | Download: 'download', 36 | FileChooser: 'filechooser', 37 | DOMContentLoaded: 'domcontentloaded', 38 | // Can't use just 'error' due to node.js special treatment of error events. 39 | // @see https://nodejs.org/api/events.html#events_error_events 40 | PageError: 'pageerror', 41 | Request: 'request', 42 | Response: 'response', 43 | RequestFailed: 'requestfailed', 44 | RequestFinished: 'requestfinished', 45 | FrameAttached: 'frameattached', 46 | FrameDetached: 'framedetached', 47 | FrameNavigated: 'framenavigated', 48 | Load: 'load', 49 | Popup: 'popup', 50 | Worker: 'worker', 51 | }, 52 | Worker: { 53 | Close: 'close', 54 | }, 55 | }; 56 | //# sourceMappingURL=events.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/extendedEventEmitter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const events_1 = require("events"); 19 | const helper_1 = require("./helper"); 20 | const progress_1 = require("./progress"); 21 | class ExtendedEventEmitter extends events_1.EventEmitter { 22 | _abortPromiseForEvent(event) { 23 | return new Promise(() => void 0); 24 | } 25 | async waitForEvent(event, optionsOrPredicate = {}) { 26 | const options = typeof optionsOrPredicate === 'function' ? { predicate: optionsOrPredicate } : optionsOrPredicate; 27 | const { predicate = () => true } = options; 28 | const progressController = new progress_1.ProgressController(this._getLogger(), this._getTimeoutSettings().timeout(options)); 29 | this._abortPromiseForEvent(event).then(error => progressController.abort(error)); 30 | return progressController.run(async (progress) => { 31 | const listeners = []; 32 | const promise = new Promise((resolve, reject) => { 33 | listeners.push(helper_1.helper.addEventListener(this, event, eventArg => { 34 | try { 35 | if (!predicate(eventArg)) 36 | return; 37 | resolve(eventArg); 38 | } 39 | catch (e) { 40 | reject(e); 41 | } 42 | })); 43 | }); 44 | progress.cleanupWhenAborted(() => helper_1.helper.removeEventListeners(listeners)); 45 | const result = await promise; 46 | helper_1.helper.removeEventListeners(listeners); 47 | return result; 48 | }); 49 | } 50 | } 51 | exports.ExtendedEventEmitter = ExtendedEventEmitter; 52 | //# sourceMappingURL=extendedEventEmitter.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/fileChooser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | class FileChooser { 19 | constructor(page, elementHandle, isMultiple) { 20 | this._page = page; 21 | this._elementHandle = elementHandle; 22 | this._isMultiple = isMultiple; 23 | } 24 | element() { 25 | return this._elementHandle; 26 | } 27 | isMultiple() { 28 | return this._isMultiple; 29 | } 30 | page() { 31 | return this._page; 32 | } 33 | async setFiles(files, options) { 34 | return this._elementHandle.setInputFiles(files, options); 35 | } 36 | } 37 | exports.FileChooser = FileChooser; 38 | //# sourceMappingURL=fileChooser.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/firefox/ffConnection.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const events_1 = require("events"); 20 | const helper_1 = require("../helper"); 21 | const transport_1 = require("../transport"); 22 | const logger_1 = require("../logger"); 23 | const stackTrace_1 = require("../debug/stackTrace"); 24 | exports.ConnectionEvents = { 25 | Disconnected: Symbol('Disconnected'), 26 | }; 27 | // FFPlaywright uses this special id to issue Browser.close command which we 28 | // should ignore. 29 | exports.kBrowserCloseMessageId = -9999; 30 | class FFConnection extends events_1.EventEmitter { 31 | constructor(transport, logger) { 32 | super(); 33 | this._transport = transport; 34 | this._logger = logger; 35 | this._lastId = 0; 36 | this._callbacks = new Map(); 37 | this._transport.onmessage = this._onMessage.bind(this); 38 | this._transport.onclose = this._onClose.bind(this); 39 | this._sessions = new Map(); 40 | this._closed = false; 41 | this.on = super.on; 42 | this.addListener = super.addListener; 43 | this.off = super.removeListener; 44 | this.removeListener = super.removeListener; 45 | this.once = super.once; 46 | } 47 | async send(method, params) { 48 | const id = this.nextMessageId(); 49 | this._rawSend({ id, method, params }); 50 | return new Promise((resolve, reject) => { 51 | this._callbacks.set(id, { resolve, reject, error: new Error(), method }); 52 | }); 53 | } 54 | nextMessageId() { 55 | return ++this._lastId; 56 | } 57 | _rawSend(message) { 58 | if (this._logger._isLogEnabled(transport_1.protocolLog)) 59 | this._logger._log(transport_1.protocolLog, 'SEND ► ' + rewriteInjectedScriptEvaluationLog(message)); 60 | this._transport.send(message); 61 | } 62 | async _onMessage(message) { 63 | if (this._logger._isLogEnabled(transport_1.protocolLog)) 64 | this._logger._log(transport_1.protocolLog, '◀ RECV ' + JSON.stringify(message)); 65 | if (message.id === exports.kBrowserCloseMessageId) 66 | return; 67 | if (message.sessionId) { 68 | const session = this._sessions.get(message.sessionId); 69 | if (session) 70 | session.dispatchMessage(message); 71 | } 72 | else if (message.id) { 73 | const callback = this._callbacks.get(message.id); 74 | // Callbacks could be all rejected if someone has called `.dispose()`. 75 | if (callback) { 76 | this._callbacks.delete(message.id); 77 | if (message.error) 78 | callback.reject(createProtocolError(callback.error, callback.method, message.error)); 79 | else 80 | callback.resolve(message.result); 81 | } 82 | } 83 | else { 84 | Promise.resolve().then(() => this.emit(message.method, message.params)); 85 | } 86 | } 87 | _onClose() { 88 | this._closed = true; 89 | this._transport.onmessage = undefined; 90 | this._transport.onclose = undefined; 91 | for (const callback of this._callbacks.values()) 92 | callback.reject(stackTrace_1.rewriteErrorMessage(callback.error, `Protocol error (${callback.method}): Target closed.`)); 93 | this._callbacks.clear(); 94 | for (const session of this._sessions.values()) 95 | session.dispose(); 96 | this._sessions.clear(); 97 | Promise.resolve().then(() => this.emit(exports.ConnectionEvents.Disconnected)); 98 | } 99 | close() { 100 | if (!this._closed) 101 | this._transport.close(); 102 | } 103 | createSession(sessionId, type) { 104 | const session = new FFSession(this, type, sessionId, message => this._rawSend({ ...message, sessionId })); 105 | this._sessions.set(sessionId, session); 106 | return session; 107 | } 108 | } 109 | exports.FFConnection = FFConnection; 110 | exports.FFSessionEvents = { 111 | Disconnected: Symbol('Disconnected') 112 | }; 113 | class FFSession extends events_1.EventEmitter { 114 | constructor(connection, targetType, sessionId, rawSend) { 115 | super(); 116 | this._disposed = false; 117 | this._crashed = false; 118 | this._callbacks = new Map(); 119 | this._connection = connection; 120 | this._targetType = targetType; 121 | this._sessionId = sessionId; 122 | this._rawSend = rawSend; 123 | this.on = super.on; 124 | this.addListener = super.addListener; 125 | this.off = super.removeListener; 126 | this.removeListener = super.removeListener; 127 | this.once = super.once; 128 | } 129 | markAsCrashed() { 130 | this._crashed = true; 131 | } 132 | async send(method, params) { 133 | if (this._crashed) 134 | throw new Error('Page crashed'); 135 | if (this._disposed) 136 | throw new Error(`Protocol error (${method}): Session closed. Most likely the ${this._targetType} has been closed.`); 137 | const id = this._connection.nextMessageId(); 138 | this._rawSend({ method, params, id }); 139 | return new Promise((resolve, reject) => { 140 | this._callbacks.set(id, { resolve, reject, error: new Error(), method }); 141 | }); 142 | } 143 | sendMayFail(method, params) { 144 | return this.send(method, params).catch(error => { 145 | this._connection._logger._log(logger_1.errorLog, error, []); 146 | }); 147 | } 148 | dispatchMessage(object) { 149 | if (object.id && this._callbacks.has(object.id)) { 150 | const callback = this._callbacks.get(object.id); 151 | this._callbacks.delete(object.id); 152 | if (object.error) 153 | callback.reject(createProtocolError(callback.error, callback.method, object.error)); 154 | else 155 | callback.resolve(object.result); 156 | } 157 | else { 158 | helper_1.assert(!object.id); 159 | Promise.resolve().then(() => this.emit(object.method, object.params)); 160 | } 161 | } 162 | dispose() { 163 | for (const callback of this._callbacks.values()) 164 | callback.reject(stackTrace_1.rewriteErrorMessage(callback.error, `Protocol error (${callback.method}): Target closed.`)); 165 | this._callbacks.clear(); 166 | this._disposed = true; 167 | this._connection._sessions.delete(this._sessionId); 168 | Promise.resolve().then(() => this.emit(exports.FFSessionEvents.Disconnected)); 169 | } 170 | } 171 | exports.FFSession = FFSession; 172 | function createProtocolError(error, method, protocolError) { 173 | let message = `Protocol error (${method}): ${protocolError.message}`; 174 | if ('data' in protocolError) 175 | message += ` ${protocolError.data}`; 176 | return stackTrace_1.rewriteErrorMessage(error, message); 177 | } 178 | function rewriteInjectedScriptEvaluationLog(message) { 179 | // Injected script is very long and clutters protocol logs. 180 | // To increase development velocity, we skip replace it with short description in the log. 181 | if (message.method === 'Runtime.evaluate' && message.params && message.params.expression && message.params.expression.includes('src/injected/injected.ts')) 182 | return `{"id":${message.id} [evaluate injected script]}`; 183 | return JSON.stringify(message); 184 | } 185 | //# sourceMappingURL=ffConnection.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/firefox/ffExecutionContext.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2019 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const js = require("../javascript"); 20 | const debugSupport = require("../debug/debugSupport"); 21 | const stackTrace_1 = require("../debug/stackTrace"); 22 | const utilityScriptSerializers_1 = require("../utilityScriptSerializers"); 23 | class FFExecutionContext { 24 | constructor(session, executionContextId) { 25 | this._session = session; 26 | this._executionContextId = executionContextId; 27 | } 28 | async rawEvaluate(expression) { 29 | const payload = await this._session.send('Runtime.evaluate', { 30 | expression: debugSupport.ensureSourceUrl(expression), 31 | returnByValue: false, 32 | executionContextId: this._executionContextId, 33 | }).catch(rewriteError); 34 | checkException(payload.exceptionDetails); 35 | return payload.result.objectId; 36 | } 37 | async evaluateWithArguments(expression, returnByValue, utilityScript, values, objectIds) { 38 | const payload = await this._session.send('Runtime.callFunction', { 39 | functionDeclaration: expression, 40 | args: [ 41 | { objectId: utilityScript._objectId, value: undefined }, 42 | ...values.map(value => ({ value })), 43 | ...objectIds.map(objectId => ({ objectId, value: undefined })), 44 | ], 45 | returnByValue, 46 | executionContextId: this._executionContextId 47 | }).catch(rewriteError); 48 | checkException(payload.exceptionDetails); 49 | if (returnByValue) 50 | return utilityScriptSerializers_1.parseEvaluationResultValue(payload.result.value); 51 | return utilityScript._context.createHandle(payload.result); 52 | } 53 | async getProperties(handle) { 54 | const objectId = handle._objectId; 55 | if (!objectId) 56 | return new Map(); 57 | const response = await this._session.send('Runtime.getObjectProperties', { 58 | executionContextId: this._executionContextId, 59 | objectId, 60 | }); 61 | const result = new Map(); 62 | for (const property of response.properties) 63 | result.set(property.name, handle._context.createHandle(property.value)); 64 | return result; 65 | } 66 | createHandle(context, remoteObject) { 67 | return new js.JSHandle(context, remoteObject.subtype || remoteObject.type || '', remoteObject.objectId, potentiallyUnserializableValue(remoteObject)); 68 | } 69 | async releaseHandle(handle) { 70 | if (!handle._objectId) 71 | return; 72 | await this._session.send('Runtime.disposeObject', { 73 | executionContextId: this._executionContextId, 74 | objectId: handle._objectId, 75 | }).catch(error => { }); 76 | } 77 | } 78 | exports.FFExecutionContext = FFExecutionContext; 79 | function checkException(exceptionDetails) { 80 | if (!exceptionDetails) 81 | return; 82 | if (exceptionDetails.value) 83 | throw new Error('Evaluation failed: ' + JSON.stringify(exceptionDetails.value)); 84 | else 85 | throw new Error('Evaluation failed: ' + exceptionDetails.text + '\n' + exceptionDetails.stack); 86 | } 87 | function rewriteError(error) { 88 | if (error.message.includes('cyclic object value') || error.message.includes('Object is not serializable')) 89 | return { result: { type: 'undefined', value: undefined } }; 90 | if (error.message.includes('Failed to find execution context with id') || error.message.includes('Execution context was destroyed!')) 91 | throw new Error('Execution context was destroyed, most likely because of a navigation.'); 92 | if (error instanceof TypeError && error.message.startsWith('Converting circular structure to JSON')) 93 | stackTrace_1.rewriteErrorMessage(error, error.message + ' Are you passing a nested JSHandle?'); 94 | throw error; 95 | } 96 | function potentiallyUnserializableValue(remoteObject) { 97 | const value = remoteObject.value; 98 | const unserializableValue = remoteObject.unserializableValue; 99 | return unserializableValue ? js.parseUnserializableValue(unserializableValue) : value; 100 | } 101 | //# sourceMappingURL=ffExecutionContext.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/firefox/ffInput.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | function toModifiersMask(modifiers) { 20 | let mask = 0; 21 | if (modifiers.has('Alt')) 22 | mask |= 1; 23 | if (modifiers.has('Control')) 24 | mask |= 2; 25 | if (modifiers.has('Shift')) 26 | mask |= 4; 27 | if (modifiers.has('Meta')) 28 | mask |= 8; 29 | return mask; 30 | } 31 | function toButtonNumber(button) { 32 | if (button === 'left') 33 | return 0; 34 | if (button === 'middle') 35 | return 1; 36 | if (button === 'right') 37 | return 2; 38 | return 0; 39 | } 40 | function toButtonsMask(buttons) { 41 | let mask = 0; 42 | if (buttons.has('left')) 43 | mask |= 1; 44 | if (buttons.has('right')) 45 | mask |= 2; 46 | if (buttons.has('middle')) 47 | mask |= 4; 48 | return mask; 49 | } 50 | class RawKeyboardImpl { 51 | constructor(client) { 52 | this._client = client; 53 | } 54 | async keydown(modifiers, code, keyCode, keyCodeWithoutLocation, key, location, autoRepeat, text) { 55 | if (code === 'MetaLeft') 56 | code = 'OSLeft'; 57 | if (code === 'MetaRight') 58 | code = 'OSRight'; 59 | // Firefox will figure out Enter by itself 60 | if (text === '\r') 61 | text = ''; 62 | await this._client.send('Page.dispatchKeyEvent', { 63 | type: 'keydown', 64 | keyCode: keyCodeWithoutLocation, 65 | code, 66 | key, 67 | repeat: autoRepeat, 68 | location, 69 | text, 70 | }); 71 | } 72 | async keyup(modifiers, code, keyCode, keyCodeWithoutLocation, key, location) { 73 | if (code === 'MetaLeft') 74 | code = 'OSLeft'; 75 | if (code === 'MetaRight') 76 | code = 'OSRight'; 77 | await this._client.send('Page.dispatchKeyEvent', { 78 | type: 'keyup', 79 | key, 80 | keyCode: keyCodeWithoutLocation, 81 | code, 82 | location, 83 | repeat: false 84 | }); 85 | } 86 | async sendText(text) { 87 | await this._client.send('Page.insertText', { text }); 88 | } 89 | } 90 | exports.RawKeyboardImpl = RawKeyboardImpl; 91 | class RawMouseImpl { 92 | constructor(client) { 93 | this._client = client; 94 | } 95 | async move(x, y, button, buttons, modifiers) { 96 | await this._client.send('Page.dispatchMouseEvent', { 97 | type: 'mousemove', 98 | button: 0, 99 | buttons: toButtonsMask(buttons), 100 | x, 101 | y, 102 | modifiers: toModifiersMask(modifiers) 103 | }); 104 | } 105 | async down(x, y, button, buttons, modifiers, clickCount) { 106 | await this._client.send('Page.dispatchMouseEvent', { 107 | type: 'mousedown', 108 | button: toButtonNumber(button), 109 | buttons: toButtonsMask(buttons), 110 | x, 111 | y, 112 | modifiers: toModifiersMask(modifiers), 113 | clickCount 114 | }); 115 | } 116 | async up(x, y, button, buttons, modifiers, clickCount) { 117 | await this._client.send('Page.dispatchMouseEvent', { 118 | type: 'mouseup', 119 | button: toButtonNumber(button), 120 | buttons: toButtonsMask(buttons), 121 | x, 122 | y, 123 | modifiers: toModifiersMask(modifiers), 124 | clickCount 125 | }); 126 | } 127 | } 128 | exports.RawMouseImpl = RawMouseImpl; 129 | //# sourceMappingURL=ffInput.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/hints.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const hintsLog = { 19 | name: 'hint', 20 | severity: 'warning' 21 | }; 22 | let waitForTimeoutWasUsedReported = false; 23 | function waitForTimeoutWasUsed(page) { 24 | if (waitForTimeoutWasUsedReported) 25 | return; 26 | waitForTimeoutWasUsedReported = true; 27 | page._log(hintsLog, `WARNING: page.waitForTimeout(timeout) should only be used for debugging. 28 | Tests using the timer in production are going to be flaky. 29 | Use signals such as network events, selectors becoming visible, etc. instead.`); 30 | } 31 | exports.waitForTimeoutWasUsed = waitForTimeoutWasUsed; 32 | //# sourceMappingURL=hints.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/install/browserPaths.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const child_process_1 = require("child_process"); 20 | const os = require("os"); 21 | const path = require("path"); 22 | const helper_1 = require("../helper"); 23 | exports.hostPlatform = (() => { 24 | const platform = os.platform(); 25 | if (platform === 'darwin') { 26 | const macVersion = child_process_1.execSync('sw_vers -productVersion').toString('utf8').trim().split('.').slice(0, 2).join('.'); 27 | return `mac${macVersion}`; 28 | } 29 | if (platform === 'linux') 30 | return 'linux'; 31 | if (platform === 'win32') 32 | return os.arch() === 'x64' ? 'win64' : 'win32'; 33 | return platform; 34 | })(); 35 | function executablePath(browserPath, browser) { 36 | let tokens; 37 | if (browser.name === 'chromium') { 38 | tokens = new Map([ 39 | ['linux', ['chrome-linux', 'chrome']], 40 | ['mac10.13', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']], 41 | ['mac10.14', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']], 42 | ['mac10.15', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']], 43 | ['win32', ['chrome-win', 'chrome.exe']], 44 | ['win64', ['chrome-win', 'chrome.exe']], 45 | ]).get(exports.hostPlatform); 46 | } 47 | if (browser.name === 'firefox') { 48 | tokens = new Map([ 49 | ['linux', ['firefox', 'firefox']], 50 | ['mac10.13', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']], 51 | ['mac10.14', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']], 52 | ['mac10.15', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']], 53 | ['win32', ['firefox', 'firefox.exe']], 54 | ['win64', ['firefox', 'firefox.exe']], 55 | ]).get(exports.hostPlatform); 56 | } 57 | if (browser.name === 'webkit') { 58 | tokens = new Map([ 59 | ['linux', ['pw_run.sh']], 60 | ['mac10.13', undefined], 61 | ['mac10.14', ['pw_run.sh']], 62 | ['mac10.15', ['pw_run.sh']], 63 | ['win32', ['Playwright.exe']], 64 | ['win64', ['Playwright.exe']], 65 | ]).get(exports.hostPlatform); 66 | } 67 | return tokens ? path.join(browserPath, ...tokens) : undefined; 68 | } 69 | exports.executablePath = executablePath; 70 | function cacheDirectory() { 71 | if (process.platform === 'linux') 72 | return process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache'); 73 | if (process.platform === 'darwin') 74 | return path.join(os.homedir(), 'Library', 'Caches'); 75 | if (process.platform === 'win32') 76 | return process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local'); 77 | throw new Error('Unsupported platform: ' + process.platform); 78 | } 79 | const defaultBrowsersPath = (() => { 80 | const envDefined = helper_1.getFromENV('PLAYWRIGHT_BROWSERS_PATH'); 81 | if (envDefined === '0') 82 | return undefined; 83 | return envDefined || path.join(cacheDirectory(), 'ms-playwright'); 84 | })(); 85 | function browsersPath(packagePath) { 86 | return defaultBrowsersPath || path.join(packagePath, '.local-browsers'); 87 | } 88 | exports.browsersPath = browsersPath; 89 | function browserDirectory(browsersPath, browser) { 90 | return path.join(browsersPath, `${browser.name}-${browser.revision}`); 91 | } 92 | exports.browserDirectory = browserDirectory; 93 | function isBrowserDirectory(browserPath) { 94 | const baseName = path.basename(browserPath); 95 | return baseName.startsWith('chromium-') || baseName.startsWith('firefox-') || baseName.startsWith('webkit-'); 96 | } 97 | exports.isBrowserDirectory = isBrowserDirectory; 98 | //# sourceMappingURL=browserPaths.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/install/installer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright Microsoft Corporation. All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const crypto = require("crypto"); 19 | const helper_1 = require("../helper"); 20 | const fs = require("fs"); 21 | const path = require("path"); 22 | const util = require("util"); 23 | const removeFolder = require("rimraf"); 24 | const browserPaths = require("../install/browserPaths"); 25 | const browserFetcher = require("../install/browserFetcher"); 26 | const fsMkdirAsync = util.promisify(fs.mkdir.bind(fs)); 27 | const fsReaddirAsync = util.promisify(fs.readdir.bind(fs)); 28 | const fsReadFileAsync = util.promisify(fs.readFile.bind(fs)); 29 | const fsUnlinkAsync = util.promisify(fs.unlink.bind(fs)); 30 | const fsWriteFileAsync = util.promisify(fs.writeFile.bind(fs)); 31 | const removeFolderAsync = util.promisify(removeFolder); 32 | async function installBrowsersWithProgressBar(packagePath) { 33 | const browsersPath = browserPaths.browsersPath(packagePath); 34 | const linksDir = path.join(browsersPath, '.links'); 35 | if (helper_1.getFromENV('PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD')) { 36 | helper_1.logPolitely('Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set'); 37 | return false; 38 | } 39 | await fsMkdirAsync(linksDir, { recursive: true }); 40 | await fsWriteFileAsync(path.join(linksDir, sha1(packagePath)), packagePath); 41 | await validateCache(packagePath, browsersPath, linksDir); 42 | } 43 | exports.installBrowsersWithProgressBar = installBrowsersWithProgressBar; 44 | async function validateCache(packagePath, browsersPath, linksDir) { 45 | // 1. Collect unused downloads and package descriptors. 46 | const allBrowsers = []; 47 | for (const fileName of await fsReaddirAsync(linksDir)) { 48 | const linkPath = path.join(linksDir, fileName); 49 | let linkTarget = ''; 50 | try { 51 | linkTarget = (await fsReadFileAsync(linkPath)).toString(); 52 | const browsers = JSON.parse((await fsReadFileAsync(path.join(linkTarget, 'browsers.json'))).toString())['browsers']; 53 | allBrowsers.push(...browsers); 54 | } 55 | catch (e) { 56 | if (linkTarget) 57 | helper_1.logPolitely('Failed to process descriptor at ' + linkTarget); 58 | await fsUnlinkAsync(linkPath).catch(e => { }); 59 | } 60 | } 61 | // 2. Delete all unused browsers. 62 | let downloadedBrowsers = (await fsReaddirAsync(browsersPath)).map(file => path.join(browsersPath, file)); 63 | downloadedBrowsers = downloadedBrowsers.filter(file => browserPaths.isBrowserDirectory(file)); 64 | const directories = new Set(downloadedBrowsers); 65 | for (const browser of allBrowsers) 66 | directories.delete(browserPaths.browserDirectory(browsersPath, browser)); 67 | for (const directory of directories) { 68 | helper_1.logPolitely('Removing unused browser at ' + directory); 69 | await removeFolderAsync(directory).catch(e => { }); 70 | } 71 | // 3. Install missing browsers for this package. 72 | const myBrowsers = JSON.parse((await fsReadFileAsync(path.join(packagePath, 'browsers.json'))).toString())['browsers']; 73 | for (const browser of myBrowsers) { 74 | const browserPath = browserPaths.browserDirectory(browsersPath, browser); 75 | await browserFetcher.downloadBrowserWithProgressBar(browserPath, browser); 76 | } 77 | } 78 | function sha1(data) { 79 | const sum = crypto.createHash('sha1'); 80 | sum.update(data); 81 | return sum.digest('hex'); 82 | } 83 | //# sourceMappingURL=installer.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/javascript.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const utilityScriptSource = require("./generated/utilityScriptSource"); 19 | const debugSupport = require("./debug/debugSupport"); 20 | const utilityScriptSerializers_1 = require("./utilityScriptSerializers"); 21 | const helper_1 = require("./helper"); 22 | class ExecutionContext { 23 | constructor(delegate, logger) { 24 | this._delegate = delegate; 25 | this._logger = logger; 26 | } 27 | adoptIfNeeded(handle) { 28 | return null; 29 | } 30 | utilityScript() { 31 | if (!this._utilityScriptPromise) { 32 | const source = `new (${utilityScriptSource.source})()`; 33 | this._utilityScriptPromise = this._delegate.rawEvaluate(source).then(objectId => new JSHandle(this, 'object', objectId)); 34 | } 35 | return this._utilityScriptPromise; 36 | } 37 | createHandle(remoteObject) { 38 | return this._delegate.createHandle(this, remoteObject); 39 | } 40 | } 41 | exports.ExecutionContext = ExecutionContext; 42 | class JSHandle { 43 | constructor(context, type, objectId, value) { 44 | this._disposed = false; 45 | this._context = context; 46 | this._objectId = objectId; 47 | this._value = value; 48 | this._objectType = type; 49 | } 50 | async evaluate(pageFunction, arg) { 51 | return evaluate(this._context, true /* returnByValue */, pageFunction, this, arg); 52 | } 53 | async evaluateHandle(pageFunction, arg) { 54 | return evaluate(this._context, false /* returnByValue */, pageFunction, this, arg); 55 | } 56 | async getProperty(propertyName) { 57 | const objectHandle = await this.evaluateHandle((object, propertyName) => { 58 | const result = { __proto__: null }; 59 | result[propertyName] = object[propertyName]; 60 | return result; 61 | }, propertyName); 62 | const properties = await objectHandle.getProperties(); 63 | const result = properties.get(propertyName); 64 | objectHandle.dispose(); 65 | return result; 66 | } 67 | getProperties() { 68 | return this._context._delegate.getProperties(this); 69 | } 70 | async jsonValue() { 71 | if (!this._objectId) 72 | return this._value; 73 | const utilityScript = await this._context.utilityScript(); 74 | const script = `(utilityScript, ...args) => utilityScript.jsonValue(...args)` + debugSupport.generateSourceUrl(); 75 | return this._context._delegate.evaluateWithArguments(script, true, utilityScript, [true], [this._objectId]); 76 | } 77 | asElement() { 78 | return null; 79 | } 80 | async dispose() { 81 | if (this._disposed) 82 | return; 83 | this._disposed = true; 84 | await this._context._delegate.releaseHandle(this); 85 | } 86 | _handleToString(includeType) { 87 | if (this._objectId) 88 | return 'JSHandle@' + this._objectType; 89 | return (includeType ? 'JSHandle:' : '') + this._value; 90 | } 91 | toString() { 92 | return this._handleToString(true); 93 | } 94 | } 95 | exports.JSHandle = JSHandle; 96 | async function evaluate(context, returnByValue, pageFunction, ...args) { 97 | const utilityScript = await context.utilityScript(); 98 | if (helper_1.helper.isString(pageFunction)) { 99 | const script = `(utilityScript, ...args) => utilityScript.evaluate(...args)` + debugSupport.generateSourceUrl(); 100 | return context._delegate.evaluateWithArguments(script, returnByValue, utilityScript, [returnByValue, debugSupport.ensureSourceUrl(pageFunction)], []); 101 | } 102 | if (typeof pageFunction !== 'function') 103 | throw new Error(`Expected to get |string| or |function| as the first argument, but got "${pageFunction}" instead.`); 104 | const originalText = pageFunction.toString(); 105 | let functionText = originalText; 106 | try { 107 | new Function('(' + functionText + ')'); 108 | } 109 | catch (e1) { 110 | // This means we might have a function shorthand. Try another 111 | // time prefixing 'function '. 112 | if (functionText.startsWith('async ')) 113 | functionText = 'async function ' + functionText.substring('async '.length); 114 | else 115 | functionText = 'function ' + functionText; 116 | try { 117 | new Function('(' + functionText + ')'); 118 | } 119 | catch (e2) { 120 | // We tried hard to serialize, but there's a weird beast here. 121 | throw new Error('Passed function is not well-serializable!'); 122 | } 123 | } 124 | const handles = []; 125 | const toDispose = []; 126 | const pushHandle = (handle) => { 127 | handles.push(handle); 128 | return handles.length - 1; 129 | }; 130 | args = args.map(arg => utilityScriptSerializers_1.serializeAsCallArgument(arg, (handle) => { 131 | if (handle instanceof JSHandle) { 132 | if (!handle._objectId) 133 | return { fallThrough: handle._value }; 134 | if (handle._disposed) 135 | throw new Error('JSHandle is disposed!'); 136 | const adopted = context.adoptIfNeeded(handle); 137 | if (adopted === null) 138 | return { h: pushHandle(Promise.resolve(handle)) }; 139 | toDispose.push(adopted); 140 | return { h: pushHandle(adopted) }; 141 | } 142 | return { fallThrough: handle }; 143 | })); 144 | const utilityScriptObjectIds = []; 145 | for (const handle of await Promise.all(handles)) { 146 | if (handle._context !== context) 147 | throw new Error('JSHandles can be evaluated only in the context they were created!'); 148 | utilityScriptObjectIds.push(handle._objectId); 149 | } 150 | functionText += await debugSupport.generateSourceMapUrl(originalText, functionText); 151 | // See UtilityScript for arguments. 152 | const utilityScriptValues = [returnByValue, functionText, args.length, ...args]; 153 | const script = `(utilityScript, ...args) => utilityScript.callFunction(...args)` + debugSupport.generateSourceUrl(); 154 | try { 155 | return context._delegate.evaluateWithArguments(script, returnByValue, utilityScript, utilityScriptValues, utilityScriptObjectIds); 156 | } 157 | finally { 158 | toDispose.map(handlePromise => handlePromise.then(handle => handle.dispose())); 159 | } 160 | } 161 | exports.evaluate = evaluate; 162 | function parseUnserializableValue(unserializableValue) { 163 | if (unserializableValue === 'NaN') 164 | return NaN; 165 | if (unserializableValue === 'Infinity') 166 | return Infinity; 167 | if (unserializableValue === '-Infinity') 168 | return -Infinity; 169 | if (unserializableValue === '-0') 170 | return -0; 171 | } 172 | exports.parseUnserializableValue = parseUnserializableValue; 173 | //# sourceMappingURL=javascript.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/logger.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright Microsoft Corporation. All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const debug = require("debug"); 19 | exports.errorLog = { name: 'generic', severity: 'error' }; 20 | exports.apiLog = { name: 'api', color: 'cyan' }; 21 | function logError(logger) { 22 | return error => logger._log(exports.errorLog, error, []); 23 | } 24 | exports.logError = logError; 25 | class RootLogger { 26 | constructor(userSink) { 27 | this._logger = new MultiplexingLogger(); 28 | if (userSink) 29 | this._logger.add('user', userSink); 30 | this._logger.add('debug', new DebugLogger()); 31 | } 32 | _isLogEnabled(log) { 33 | return this._logger.isEnabled(log.name, log.severity || 'info'); 34 | } 35 | _log(log, message, ...args) { 36 | if (this._logger.isEnabled(log.name, log.severity || 'info')) 37 | this._logger.log(log.name, log.severity || 'info', message, args, log.color ? { color: log.color } : {}); 38 | } 39 | } 40 | exports.RootLogger = RootLogger; 41 | const colorMap = new Map([ 42 | ['red', 160], 43 | ['green', 34], 44 | ['yellow', 172], 45 | ['blue', 33], 46 | ['magenta', 207], 47 | ['cyan', 45], 48 | ['reset', 0], 49 | ]); 50 | class MultiplexingLogger { 51 | constructor() { 52 | this._loggers = new Map(); 53 | } 54 | add(id, logger) { 55 | this._loggers.set(id, logger); 56 | } 57 | get(id) { 58 | return this._loggers.get(id); 59 | } 60 | remove(id) { 61 | this._loggers.delete(id); 62 | } 63 | isEnabled(name, severity) { 64 | for (const logger of this._loggers.values()) { 65 | if (logger.isEnabled(name, severity)) 66 | return true; 67 | } 68 | return false; 69 | } 70 | log(name, severity, message, args, hints) { 71 | for (const logger of this._loggers.values()) 72 | logger.log(name, severity, message, args, hints); 73 | } 74 | } 75 | class DebugLogger { 76 | constructor() { 77 | this._debuggers = new Map(); 78 | } 79 | isEnabled(name, severity) { 80 | return debug.enabled(`pw:${name}`); 81 | } 82 | log(name, severity, message, args, hints) { 83 | let cachedDebugger = this._debuggers.get(name); 84 | if (!cachedDebugger) { 85 | cachedDebugger = debug(`pw:${name}`); 86 | this._debuggers.set(name, cachedDebugger); 87 | let color = hints.color || 'reset'; 88 | switch (severity) { 89 | case 'error': 90 | color = 'red'; 91 | break; 92 | case 'warning': 93 | color = 'yellow'; 94 | break; 95 | } 96 | const escaped = colorMap.get(color) || 0; 97 | if (escaped) 98 | cachedDebugger.color = String(escaped); 99 | } 100 | cachedDebugger(message, ...args); 101 | } 102 | } 103 | //# sourceMappingURL=logger.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/macEditingCommands.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | exports.macEditingCommands = { 20 | 'Backspace': 'deleteBackward:', 21 | 'Tab': 'insertTab:', 22 | 'Enter': 'insertNewline:', 23 | 'NumpadEnter': 'insertNewline:', 24 | 'Escape': 'cancelOperation:', 25 | 'ArrowUp': 'moveUp:', 26 | 'ArrowDown': 'moveDown:', 27 | 'ArrowLeft': 'moveLeft:', 28 | 'ArrowRight': 'moveRight:', 29 | 'F5': 'complete:', 30 | 'Delete': 'deleteForward:', 31 | 'Home': 'scrollToBeginningOfDocument:', 32 | 'End': 'scrollToEndOfDocument:', 33 | 'PageUp': 'scrollPageUp:', 34 | 'PageDown': 'scrollPageDown:', 35 | 'Shift+Backspace': 'deleteBackward:', 36 | 'Shift+Enter': 'insertNewline:', 37 | 'Shift+NumpadEnter': 'insertNewline:', 38 | 'Shift+Tab': 'insertBacktab:', 39 | 'Shift+Escape': 'cancelOperation:', 40 | 'Shift+ArrowUp': 'moveUpAndModifySelection:', 41 | 'Shift+ArrowDown': 'moveDownAndModifySelection:', 42 | 'Shift+ArrowLeft': 'moveLeftAndModifySelection:', 43 | 'Shift+ArrowRight': 'moveRightAndModifySelection:', 44 | 'Shift+F5': 'complete:', 45 | 'Shift+Delete': 'deleteForward:', 46 | 'Shift+Home': 'moveToBeginningOfDocumentAndModifySelection:', 47 | 'Shift+End': 'moveToEndOfDocumentAndModifySelection:', 48 | 'Shift+PageUp': 'pageUpAndModifySelection:', 49 | 'Shift+PageDown': 'pageDownAndModifySelection:', 50 | 'Shift+Numpad5': 'delete:', 51 | 'Control+Tab': 'selectNextKeyView:', 52 | 'Control+Enter': 'insertLineBreak:', 53 | 'Control+NumpadEnter': 'insertLineBreak:', 54 | 'Control+Quote': 'insertSingleQuoteIgnoringSubstitution:', 55 | 'Control+KeyA': 'moveToBeginningOfParagraph:', 56 | 'Control+KeyB': 'moveBackward:', 57 | 'Control+KeyD': 'deleteForward:', 58 | 'Control+KeyE': 'moveToEndOfParagraph:', 59 | 'Control+KeyF': 'moveForward:', 60 | 'Control+KeyH': 'deleteBackward:', 61 | 'Control+KeyK': 'deleteToEndOfParagraph:', 62 | 'Control+KeyL': 'centerSelectionInVisibleArea:', 63 | 'Control+KeyN': 'moveDown:', 64 | 'Control+KeyO': ['insertNewlineIgnoringFieldEditor:', 'moveBackward:'], 65 | 'Control+KeyP': 'moveUp:', 66 | 'Control+KeyT': 'transpose:', 67 | 'Control+KeyV': 'pageDown:', 68 | 'Control+KeyY': 'yank:', 69 | 'Control+Backspace': 'deleteBackwardByDecomposingPreviousCharacter:', 70 | 'Control+ArrowUp': 'scrollPageUp:', 71 | 'Control+ArrowDown': 'scrollPageDown:', 72 | 'Control+ArrowLeft': 'moveToLeftEndOfLine:', 73 | 'Control+ArrowRight': 'moveToRightEndOfLine:', 74 | 'Shift+Control+Enter': 'insertLineBreak:', 75 | 'Shift+Control+NumpadEnter': 'insertLineBreak:', 76 | 'Shift+Control+Tab': 'selectPreviousKeyView:', 77 | 'Shift+Control+Quote': 'insertDoubleQuoteIgnoringSubstitution:', 78 | 'Shift+Control+KeyA': 'moveToBeginningOfParagraphAndModifySelection:', 79 | 'Shift+Control+KeyB': 'moveBackwardAndModifySelection:', 80 | 'Shift+Control+KeyE': 'moveToEndOfParagraphAndModifySelection:', 81 | 'Shift+Control+KeyF': 'moveForwardAndModifySelection:', 82 | 'Shift+Control+KeyN': 'moveDownAndModifySelection:', 83 | 'Shift+Control+KeyP': 'moveUpAndModifySelection:', 84 | 'Shift+Control+KeyV': 'pageDownAndModifySelection:', 85 | 'Shift+Control+Backspace': 'deleteBackwardByDecomposingPreviousCharacter:', 86 | 'Shift+Control+ArrowUp': 'scrollPageUp:', 87 | 'Shift+Control+ArrowDown': 'scrollPageDown:', 88 | 'Shift+Control+ArrowLeft': 'moveToLeftEndOfLineAndModifySelection:', 89 | 'Shift+Control+ArrowRight': 'moveToRightEndOfLineAndModifySelection:', 90 | 'Alt+Backspace': 'deleteWordBackward:', 91 | 'Alt+Tab': 'insertTabIgnoringFieldEditor:', 92 | 'Alt+Enter': 'insertNewlineIgnoringFieldEditor:', 93 | 'Alt+NumpadEnter': 'insertNewlineIgnoringFieldEditor:', 94 | 'Alt+Escape': 'complete:', 95 | 'Alt+ArrowUp': ['moveBackward:', 'moveToBeginningOfParagraph:'], 96 | 'Alt+ArrowDown': ['moveForward:', 'moveToEndOfParagraph:'], 97 | 'Alt+ArrowLeft': 'moveWordLeft:', 98 | 'Alt+ArrowRight': 'moveWordRight:', 99 | 'Alt+Delete': 'deleteWordForward:', 100 | 'Alt+PageUp': 'pageUp:', 101 | 'Alt+PageDown': 'pageDown:', 102 | 'Shift+Alt+Backspace': 'deleteWordBackward:', 103 | 'Shift+Alt+Tab': 'insertTabIgnoringFieldEditor:', 104 | 'Shift+Alt+Enter': 'insertNewlineIgnoringFieldEditor:', 105 | 'Shift+Alt+NumpadEnter': 'insertNewlineIgnoringFieldEditor:', 106 | 'Shift+Alt+Escape': 'complete:', 107 | 'Shift+Alt+ArrowUp': 'moveParagraphBackwardAndModifySelection:', 108 | 'Shift+Alt+ArrowDown': 'moveParagraphForwardAndModifySelection:', 109 | 'Shift+Alt+ArrowLeft': 'moveWordLeftAndModifySelection:', 110 | 'Shift+Alt+ArrowRight': 'moveWordRightAndModifySelection:', 111 | 'Shift+Alt+Delete': 'deleteWordForward:', 112 | 'Shift+Alt+PageUp': 'pageUp:', 113 | 'Shift+Alt+PageDown': 'pageDown:', 114 | 'Control+Alt+KeyB': 'moveWordBackward:', 115 | 'Control+Alt+KeyF': 'moveWordForward:', 116 | 'Control+Alt+Backspace': 'deleteWordBackward:', 117 | 'Shift+Control+Alt+KeyB': 'moveWordBackwardAndModifySelection:', 118 | 'Shift+Control+Alt+KeyF': 'moveWordForwardAndModifySelection:', 119 | 'Shift+Control+Alt+Backspace': 'deleteWordBackward:', 120 | 'Meta+NumpadSubtract': 'cancel:', 121 | 'Meta+Backspace': 'deleteToBeginningOfLine:', 122 | 'Meta+ArrowUp': 'moveToBeginningOfDocument:', 123 | 'Meta+ArrowDown': 'moveToEndOfDocument:', 124 | 'Meta+ArrowLeft': 'moveToLeftEndOfLine:', 125 | 'Meta+ArrowRight': 'moveToRightEndOfLine:', 126 | 'Shift+Meta+NumpadSubtract': 'cancel:', 127 | 'Shift+Meta+Backspace': 'deleteToBeginningOfLine:', 128 | 'Shift+Meta+ArrowUp': 'moveToBeginningOfDocumentAndModifySelection:', 129 | 'Shift+Meta+ArrowDown': 'moveToEndOfDocumentAndModifySelection:', 130 | 'Shift+Meta+ArrowLeft': 'moveToLeftEndOfLineAndModifySelection:', 131 | 'Shift+Meta+ArrowRight': 'moveToRightEndOfLineAndModifySelection:', 132 | 'Meta+KeyA': 'selectAll:', 133 | }; 134 | //# sourceMappingURL=macEditingCommands.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/progress.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const logger_1 = require("./logger"); 19 | const errors_1 = require("./errors"); 20 | const helper_1 = require("./helper"); 21 | const stackTrace_1 = require("./debug/stackTrace"); 22 | async function runAbortableTask(task, logger, timeout, apiName) { 23 | const controller = new ProgressController(logger, timeout, apiName); 24 | return controller.run(task); 25 | } 26 | exports.runAbortableTask = runAbortableTask; 27 | class ProgressController { 28 | constructor(logger, timeout, apiName) { 29 | // Promise and callback that forcefully abort the progress. 30 | // This promise always rejects. 31 | this._forceAbort = () => { }; 32 | // Promise and callback that resolve once the progress is aborted. 33 | // This includes the force abort and also rejection of the task itself (failure). 34 | this._aborted = () => { }; 35 | // Cleanups to be run only in the case of abort. 36 | this._cleanups = []; 37 | this._logRecording = []; 38 | this._state = 'before'; 39 | this._apiName = apiName || stackTrace_1.getCurrentApiCall(); 40 | this._logger = logger; 41 | this._timeout = timeout; 42 | this._deadline = timeout ? monotonicTime() + timeout : 0; 43 | this._forceAbortPromise = new Promise((resolve, reject) => this._forceAbort = reject); 44 | this._forceAbortPromise.catch(e => null); // Prevent unhandle promsie rejection. 45 | this._abortedPromise = new Promise(resolve => this._aborted = resolve); 46 | } 47 | async run(task) { 48 | helper_1.assert(this._state === 'before'); 49 | this._state = 'running'; 50 | const progress = { 51 | apiName: this._apiName, 52 | aborted: this._abortedPromise, 53 | timeUntilDeadline: () => this._deadline ? this._deadline - monotonicTime() : 2147483647, 54 | isRunning: () => this._state === 'running', 55 | cleanupWhenAborted: (cleanup) => { 56 | if (this._state === 'running') 57 | this._cleanups.push(cleanup); 58 | else 59 | runCleanup(cleanup); 60 | }, 61 | log: (log, message) => { 62 | if (this._state === 'running') { 63 | this._logRecording.push(message.toString()); 64 | this._logger._log(log, ' ' + message); 65 | } 66 | else { 67 | this._logger._log(log, message); 68 | } 69 | }, 70 | }; 71 | this._logger._log(logger_1.apiLog, `=> ${this._apiName} started`); 72 | const timeoutError = new errors_1.TimeoutError(`Timeout ${this._timeout}ms exceeded during ${this._apiName}.`); 73 | const timer = setTimeout(() => this._forceAbort(timeoutError), progress.timeUntilDeadline()); 74 | try { 75 | const promise = task(progress); 76 | const result = await Promise.race([promise, this._forceAbortPromise]); 77 | clearTimeout(timer); 78 | this._state = 'finished'; 79 | this._logRecording = []; 80 | this._logger._log(logger_1.apiLog, `<= ${this._apiName} succeeded`); 81 | return result; 82 | } 83 | catch (e) { 84 | this._aborted(); 85 | stackTrace_1.rewriteErrorMessage(e, e.message + formatLogRecording(this._logRecording, this._apiName) + kLoggingNote); 86 | clearTimeout(timer); 87 | this._state = 'aborted'; 88 | this._logRecording = []; 89 | this._logger._log(logger_1.apiLog, `<= ${this._apiName} failed`); 90 | await Promise.all(this._cleanups.splice(0).map(cleanup => runCleanup(cleanup))); 91 | throw e; 92 | } 93 | } 94 | abort(error) { 95 | this._forceAbort(error); 96 | } 97 | } 98 | exports.ProgressController = ProgressController; 99 | async function runCleanup(cleanup) { 100 | try { 101 | await cleanup(); 102 | } 103 | catch (e) { 104 | } 105 | } 106 | const kLoggingNote = `\nNote: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.`; 107 | function formatLogRecording(log, name) { 108 | if (!log.length) 109 | return ''; 110 | name = ` ${name} logs `; 111 | const headerLength = 60; 112 | const leftLength = (headerLength - name.length) / 2; 113 | const rightLength = headerLength - name.length - leftLength; 114 | return `\n${'='.repeat(leftLength)}${name}${'='.repeat(rightLength)}\n${log.join('\n')}\n${'='.repeat(headerLength)}`; 115 | } 116 | function monotonicTime() { 117 | const [seconds, nanoseconds] = process.hrtime(); 118 | return seconds * 1000 + (nanoseconds / 1000000 | 0); 119 | } 120 | //# sourceMappingURL=progress.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/browserServer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const events_1 = require("events"); 19 | class WebSocketWrapper { 20 | constructor(wsEndpoint, bindings) { 21 | this.wsEndpoint = wsEndpoint; 22 | this._bindings = bindings; 23 | } 24 | async checkLeaks() { 25 | let counter = 0; 26 | return new Promise((fulfill, reject) => { 27 | const check = () => { 28 | const filtered = this._bindings.filter(entry => entry.size); 29 | if (!filtered.length) { 30 | fulfill(); 31 | return; 32 | } 33 | if (++counter >= 50) { 34 | reject(new Error('Web socket leak ' + filtered.map(entry => [...entry.keys()].join(':')).join('|'))); 35 | return; 36 | } 37 | setTimeout(check, 100); 38 | }; 39 | check(); 40 | }); 41 | } 42 | } 43 | exports.WebSocketWrapper = WebSocketWrapper; 44 | class BrowserServer extends events_1.EventEmitter { 45 | constructor(process, gracefullyClose, kill) { 46 | super(); 47 | this._webSocketWrapper = null; 48 | this._process = process; 49 | this._gracefullyClose = gracefullyClose; 50 | this._kill = kill; 51 | } 52 | process() { 53 | return this._process; 54 | } 55 | wsEndpoint() { 56 | return this._webSocketWrapper ? this._webSocketWrapper.wsEndpoint : ''; 57 | } 58 | async kill() { 59 | await this._kill(); 60 | } 61 | async close() { 62 | await this._gracefullyClose(); 63 | } 64 | async _checkLeaks() { 65 | if (this._webSocketWrapper) 66 | await this._webSocketWrapper.checkLeaks(); 67 | } 68 | async _closeOrKill(timeout) { 69 | let timer; 70 | try { 71 | await Promise.race([ 72 | this.close(), 73 | new Promise((resolve, reject) => timer = setTimeout(reject, timeout)), 74 | ]); 75 | } 76 | catch (ignored) { 77 | await this.kill().catch(ignored => { }); // Make sure to await actual process exit. 78 | } 79 | finally { 80 | clearTimeout(timer); 81 | } 82 | } 83 | } 84 | exports.BrowserServer = BrowserServer; 85 | //# sourceMappingURL=browserServer.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/electron.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const path = require("path"); 19 | const crBrowser_1 = require("../chromium/crBrowser"); 20 | const crConnection_1 = require("../chromium/crConnection"); 21 | const crExecutionContext_1 = require("../chromium/crExecutionContext"); 22 | const events_1 = require("../events"); 23 | const extendedEventEmitter_1 = require("../extendedEventEmitter"); 24 | const js = require("../javascript"); 25 | const logger_1 = require("../logger"); 26 | const timeoutSettings_1 = require("../timeoutSettings"); 27 | const transport_1 = require("../transport"); 28 | const browserServer_1 = require("./browserServer"); 29 | const processLauncher_1 = require("./processLauncher"); 30 | const progress_1 = require("../progress"); 31 | exports.ElectronEvents = { 32 | ElectronApplication: { 33 | Close: 'close', 34 | Window: 'window', 35 | } 36 | }; 37 | class ElectronApplication extends extendedEventEmitter_1.ExtendedEventEmitter { 38 | constructor(logger, browser, nodeConnection) { 39 | super(); 40 | this._windows = new Set(); 41 | this._lastWindowId = 0; 42 | this._timeoutSettings = new timeoutSettings_1.TimeoutSettings(); 43 | this._logger = logger; 44 | this._browserContext = browser._defaultContext; 45 | this._browserContext.on(events_1.Events.BrowserContext.Close, () => this.emit(exports.ElectronEvents.ElectronApplication.Close)); 46 | this._browserContext.on(events_1.Events.BrowserContext.Page, event => this._onPage(event)); 47 | this._nodeConnection = nodeConnection; 48 | this._nodeSession = nodeConnection.rootSession; 49 | } 50 | async _onPage(page) { 51 | // Needs to be sync. 52 | const windowId = ++this._lastWindowId; 53 | // Can be async. 54 | const handle = await this._nodeElectronHandle.evaluateHandle(({ BrowserWindow }, windowId) => BrowserWindow.fromId(windowId), windowId).catch(e => { }); 55 | if (!handle) 56 | return; 57 | page.browserWindow = handle; 58 | page._browserWindowId = windowId; 59 | page.on(events_1.Events.Page.Close, () => { 60 | page.browserWindow.dispose(); 61 | this._windows.delete(page); 62 | }); 63 | this._windows.add(page); 64 | await page.waitForLoadState('domcontentloaded').catch(e => { }); // can happen after detach 65 | this.emit(exports.ElectronEvents.ElectronApplication.Window, page); 66 | } 67 | windows() { 68 | return [...this._windows]; 69 | } 70 | async firstWindow() { 71 | if (this._windows.size) 72 | return this._windows.values().next().value; 73 | return this.waitForEvent('window'); 74 | } 75 | async newBrowserWindow(options) { 76 | const windowId = await this.evaluate(async ({ BrowserWindow }, options) => { 77 | const win = new BrowserWindow(options); 78 | win.loadURL('about:blank'); 79 | return win.id; 80 | }, options); 81 | for (const page of this._windows) { 82 | if (page._browserWindowId === windowId) 83 | return page; 84 | } 85 | return await this.waitForEvent(exports.ElectronEvents.ElectronApplication.Window, (page) => page._browserWindowId === windowId); 86 | } 87 | context() { 88 | return this._browserContext; 89 | } 90 | async close() { 91 | await this.evaluate(({ app }) => app.quit()); 92 | this._nodeConnection.close(); 93 | } 94 | async _init() { 95 | this._nodeSession.once('Runtime.executionContextCreated', event => { 96 | this._nodeExecutionContext = new js.ExecutionContext(new crExecutionContext_1.CRExecutionContext(this._nodeSession, event.context), this._logger); 97 | }); 98 | await this._nodeSession.send('Runtime.enable', {}).catch(e => { }); 99 | this._nodeElectronHandle = await js.evaluate(this._nodeExecutionContext, false /* returnByValue */, () => { 100 | // Resolving the race between the debugger and the boot-time script. 101 | if (global._playwrightRun) 102 | return global._playwrightRun(); 103 | return new Promise(f => global._playwrightRunCallback = f); 104 | }); 105 | } 106 | async evaluate(pageFunction, arg) { 107 | return this._nodeElectronHandle.evaluate(pageFunction, arg); 108 | } 109 | async evaluateHandle(pageFunction, arg) { 110 | return this._nodeElectronHandle.evaluateHandle(pageFunction, arg); 111 | } 112 | _getLogger() { 113 | return this._logger; 114 | } 115 | _getTimeoutSettings() { 116 | return this._timeoutSettings; 117 | } 118 | } 119 | exports.ElectronApplication = ElectronApplication; 120 | class Electron { 121 | async launch(executablePath, options = {}) { 122 | const { args = [], env = process.env, handleSIGINT = true, handleSIGTERM = true, handleSIGHUP = true, } = options; 123 | const logger = new logger_1.RootLogger(options.logger); 124 | return progress_1.runAbortableTask(async (progress) => { 125 | let app = undefined; 126 | const electronArguments = ['--inspect=0', '--remote-debugging-port=0', '--require', path.join(__dirname, 'electronLoader.js'), ...args]; 127 | const { launchedProcess, gracefullyClose, kill } = await processLauncher_1.launchProcess({ 128 | executablePath, 129 | args: electronArguments, 130 | env, 131 | handleSIGINT, 132 | handleSIGTERM, 133 | handleSIGHUP, 134 | progress, 135 | pipe: true, 136 | cwd: options.cwd, 137 | tempDirectories: [], 138 | attemptToGracefullyClose: () => app.close(), 139 | onExit: (exitCode, signal) => { 140 | if (app) 141 | app.emit(exports.ElectronEvents.ElectronApplication.Close, exitCode, signal); 142 | }, 143 | }); 144 | const nodeMatch = await processLauncher_1.waitForLine(progress, launchedProcess, launchedProcess.stderr, /^Debugger listening on (ws:\/\/.*)$/); 145 | const nodeTransport = await transport_1.WebSocketTransport.connect(progress, nodeMatch[1]); 146 | const nodeConnection = new crConnection_1.CRConnection(nodeTransport, logger); 147 | const chromeMatch = await processLauncher_1.waitForLine(progress, launchedProcess, launchedProcess.stderr, /^DevTools listening on (ws:\/\/.*)$/); 148 | const chromeTransport = await transport_1.WebSocketTransport.connect(progress, chromeMatch[1]); 149 | const browserServer = new browserServer_1.BrowserServer(launchedProcess, gracefullyClose, kill); 150 | const browser = await crBrowser_1.CRBrowser.connect(chromeTransport, { headful: true, logger, persistent: { viewport: null }, ownedServer: browserServer }); 151 | app = new ElectronApplication(logger, browser, nodeConnection); 152 | await app._init(); 153 | return app; 154 | }, logger, timeoutSettings_1.TimeoutSettings.timeout(options)); 155 | } 156 | } 157 | exports.Electron = Electron; 158 | //# sourceMappingURL=electron.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/electronLoader.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const electron = require("electron"); 19 | // Electron loader is passed to Electron as --require electronLoader.js and 20 | // defers the app ready event until remote debugging is established. 21 | (async () => { 22 | const app = electron.app; 23 | const originalEmitMethod = app.emit.bind(app); 24 | const originalIsReadyMethod = app.isReady.bind(app); 25 | const originalWhenReadyMethod = app.whenReady.bind(app); 26 | const deferredEmits = []; 27 | let attached = false; 28 | let isReady = false; 29 | let readyCallback; 30 | const readyPromise = new Promise(f => readyCallback = f); 31 | app.isReady = () => { 32 | if (attached) 33 | return originalIsReadyMethod(); 34 | return isReady; 35 | }; 36 | app.whenReady = async () => { 37 | if (attached) 38 | return originalWhenReadyMethod(); 39 | await readyPromise; 40 | }; 41 | app.emit = (event, ...args) => { 42 | if (attached) 43 | return originalEmitMethod(event, ...args); 44 | deferredEmits.push({ event, args }); 45 | return true; 46 | }; 47 | const playwrightRun = () => { 48 | while (deferredEmits.length) { 49 | const emit = deferredEmits.shift(); 50 | if (emit.event === 'ready') { 51 | isReady = true; 52 | readyCallback(); 53 | } 54 | originalEmitMethod(emit.event, ...emit.args); 55 | } 56 | attached = true; 57 | return electron; 58 | }; 59 | // Resolving the race between the debugger and the boot-time script. 60 | if (global._playwrightRunCallback) { 61 | global._playwrightRunCallback(playwrightRun()); 62 | return; 63 | } 64 | global._playwrightRun = playwrightRun; 65 | })(); 66 | //# sourceMappingURL=electronLoader.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/pipeTransport.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2018 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const helper_1 = require("../helper"); 20 | const logger_1 = require("../logger"); 21 | class PipeTransport { 22 | constructor(pipeWrite, pipeRead, logger) { 23 | this._pendingMessage = ''; 24 | this._waitForNextTask = helper_1.helper.makeWaitForNextTask(); 25 | this._closed = false; 26 | this._pipeWrite = pipeWrite; 27 | this._eventListeners = [ 28 | helper_1.helper.addEventListener(pipeRead, 'data', buffer => this._dispatch(buffer)), 29 | helper_1.helper.addEventListener(pipeRead, 'close', () => { 30 | this._closed = true; 31 | helper_1.helper.removeEventListeners(this._eventListeners); 32 | if (this.onclose) 33 | this.onclose.call(null); 34 | }), 35 | helper_1.helper.addEventListener(pipeRead, 'error', logger_1.logError(logger)), 36 | helper_1.helper.addEventListener(pipeWrite, 'error', logger_1.logError(logger)), 37 | ]; 38 | this.onmessage = undefined; 39 | this.onclose = undefined; 40 | } 41 | send(message) { 42 | if (this._closed) 43 | throw new Error('Pipe has been closed'); 44 | this._pipeWrite.write(JSON.stringify(message)); 45 | this._pipeWrite.write('\0'); 46 | } 47 | close() { 48 | throw new Error('unimplemented'); 49 | } 50 | _dispatch(buffer) { 51 | let end = buffer.indexOf('\0'); 52 | if (end === -1) { 53 | this._pendingMessage += buffer.toString(); 54 | return; 55 | } 56 | const message = this._pendingMessage + buffer.toString(undefined, 0, end); 57 | this._waitForNextTask(() => { 58 | if (this.onmessage) 59 | this.onmessage.call(null, JSON.parse(message)); 60 | }); 61 | let start = end + 1; 62 | end = buffer.indexOf('\0', start); 63 | while (end !== -1) { 64 | const message = buffer.toString(undefined, start, end); 65 | this._waitForNextTask(() => { 66 | if (this.onmessage) 67 | this.onmessage.call(null, JSON.parse(message)); 68 | }); 69 | start = end + 1; 70 | end = buffer.indexOf('\0', start); 71 | } 72 | this._pendingMessage = buffer.toString(undefined, start); 73 | } 74 | } 75 | exports.PipeTransport = PipeTransport; 76 | //# sourceMappingURL=pipeTransport.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/playwright.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const api = require("../api"); 19 | const helper_1 = require("../helper"); 20 | const errors_1 = require("../errors"); 21 | const deviceDescriptors_1 = require("../deviceDescriptors"); 22 | const chromium_1 = require("./chromium"); 23 | const webkit_1 = require("./webkit"); 24 | const firefox_1 = require("./firefox"); 25 | const selectors_1 = require("../selectors"); 26 | for (const className in api) { 27 | if (typeof api[className] === 'function') 28 | helper_1.helper.installApiHooks(className[0].toLowerCase() + className.substring(1), api[className]); 29 | } 30 | class Playwright { 31 | constructor(packagePath, browsers) { 32 | this.selectors = selectors_1.selectors; 33 | this.devices = deviceDescriptors_1.DeviceDescriptors; 34 | this.errors = { TimeoutError: errors_1.TimeoutError }; 35 | const chromium = browsers.find(browser => browser.name === 'chromium'); 36 | if (chromium) 37 | this.chromium = new chromium_1.Chromium(packagePath, chromium); 38 | const firefox = browsers.find(browser => browser.name === 'firefox'); 39 | if (firefox) 40 | this.firefox = new firefox_1.Firefox(packagePath, firefox); 41 | const webkit = browsers.find(browser => browser.name === 'webkit'); 42 | if (webkit) 43 | this.webkit = new webkit_1.WebKit(packagePath, webkit); 44 | } 45 | } 46 | exports.Playwright = Playwright; 47 | //# sourceMappingURL=playwright.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/server/processLauncher.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const childProcess = require("child_process"); 20 | const readline = require("readline"); 21 | const removeFolder = require("rimraf"); 22 | const helper_1 = require("../helper"); 23 | exports.browserLog = { 24 | name: 'browser', 25 | }; 26 | const browserStdOutLog = { 27 | name: 'browser:out', 28 | }; 29 | const browserStdErrLog = { 30 | name: 'browser:err', 31 | severity: 'warning' 32 | }; 33 | async function launchProcess(options) { 34 | const cleanup = () => helper_1.helper.removeFolders(options.tempDirectories); 35 | const progress = options.progress; 36 | const stdio = options.pipe ? ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'] : ['ignore', 'pipe', 'pipe']; 37 | progress.log(exports.browserLog, ` ${options.executablePath} ${options.args.join(' ')}`); 38 | const spawnedProcess = childProcess.spawn(options.executablePath, options.args, { 39 | // On non-windows platforms, `detached: true` makes child process a leader of a new 40 | // process group, making it possible to kill child process tree with `.kill(-pid)` command. 41 | // @see https://nodejs.org/api/child_process.html#child_process_options_detached 42 | detached: process.platform !== 'win32', 43 | env: options.env, 44 | cwd: options.cwd, 45 | stdio, 46 | }); 47 | if (!spawnedProcess.pid) { 48 | let failed; 49 | const failedPromise = new Promise((f, r) => failed = f); 50 | spawnedProcess.once('error', error => { 51 | failed(new Error('Failed to launch browser: ' + error)); 52 | }); 53 | return cleanup().then(() => failedPromise).then(e => Promise.reject(e)); 54 | } 55 | progress.log(exports.browserLog, ` pid=${spawnedProcess.pid}`); 56 | const stdout = readline.createInterface({ input: spawnedProcess.stdout }); 57 | stdout.on('line', (data) => { 58 | progress.log(browserStdOutLog, data); 59 | }); 60 | const stderr = readline.createInterface({ input: spawnedProcess.stderr }); 61 | stderr.on('line', (data) => { 62 | progress.log(browserStdErrLog, data); 63 | }); 64 | let processClosed = false; 65 | let fulfillClose = () => { }; 66 | const waitForClose = new Promise(f => fulfillClose = f); 67 | let fulfillCleanup = () => { }; 68 | const waitForCleanup = new Promise(f => fulfillCleanup = f); 69 | spawnedProcess.once('exit', (exitCode, signal) => { 70 | progress.log(exports.browserLog, ``); 71 | processClosed = true; 72 | helper_1.helper.removeEventListeners(listeners); 73 | options.onExit(exitCode, signal); 74 | fulfillClose(); 75 | // Cleanup as process exits. 76 | cleanup().then(fulfillCleanup); 77 | }); 78 | const listeners = [helper_1.helper.addEventListener(process, 'exit', killProcess)]; 79 | if (options.handleSIGINT) { 80 | listeners.push(helper_1.helper.addEventListener(process, 'SIGINT', () => { 81 | gracefullyClose().then(() => process.exit(130)); 82 | })); 83 | } 84 | if (options.handleSIGTERM) 85 | listeners.push(helper_1.helper.addEventListener(process, 'SIGTERM', gracefullyClose)); 86 | if (options.handleSIGHUP) 87 | listeners.push(helper_1.helper.addEventListener(process, 'SIGHUP', gracefullyClose)); 88 | let gracefullyClosing = false; 89 | async function gracefullyClose() { 90 | // We keep listeners until we are done, to handle 'exit' and 'SIGINT' while 91 | // asynchronously closing to prevent zombie processes. This might introduce 92 | // reentrancy to this function, for example user sends SIGINT second time. 93 | // In this case, let's forcefully kill the process. 94 | if (gracefullyClosing) { 95 | progress.log(exports.browserLog, ``); 96 | killProcess(); 97 | await waitForClose; // Ensure the process is dead and we called options.onkill. 98 | return; 99 | } 100 | gracefullyClosing = true; 101 | progress.log(exports.browserLog, ``); 102 | await options.attemptToGracefullyClose().catch(() => killProcess()); 103 | await waitForCleanup; // Ensure the process is dead and we have cleaned up. 104 | progress.log(exports.browserLog, ``); 105 | } 106 | // This method has to be sync to be used as 'exit' event handler. 107 | function killProcess() { 108 | progress.log(exports.browserLog, ``); 109 | helper_1.helper.removeEventListeners(listeners); 110 | if (spawnedProcess.pid && !spawnedProcess.killed && !processClosed) { 111 | // Force kill the browser. 112 | try { 113 | if (process.platform === 'win32') 114 | childProcess.execSync(`taskkill /pid ${spawnedProcess.pid} /T /F`); 115 | else 116 | process.kill(-spawnedProcess.pid, 'SIGKILL'); 117 | } 118 | catch (e) { 119 | // the process might have already stopped 120 | } 121 | } 122 | try { 123 | // Attempt to remove temporary directories to avoid littering. 124 | for (const dir of options.tempDirectories) 125 | removeFolder.sync(dir); 126 | } 127 | catch (e) { } 128 | } 129 | function killAndWait() { 130 | killProcess(); 131 | return waitForCleanup; 132 | } 133 | return { launchedProcess: spawnedProcess, gracefullyClose, kill: killAndWait }; 134 | } 135 | exports.launchProcess = launchProcess; 136 | function waitForLine(progress, process, inputStream, regex) { 137 | return new Promise((resolve, reject) => { 138 | const rl = readline.createInterface({ input: inputStream }); 139 | const listeners = [ 140 | helper_1.helper.addEventListener(rl, 'line', onLine), 141 | helper_1.helper.addEventListener(rl, 'close', reject), 142 | helper_1.helper.addEventListener(process, 'exit', reject), 143 | helper_1.helper.addEventListener(process, 'error', reject) 144 | ]; 145 | progress.cleanupWhenAborted(cleanup); 146 | function onLine(line) { 147 | const match = line.match(regex); 148 | if (!match) 149 | return; 150 | cleanup(); 151 | resolve(match); 152 | } 153 | function cleanup() { 154 | helper_1.helper.removeEventListeners(listeners); 155 | } 156 | }); 157 | } 158 | exports.waitForLine = waitForLine; 159 | //# sourceMappingURL=processLauncher.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/timeoutSettings.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2019 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const debugSupport = require("./debug/debugSupport"); 20 | const DEFAULT_TIMEOUT = debugSupport.isDebugMode() ? 0 : 30000; 21 | class TimeoutSettings { 22 | constructor(parent) { 23 | this._defaultTimeout = null; 24 | this._defaultNavigationTimeout = null; 25 | this._parent = parent; 26 | } 27 | setDefaultTimeout(timeout) { 28 | this._defaultTimeout = timeout; 29 | } 30 | setDefaultNavigationTimeout(timeout) { 31 | this._defaultNavigationTimeout = timeout; 32 | } 33 | navigationTimeout(options) { 34 | if (typeof options.timeout === 'number') 35 | return options.timeout; 36 | if (this._defaultNavigationTimeout !== null) 37 | return this._defaultNavigationTimeout; 38 | if (this._defaultTimeout !== null) 39 | return this._defaultTimeout; 40 | if (this._parent) 41 | return this._parent.navigationTimeout(options); 42 | return DEFAULT_TIMEOUT; 43 | } 44 | timeout(options) { 45 | if (typeof options.timeout === 'number') 46 | return options.timeout; 47 | if (this._defaultTimeout !== null) 48 | return this._defaultTimeout; 49 | if (this._parent) 50 | return this._parent.timeout(options); 51 | return DEFAULT_TIMEOUT; 52 | } 53 | static timeout(options) { 54 | if (typeof options.timeout === 'number') 55 | return options.timeout; 56 | return DEFAULT_TIMEOUT; 57 | } 58 | } 59 | exports.TimeoutSettings = TimeoutSettings; 60 | //# sourceMappingURL=timeoutSettings.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/transport.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2018 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const WebSocket = require("ws"); 20 | const helper_1 = require("./helper"); 21 | const processLauncher_1 = require("./server/processLauncher"); 22 | class SlowMoTransport { 23 | constructor(transport, delay) { 24 | this._delay = delay; 25 | this._delegate = transport; 26 | this._delegate.onmessage = this._onmessage.bind(this); 27 | this._delegate.onclose = this._onClose.bind(this); 28 | } 29 | static wrap(transport, delay) { 30 | return delay ? new SlowMoTransport(transport, delay) : transport; 31 | } 32 | _onmessage(message) { 33 | if (this.onmessage) 34 | this.onmessage(message); 35 | } 36 | _onClose() { 37 | if (this.onclose) 38 | this.onclose(); 39 | this._delegate.onmessage = undefined; 40 | this._delegate.onclose = undefined; 41 | } 42 | send(s) { 43 | setTimeout(() => { 44 | if (this._delegate.onmessage) 45 | this._delegate.send(s); 46 | }, this._delay); 47 | } 48 | close() { 49 | this._delegate.close(); 50 | } 51 | } 52 | exports.SlowMoTransport = SlowMoTransport; 53 | class DeferWriteTransport { 54 | constructor(transport) { 55 | this._delegate = transport; 56 | let callback; 57 | this._readPromise = new Promise(f => callback = f); 58 | this._delegate.onmessage = (s) => { 59 | callback(); 60 | if (this.onmessage) 61 | this.onmessage(s); 62 | }; 63 | this._delegate.onclose = () => { 64 | if (this.onclose) 65 | this.onclose(); 66 | }; 67 | } 68 | async send(s) { 69 | await this._readPromise; 70 | this._delegate.send(s); 71 | } 72 | close() { 73 | this._delegate.close(); 74 | } 75 | } 76 | exports.DeferWriteTransport = DeferWriteTransport; 77 | class WebSocketTransport { 78 | constructor(progress, url) { 79 | this._ws = new WebSocket(url, [], { 80 | perMessageDeflate: false, 81 | maxPayload: 256 * 1024 * 1024, 82 | handshakeTimeout: progress.timeUntilDeadline(), 83 | }); 84 | this._progress = progress; 85 | // The 'ws' module in node sometimes sends us multiple messages in a single task. 86 | // In Web, all IO callbacks (e.g. WebSocket callbacks) 87 | // are dispatched into separate tasks, so there's no need 88 | // to do anything extra. 89 | const messageWrap = helper_1.helper.makeWaitForNextTask(); 90 | this._ws.addEventListener('message', event => { 91 | messageWrap(() => { 92 | if (this.onmessage) 93 | this.onmessage.call(null, JSON.parse(event.data)); 94 | }); 95 | }); 96 | this._ws.addEventListener('close', event => { 97 | this._progress && this._progress.log(processLauncher_1.browserLog, ` ${url}`); 98 | if (this.onclose) 99 | this.onclose.call(null); 100 | }); 101 | // Silently ignore all errors - we don't know what to do with them. 102 | this._ws.addEventListener('error', () => { }); 103 | } 104 | static async connect(progress, url) { 105 | progress.log(processLauncher_1.browserLog, ` ${url}`); 106 | const transport = new WebSocketTransport(progress, url); 107 | let success = false; 108 | progress.aborted.then(() => { 109 | if (!success) 110 | transport.closeAndWait().catch(e => null); 111 | }); 112 | await new Promise((fulfill, reject) => { 113 | transport._ws.addEventListener('open', async () => { 114 | progress.log(processLauncher_1.browserLog, ` ${url}`); 115 | fulfill(transport); 116 | }); 117 | transport._ws.addEventListener('error', event => { 118 | progress.log(processLauncher_1.browserLog, ` ${url} ${event.message}`); 119 | reject(new Error('WebSocket error: ' + event.message)); 120 | transport._ws.close(); 121 | }); 122 | }); 123 | success = true; 124 | return transport; 125 | } 126 | send(message) { 127 | this._ws.send(JSON.stringify(message)); 128 | } 129 | close() { 130 | this._progress && this._progress.log(processLauncher_1.browserLog, ` ${this._ws.url}`); 131 | this._ws.close(); 132 | } 133 | async closeAndWait() { 134 | const promise = new Promise(f => this.onclose = f); 135 | this.close(); 136 | return promise; // Make sure to await the actual disconnect. 137 | } 138 | } 139 | exports.WebSocketTransport = WebSocketTransport; 140 | class SequenceNumberMixer { 141 | constructor() { 142 | this._values = new Map(); 143 | } 144 | generate(value) { 145 | const sequenceNumber = ++SequenceNumberMixer._lastSequenceNumber; 146 | this._values.set(sequenceNumber, value); 147 | return sequenceNumber; 148 | } 149 | take(sequenceNumber) { 150 | const value = this._values.get(sequenceNumber); 151 | this._values.delete(sequenceNumber); 152 | return value; 153 | } 154 | } 155 | exports.SequenceNumberMixer = SequenceNumberMixer; 156 | SequenceNumberMixer._lastSequenceNumber = 1; 157 | class InterceptingTransport { 158 | constructor(transport, interceptor) { 159 | this._delegate = transport; 160 | this._interceptor = interceptor; 161 | this._delegate.onmessage = this._onmessage.bind(this); 162 | this._delegate.onclose = this._onClose.bind(this); 163 | } 164 | _onmessage(message) { 165 | if (this.onmessage) 166 | this.onmessage(message); 167 | } 168 | _onClose() { 169 | if (this.onclose) 170 | this.onclose(); 171 | this._delegate.onmessage = undefined; 172 | this._delegate.onclose = undefined; 173 | } 174 | send(s) { 175 | this._delegate.send(this._interceptor(s)); 176 | } 177 | close() { 178 | this._delegate.close(); 179 | } 180 | } 181 | exports.InterceptingTransport = InterceptingTransport; 182 | exports.protocolLog = { 183 | name: 'protocol', 184 | severity: 'verbose', 185 | color: 'green' 186 | }; 187 | //# sourceMappingURL=transport.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | exports.kLifecycleEvents = new Set(['load', 'domcontentloaded', 'networkidle']); 19 | exports.mediaTypes = new Set(['screen', 'print']); 20 | exports.colorSchemes = new Set(['dark', 'light', 'no-preference']); 21 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/usKeyboardLayout.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | exports.keypadLocation = 3; 20 | exports.USKeyboardLayout = { 21 | // Functions row 22 | 'Escape': { 'keyCode': 27, 'key': 'Escape' }, 23 | 'F1': { 'keyCode': 112, 'key': 'F1' }, 24 | 'F2': { 'keyCode': 113, 'key': 'F2' }, 25 | 'F3': { 'keyCode': 114, 'key': 'F3' }, 26 | 'F4': { 'keyCode': 115, 'key': 'F4' }, 27 | 'F5': { 'keyCode': 116, 'key': 'F5' }, 28 | 'F6': { 'keyCode': 117, 'key': 'F6' }, 29 | 'F7': { 'keyCode': 118, 'key': 'F7' }, 30 | 'F8': { 'keyCode': 119, 'key': 'F8' }, 31 | 'F9': { 'keyCode': 120, 'key': 'F9' }, 32 | 'F10': { 'keyCode': 121, 'key': 'F10' }, 33 | 'F11': { 'keyCode': 122, 'key': 'F11' }, 34 | 'F12': { 'keyCode': 123, 'key': 'F12' }, 35 | // Numbers row 36 | 'Backquote': { 'keyCode': 192, 'shiftKey': '~', 'key': '`' }, 37 | 'Digit1': { 'keyCode': 49, 'shiftKey': '!', 'key': '1' }, 38 | 'Digit2': { 'keyCode': 50, 'shiftKey': '@', 'key': '2' }, 39 | 'Digit3': { 'keyCode': 51, 'shiftKey': '#', 'key': '3' }, 40 | 'Digit4': { 'keyCode': 52, 'shiftKey': '$', 'key': '4' }, 41 | 'Digit5': { 'keyCode': 53, 'shiftKey': '%', 'key': '5' }, 42 | 'Digit6': { 'keyCode': 54, 'shiftKey': '^', 'key': '6' }, 43 | 'Digit7': { 'keyCode': 55, 'shiftKey': '&', 'key': '7' }, 44 | 'Digit8': { 'keyCode': 56, 'shiftKey': '*', 'key': '8' }, 45 | 'Digit9': { 'keyCode': 57, 'shiftKey': '\(', 'key': '9' }, 46 | 'Digit0': { 'keyCode': 48, 'shiftKey': ')', 'key': '0' }, 47 | 'Minus': { 'keyCode': 189, 'shiftKey': '_', 'key': '-' }, 48 | 'Equal': { 'keyCode': 187, 'shiftKey': '+', 'key': '=' }, 49 | 'Backslash': { 'keyCode': 220, 'shiftKey': '|', 'key': '\\' }, 50 | 'Backspace': { 'keyCode': 8, 'key': 'Backspace' }, 51 | // First row 52 | 'Tab': { 'keyCode': 9, 'key': 'Tab' }, 53 | 'KeyQ': { 'keyCode': 81, 'shiftKey': 'Q', 'key': 'q' }, 54 | 'KeyW': { 'keyCode': 87, 'shiftKey': 'W', 'key': 'w' }, 55 | 'KeyE': { 'keyCode': 69, 'shiftKey': 'E', 'key': 'e' }, 56 | 'KeyR': { 'keyCode': 82, 'shiftKey': 'R', 'key': 'r' }, 57 | 'KeyT': { 'keyCode': 84, 'shiftKey': 'T', 'key': 't' }, 58 | 'KeyY': { 'keyCode': 89, 'shiftKey': 'Y', 'key': 'y' }, 59 | 'KeyU': { 'keyCode': 85, 'shiftKey': 'U', 'key': 'u' }, 60 | 'KeyI': { 'keyCode': 73, 'shiftKey': 'I', 'key': 'i' }, 61 | 'KeyO': { 'keyCode': 79, 'shiftKey': 'O', 'key': 'o' }, 62 | 'KeyP': { 'keyCode': 80, 'shiftKey': 'P', 'key': 'p' }, 63 | 'BracketLeft': { 'keyCode': 219, 'shiftKey': '{', 'key': '[' }, 64 | 'BracketRight': { 'keyCode': 221, 'shiftKey': '}', 'key': ']' }, 65 | // Second row 66 | 'CapsLock': { 'keyCode': 20, 'key': 'CapsLock' }, 67 | 'KeyA': { 'keyCode': 65, 'shiftKey': 'A', 'key': 'a' }, 68 | 'KeyS': { 'keyCode': 83, 'shiftKey': 'S', 'key': 's' }, 69 | 'KeyD': { 'keyCode': 68, 'shiftKey': 'D', 'key': 'd' }, 70 | 'KeyF': { 'keyCode': 70, 'shiftKey': 'F', 'key': 'f' }, 71 | 'KeyG': { 'keyCode': 71, 'shiftKey': 'G', 'key': 'g' }, 72 | 'KeyH': { 'keyCode': 72, 'shiftKey': 'H', 'key': 'h' }, 73 | 'KeyJ': { 'keyCode': 74, 'shiftKey': 'J', 'key': 'j' }, 74 | 'KeyK': { 'keyCode': 75, 'shiftKey': 'K', 'key': 'k' }, 75 | 'KeyL': { 'keyCode': 76, 'shiftKey': 'L', 'key': 'l' }, 76 | 'Semicolon': { 'keyCode': 186, 'shiftKey': ':', 'key': ';' }, 77 | 'Quote': { 'keyCode': 222, 'shiftKey': '"', 'key': '\'' }, 78 | 'Enter': { 'keyCode': 13, 'key': 'Enter', 'text': '\r' }, 79 | // Third row 80 | 'ShiftLeft': { 'keyCode': 160, 'keyCodeWithoutLocation': 16, 'key': 'Shift', 'location': 1 }, 81 | 'KeyZ': { 'keyCode': 90, 'shiftKey': 'Z', 'key': 'z' }, 82 | 'KeyX': { 'keyCode': 88, 'shiftKey': 'X', 'key': 'x' }, 83 | 'KeyC': { 'keyCode': 67, 'shiftKey': 'C', 'key': 'c' }, 84 | 'KeyV': { 'keyCode': 86, 'shiftKey': 'V', 'key': 'v' }, 85 | 'KeyB': { 'keyCode': 66, 'shiftKey': 'B', 'key': 'b' }, 86 | 'KeyN': { 'keyCode': 78, 'shiftKey': 'N', 'key': 'n' }, 87 | 'KeyM': { 'keyCode': 77, 'shiftKey': 'M', 'key': 'm' }, 88 | 'Comma': { 'keyCode': 188, 'shiftKey': '\<', 'key': ',' }, 89 | 'Period': { 'keyCode': 190, 'shiftKey': '>', 'key': '.' }, 90 | 'Slash': { 'keyCode': 191, 'shiftKey': '?', 'key': '/' }, 91 | 'ShiftRight': { 'keyCode': 161, 'keyCodeWithoutLocation': 16, 'key': 'Shift', 'location': 2 }, 92 | // Last row 93 | 'ControlLeft': { 'keyCode': 162, 'keyCodeWithoutLocation': 17, 'key': 'Control', 'location': 1 }, 94 | 'MetaLeft': { 'keyCode': 91, 'key': 'Meta', 'location': 1 }, 95 | 'AltLeft': { 'keyCode': 164, 'keyCodeWithoutLocation': 18, 'key': 'Alt', 'location': 1 }, 96 | 'Space': { 'keyCode': 32, 'key': ' ' }, 97 | 'AltRight': { 'keyCode': 165, 'keyCodeWithoutLocation': 18, 'key': 'Alt', 'location': 2 }, 98 | 'AltGraph': { 'keyCode': 225, 'key': 'AltGraph' }, 99 | 'MetaRight': { 'keyCode': 92, 'key': 'Meta', 'location': 2 }, 100 | 'ContextMenu': { 'keyCode': 93, 'key': 'ContextMenu' }, 101 | 'ControlRight': { 'keyCode': 163, 'keyCodeWithoutLocation': 17, 'key': 'Control', 'location': 2 }, 102 | // Center block 103 | 'PrintScreen': { 'keyCode': 44, 'key': 'PrintScreen' }, 104 | 'ScrollLock': { 'keyCode': 145, 'key': 'ScrollLock' }, 105 | 'Pause': { 'keyCode': 19, 'key': 'Pause' }, 106 | 'PageUp': { 'keyCode': 33, 'key': 'PageUp' }, 107 | 'PageDown': { 'keyCode': 34, 'key': 'PageDown' }, 108 | 'Insert': { 'keyCode': 45, 'key': 'Insert' }, 109 | 'Delete': { 'keyCode': 46, 'key': 'Delete' }, 110 | 'Home': { 'keyCode': 36, 'key': 'Home' }, 111 | 'End': { 'keyCode': 35, 'key': 'End' }, 112 | 'ArrowLeft': { 'keyCode': 37, 'key': 'ArrowLeft' }, 113 | 'ArrowUp': { 'keyCode': 38, 'key': 'ArrowUp' }, 114 | 'ArrowRight': { 'keyCode': 39, 'key': 'ArrowRight' }, 115 | 'ArrowDown': { 'keyCode': 40, 'key': 'ArrowDown' }, 116 | // Numpad 117 | 'NumLock': { 'keyCode': 144, 'key': 'NumLock' }, 118 | 'NumpadDivide': { 'keyCode': 111, 'key': '/', 'location': 3 }, 119 | 'NumpadMultiply': { 'keyCode': 106, 'key': '*', 'location': 3 }, 120 | 'NumpadSubtract': { 'keyCode': 109, 'key': '-', 'location': 3 }, 121 | 'Numpad7': { 'keyCode': 36, 'shiftKeyCode': 103, 'key': 'Home', 'shiftKey': '7', 'location': 3 }, 122 | 'Numpad8': { 'keyCode': 38, 'shiftKeyCode': 104, 'key': 'ArrowUp', 'shiftKey': '8', 'location': 3 }, 123 | 'Numpad9': { 'keyCode': 33, 'shiftKeyCode': 105, 'key': 'PageUp', 'shiftKey': '9', 'location': 3 }, 124 | 'Numpad4': { 'keyCode': 37, 'shiftKeyCode': 100, 'key': 'ArrowLeft', 'shiftKey': '4', 'location': 3 }, 125 | 'Numpad5': { 'keyCode': 12, 'shiftKeyCode': 101, 'key': 'Clear', 'shiftKey': '5', 'location': 3 }, 126 | 'Numpad6': { 'keyCode': 39, 'shiftKeyCode': 102, 'key': 'ArrowRight', 'shiftKey': '6', 'location': 3 }, 127 | 'NumpadAdd': { 'keyCode': 107, 'key': '+', 'location': 3 }, 128 | 'Numpad1': { 'keyCode': 35, 'shiftKeyCode': 97, 'key': 'End', 'shiftKey': '1', 'location': 3 }, 129 | 'Numpad2': { 'keyCode': 40, 'shiftKeyCode': 98, 'key': 'ArrowDown', 'shiftKey': '2', 'location': 3 }, 130 | 'Numpad3': { 'keyCode': 34, 'shiftKeyCode': 99, 'key': 'PageDown', 'shiftKey': '3', 'location': 3 }, 131 | 'Numpad0': { 'keyCode': 45, 'shiftKeyCode': 96, 'key': 'Insert', 'shiftKey': '0', 'location': 3 }, 132 | 'NumpadDecimal': { 'keyCode': 46, 'shiftKeyCode': 110, 'key': '\u0000', 'shiftKey': '.', 'location': 3 }, 133 | 'NumpadEnter': { 'keyCode': 13, 'key': 'Enter', 'text': '\r', 'location': 3 }, 134 | }; 135 | //# sourceMappingURL=usKeyboardLayout.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/utilityScriptSerializers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | // This file can't have dependencies, it is a part of the utility script. 19 | function parseEvaluationResultValue(value, handles = []) { 20 | // { type: 'undefined' } does not even have value. 21 | if (value === 'undefined') 22 | return undefined; 23 | if (typeof value === 'object') { 24 | if (value.v === 'undefined') 25 | return undefined; 26 | if (value.v === null) 27 | return null; 28 | if (value.v === 'NaN') 29 | return NaN; 30 | if (value.v === 'Infinity') 31 | return Infinity; 32 | if (value.v === '-Infinity') 33 | return -Infinity; 34 | if (value.v === '-0') 35 | return -0; 36 | if (value.d) 37 | return new Date(value.d); 38 | if (value.r) 39 | return new RegExp(value.r[0], value.r[1]); 40 | if (value.a) 41 | return value.a.map((a) => parseEvaluationResultValue(a, handles)); 42 | if (value.o) { 43 | for (const name of Object.keys(value.o)) 44 | value.o[name] = parseEvaluationResultValue(value.o[name], handles); 45 | return value.o; 46 | } 47 | if (typeof value.h === 'number') 48 | return handles[value.h]; 49 | } 50 | return value; 51 | } 52 | exports.parseEvaluationResultValue = parseEvaluationResultValue; 53 | function serializeAsCallArgument(value, jsHandleSerializer) { 54 | return serialize(value, jsHandleSerializer, new Set()); 55 | } 56 | exports.serializeAsCallArgument = serializeAsCallArgument; 57 | function serialize(value, jsHandleSerializer, visited) { 58 | if (value && typeof value === 'object' && typeof value.then === 'function') 59 | return value; 60 | const result = jsHandleSerializer(value); 61 | if ('fallThrough' in result) 62 | value = result.fallThrough; 63 | else 64 | return result; 65 | if (visited.has(value)) 66 | throw new Error('Argument is a circular structure'); 67 | if (typeof value === 'symbol') 68 | return { v: 'undefined' }; 69 | if (Object.is(value, undefined)) 70 | return { v: 'undefined' }; 71 | if (Object.is(value, null)) 72 | return { v: null }; 73 | if (Object.is(value, NaN)) 74 | return { v: 'NaN' }; 75 | if (Object.is(value, Infinity)) 76 | return { v: 'Infinity' }; 77 | if (Object.is(value, -Infinity)) 78 | return { v: '-Infinity' }; 79 | if (Object.is(value, -0)) 80 | return { v: '-0' }; 81 | if (isPrimitiveValue(value)) 82 | return value; 83 | if (value instanceof Error) { 84 | const error = value; 85 | if ('captureStackTrace' in global.Error) { 86 | // v8 87 | return error.stack; 88 | } 89 | return `${error.name}: ${error.message}\n${error.stack}`; 90 | } 91 | if (value instanceof Date) 92 | return { d: value.toJSON() }; 93 | if (value instanceof RegExp) 94 | return { r: [value.source, value.flags] }; 95 | if (Array.isArray(value)) { 96 | const result = []; 97 | visited.add(value); 98 | for (let i = 0; i < value.length; ++i) 99 | result.push(serialize(value[i], jsHandleSerializer, visited)); 100 | visited.delete(value); 101 | return { a: result }; 102 | } 103 | if (typeof value === 'object') { 104 | const result = {}; 105 | visited.add(value); 106 | for (const name of Object.keys(value)) { 107 | let item; 108 | try { 109 | item = value[name]; 110 | } 111 | catch (e) { 112 | continue; // native bindings will throw sometimes 113 | } 114 | if (name === 'toJSON' && typeof item === 'function') 115 | result[name] = {}; 116 | else 117 | result[name] = serialize(item, jsHandleSerializer, visited); 118 | } 119 | visited.delete(value); 120 | return { o: result }; 121 | } 122 | } 123 | function isPrimitiveValue(value) { 124 | switch (typeof value) { 125 | case 'boolean': 126 | case 'number': 127 | case 'string': 128 | return true; 129 | default: 130 | return false; 131 | } 132 | } 133 | exports.isPrimitiveValue = isPrimitiveValue; 134 | //# sourceMappingURL=utilityScriptSerializers.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkConnection.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const events_1 = require("events"); 20 | const helper_1 = require("../helper"); 21 | const transport_1 = require("../transport"); 22 | const logger_1 = require("../logger"); 23 | const stackTrace_1 = require("../debug/stackTrace"); 24 | // WKPlaywright uses this special id to issue Browser.close command which we 25 | // should ignore. 26 | exports.kBrowserCloseMessageId = -9999; 27 | // We emulate kPageProxyMessageReceived message to unify it with Browser.pageProxyCreated 28 | // and Browser.pageProxyDestroyed for easier management. 29 | exports.kPageProxyMessageReceived = 'kPageProxyMessageReceived'; 30 | class WKConnection { 31 | constructor(transport, logger, onDisconnect) { 32 | this._lastId = 0; 33 | this._closed = false; 34 | this._transport = transport; 35 | this._logger = logger; 36 | this._transport.onmessage = this._dispatchMessage.bind(this); 37 | this._transport.onclose = this._onClose.bind(this); 38 | this._onDisconnect = onDisconnect; 39 | this.browserSession = new WKSession(this, '', 'Browser has been closed.', (message) => { 40 | this.rawSend(message); 41 | }); 42 | } 43 | nextMessageId() { 44 | return ++this._lastId; 45 | } 46 | rawSend(message) { 47 | if (this._logger._isLogEnabled(transport_1.protocolLog)) 48 | this._logger._log(transport_1.protocolLog, 'SEND ► ' + rewriteInjectedScriptEvaluationLog(message)); 49 | this._transport.send(message); 50 | } 51 | _dispatchMessage(message) { 52 | if (this._logger._isLogEnabled(transport_1.protocolLog)) 53 | this._logger._log(transport_1.protocolLog, '◀ RECV ' + JSON.stringify(message)); 54 | if (message.id === exports.kBrowserCloseMessageId) 55 | return; 56 | if (message.pageProxyId) { 57 | const payload = { message: message, pageProxyId: message.pageProxyId }; 58 | this.browserSession.dispatchMessage({ method: exports.kPageProxyMessageReceived, params: payload }); 59 | return; 60 | } 61 | this.browserSession.dispatchMessage(message); 62 | } 63 | _onClose() { 64 | this._closed = true; 65 | this._transport.onmessage = undefined; 66 | this._transport.onclose = undefined; 67 | this.browserSession.dispose(); 68 | this._onDisconnect(); 69 | } 70 | isClosed() { 71 | return this._closed; 72 | } 73 | close() { 74 | if (!this._closed) 75 | this._transport.close(); 76 | } 77 | } 78 | exports.WKConnection = WKConnection; 79 | class WKSession extends events_1.EventEmitter { 80 | constructor(connection, sessionId, errorText, rawSend) { 81 | super(); 82 | this._disposed = false; 83 | this._callbacks = new Map(); 84 | this._crashed = false; 85 | this.connection = connection; 86 | this.sessionId = sessionId; 87 | this._rawSend = rawSend; 88 | this.errorText = errorText; 89 | this.on = super.on; 90 | this.off = super.removeListener; 91 | this.addListener = super.addListener; 92 | this.removeListener = super.removeListener; 93 | this.once = super.once; 94 | } 95 | async send(method, params) { 96 | if (this._crashed) 97 | throw new Error('Target crashed'); 98 | if (this._disposed) 99 | throw new Error(`Protocol error (${method}): ${this.errorText}`); 100 | const id = this.connection.nextMessageId(); 101 | const messageObj = { id, method, params }; 102 | this._rawSend(messageObj); 103 | return new Promise((resolve, reject) => { 104 | this._callbacks.set(id, { resolve, reject, error: new Error(), method }); 105 | }); 106 | } 107 | sendMayFail(method, params) { 108 | return this.send(method, params).catch(error => { 109 | this.connection._logger._log(logger_1.errorLog, error, []); 110 | }); 111 | } 112 | markAsCrashed() { 113 | this._crashed = true; 114 | } 115 | isDisposed() { 116 | return this._disposed; 117 | } 118 | dispose() { 119 | for (const callback of this._callbacks.values()) 120 | callback.reject(stackTrace_1.rewriteErrorMessage(callback.error, `Protocol error (${callback.method}): ${this.errorText}`)); 121 | this._callbacks.clear(); 122 | this._disposed = true; 123 | } 124 | dispatchMessage(object) { 125 | if (object.id && this._callbacks.has(object.id)) { 126 | const callback = this._callbacks.get(object.id); 127 | this._callbacks.delete(object.id); 128 | if (object.error) 129 | callback.reject(createProtocolError(callback.error, callback.method, object.error)); 130 | else 131 | callback.resolve(object.result); 132 | } 133 | else if (object.id) { 134 | // Response might come after session has been disposed and rejected all callbacks. 135 | helper_1.assert(this.isDisposed()); 136 | } 137 | else { 138 | Promise.resolve().then(() => this.emit(object.method, object.params)); 139 | } 140 | } 141 | } 142 | exports.WKSession = WKSession; 143 | function createProtocolError(error, method, protocolError) { 144 | let message = `Protocol error (${method}): ${protocolError.message}`; 145 | if ('data' in protocolError) 146 | message += ` ${JSON.stringify(protocolError.data)}`; 147 | return stackTrace_1.rewriteErrorMessage(error, message); 148 | } 149 | exports.createProtocolError = createProtocolError; 150 | function isSwappedOutError(e) { 151 | return e.message.includes('Target was swapped out.'); 152 | } 153 | exports.isSwappedOutError = isSwappedOutError; 154 | function rewriteInjectedScriptEvaluationLog(message) { 155 | // Injected script is very long and clutters protocol logs. 156 | // To increase development velocity, we skip replace it with short description in the log. 157 | if (message.params && message.params.message && message.params.message.includes('Runtime.evaluate') && message.params.message.includes('src/injected/injected.ts')) 158 | return `{"id":${message.id},"method":"${message.method}","params":{"message":[evaluate injected script],"targetId":"${message.params.targetId}"},"pageProxyId":${message.pageProxyId}}`; 159 | return JSON.stringify(message); 160 | } 161 | //# sourceMappingURL=wkConnection.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkExecutionContext.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const wkConnection_1 = require("./wkConnection"); 20 | const js = require("../javascript"); 21 | const debugSupport = require("../debug/debugSupport"); 22 | const utilityScriptSerializers_1 = require("../utilityScriptSerializers"); 23 | class WKExecutionContext { 24 | constructor(session, contextId) { 25 | this._contextDestroyedCallback = () => { }; 26 | this._session = session; 27 | this._contextId = contextId; 28 | this._executionContextDestroyedPromise = new Promise((resolve, reject) => { 29 | this._contextDestroyedCallback = resolve; 30 | }); 31 | } 32 | _dispose() { 33 | this._contextDestroyedCallback(); 34 | } 35 | async rawEvaluate(expression) { 36 | try { 37 | const response = await this._session.send('Runtime.evaluate', { 38 | expression: debugSupport.ensureSourceUrl(expression), 39 | contextId: this._contextId, 40 | returnByValue: false 41 | }); 42 | if (response.wasThrown) 43 | throw new Error('Evaluation failed: ' + response.result.description); 44 | return response.result.objectId; 45 | } 46 | catch (error) { 47 | throw rewriteError(error); 48 | } 49 | } 50 | async evaluateWithArguments(expression, returnByValue, utilityScript, values, objectIds) { 51 | try { 52 | let response = await this._session.send('Runtime.callFunctionOn', { 53 | functionDeclaration: expression, 54 | objectId: utilityScript._objectId, 55 | arguments: [ 56 | { objectId: utilityScript._objectId }, 57 | ...values.map(value => ({ value })), 58 | ...objectIds.map(objectId => ({ objectId })), 59 | ], 60 | returnByValue: false, 61 | emulateUserGesture: true 62 | }); 63 | if (response.result.objectId && response.result.className === 'Promise') { 64 | response = await Promise.race([ 65 | this._executionContextDestroyedPromise.then(() => contextDestroyedResult), 66 | this._session.send('Runtime.awaitPromise', { 67 | promiseObjectId: response.result.objectId, 68 | returnByValue: false 69 | }) 70 | ]); 71 | } 72 | if (response.wasThrown) 73 | throw new Error('Evaluation failed: ' + response.result.description); 74 | if (!returnByValue) 75 | return utilityScript._context.createHandle(response.result); 76 | if (response.result.objectId) 77 | return await this._returnObjectByValue(utilityScript._context, response.result.objectId); 78 | return utilityScriptSerializers_1.parseEvaluationResultValue(response.result.value); 79 | } 80 | catch (error) { 81 | throw rewriteError(error); 82 | } 83 | } 84 | async _returnObjectByValue(context, objectId) { 85 | // This is different from handleJSONValue in that it does not throw. 86 | try { 87 | const utilityScript = await context.utilityScript(); 88 | const serializeResponse = await this._session.send('Runtime.callFunctionOn', { 89 | functionDeclaration: 'object => object' + debugSupport.generateSourceUrl(), 90 | objectId: utilityScript._objectId, 91 | arguments: [{ objectId }], 92 | returnByValue: true 93 | }); 94 | if (serializeResponse.wasThrown) 95 | return undefined; 96 | return utilityScriptSerializers_1.parseEvaluationResultValue(serializeResponse.result.value); 97 | } 98 | catch (error) { 99 | return undefined; 100 | // TODO: we should actually throw an error, but that breaks the common case of undefined 101 | // that is for some reason reported as an object and cannot be accessed after navigation. 102 | // throw rewriteError(error); 103 | } 104 | } 105 | async getProperties(handle) { 106 | const objectId = handle._objectId; 107 | if (!objectId) 108 | return new Map(); 109 | const response = await this._session.send('Runtime.getProperties', { 110 | objectId, 111 | ownProperties: true 112 | }); 113 | const result = new Map(); 114 | for (const property of response.properties) { 115 | if (!property.enumerable || !property.value) 116 | continue; 117 | result.set(property.name, handle._context.createHandle(property.value)); 118 | } 119 | return result; 120 | } 121 | createHandle(context, remoteObject) { 122 | const isPromise = remoteObject.className === 'Promise'; 123 | return new js.JSHandle(context, isPromise ? 'promise' : remoteObject.subtype || remoteObject.type, remoteObject.objectId, potentiallyUnserializableValue(remoteObject)); 124 | } 125 | async releaseHandle(handle) { 126 | if (!handle._objectId) 127 | return; 128 | await this._session.send('Runtime.releaseObject', { objectId: handle._objectId }).catch(error => { }); 129 | } 130 | } 131 | exports.WKExecutionContext = WKExecutionContext; 132 | const contextDestroyedResult = { 133 | wasThrown: true, 134 | result: { 135 | description: 'Protocol error: Execution context was destroyed, most likely because of a navigation.' 136 | } 137 | }; 138 | function potentiallyUnserializableValue(remoteObject) { 139 | const value = remoteObject.value; 140 | const unserializableValue = remoteObject.type === 'number' && value === null ? remoteObject.description : undefined; 141 | return unserializableValue ? js.parseUnserializableValue(unserializableValue) : value; 142 | } 143 | function rewriteError(error) { 144 | if (wkConnection_1.isSwappedOutError(error) || error.message.includes('Missing injected script for given')) 145 | return new Error('Execution context was destroyed, most likely because of a navigation.'); 146 | return error; 147 | } 148 | //# sourceMappingURL=wkExecutionContext.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkInput.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the 'License'); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an 'AS IS' BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const input = require("../input"); 20 | const helper_1 = require("../helper"); 21 | const macEditingCommands_1 = require("../macEditingCommands"); 22 | function toModifiersMask(modifiers) { 23 | // From Source/WebKit/Shared/WebEvent.h 24 | let mask = 0; 25 | if (modifiers.has('Shift')) 26 | mask |= 1; 27 | if (modifiers.has('Control')) 28 | mask |= 2; 29 | if (modifiers.has('Alt')) 30 | mask |= 4; 31 | if (modifiers.has('Meta')) 32 | mask |= 8; 33 | return mask; 34 | } 35 | class RawKeyboardImpl { 36 | constructor(session) { 37 | this._pageProxySession = session; 38 | } 39 | setSession(session) { 40 | this._session = session; 41 | } 42 | async keydown(modifiers, code, keyCode, keyCodeWithoutLocation, key, location, autoRepeat, text) { 43 | const parts = []; 44 | for (const modifier of (['Shift', 'Control', 'Alt', 'Meta'])) { 45 | if (modifiers.has(modifier)) 46 | parts.push(modifier); 47 | } 48 | parts.push(code); 49 | const shortcut = parts.join('+'); 50 | let commands = macEditingCommands_1.macEditingCommands[shortcut]; 51 | if (helper_1.helper.isString(commands)) 52 | commands = [commands]; 53 | await this._pageProxySession.send('Input.dispatchKeyEvent', { 54 | type: 'keyDown', 55 | modifiers: toModifiersMask(modifiers), 56 | windowsVirtualKeyCode: keyCode, 57 | code, 58 | key, 59 | text, 60 | unmodifiedText: text, 61 | autoRepeat, 62 | macCommands: commands, 63 | isKeypad: location === input.keypadLocation 64 | }); 65 | } 66 | async keyup(modifiers, code, keyCode, keyCodeWithoutLocation, key, location) { 67 | await this._pageProxySession.send('Input.dispatchKeyEvent', { 68 | type: 'keyUp', 69 | modifiers: toModifiersMask(modifiers), 70 | key, 71 | windowsVirtualKeyCode: keyCode, 72 | code, 73 | isKeypad: location === input.keypadLocation 74 | }); 75 | } 76 | async sendText(text) { 77 | await this._session.send('Page.insertText', { text }); 78 | } 79 | } 80 | exports.RawKeyboardImpl = RawKeyboardImpl; 81 | class RawMouseImpl { 82 | constructor(session) { 83 | this._pageProxySession = session; 84 | } 85 | async move(x, y, button, buttons, modifiers) { 86 | await this._pageProxySession.send('Input.dispatchMouseEvent', { 87 | type: 'move', 88 | button, 89 | x, 90 | y, 91 | modifiers: toModifiersMask(modifiers) 92 | }); 93 | } 94 | async down(x, y, button, buttons, modifiers, clickCount) { 95 | await this._pageProxySession.send('Input.dispatchMouseEvent', { 96 | type: 'down', 97 | button, 98 | x, 99 | y, 100 | modifiers: toModifiersMask(modifiers), 101 | clickCount 102 | }); 103 | } 104 | async up(x, y, button, buttons, modifiers, clickCount) { 105 | await this._pageProxySession.send('Input.dispatchMouseEvent', { 106 | type: 'up', 107 | button, 108 | x, 109 | y, 110 | modifiers: toModifiersMask(modifiers), 111 | clickCount 112 | }); 113 | } 114 | } 115 | exports.RawMouseImpl = RawMouseImpl; 116 | //# sourceMappingURL=wkInput.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkInterceptableRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2017 Google Inc. All rights reserved. 4 | * Modifications copyright (c) Microsoft Corporation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const helper_1 = require("../helper"); 20 | const network = require("../network"); 21 | const errorReasons = { 22 | 'aborted': 'Cancellation', 23 | 'accessdenied': 'AccessControl', 24 | 'addressunreachable': 'General', 25 | 'blockedbyclient': 'Cancellation', 26 | 'blockedbyresponse': 'General', 27 | 'connectionaborted': 'General', 28 | 'connectionclosed': 'General', 29 | 'connectionfailed': 'General', 30 | 'connectionrefused': 'General', 31 | 'connectionreset': 'General', 32 | 'internetdisconnected': 'General', 33 | 'namenotresolved': 'General', 34 | 'timedout': 'Timeout', 35 | 'failed': 'General', 36 | }; 37 | class WKInterceptableRequest { 38 | constructor(session, allowInterception, frame, event, redirectedFrom, documentId) { 39 | this._interceptedCallback = () => { }; 40 | this._session = session; 41 | this._requestId = event.requestId; 42 | const resourceType = event.type ? event.type.toLowerCase() : (redirectedFrom ? redirectedFrom.resourceType() : 'other'); 43 | this.request = new network.Request(allowInterception ? this : null, frame, redirectedFrom, documentId, event.request.url, resourceType, event.request.method, event.request.postData || null, headersObject(event.request.headers)); 44 | this._interceptedPromise = new Promise(f => this._interceptedCallback = f); 45 | } 46 | async abort(errorCode) { 47 | const reason = errorReasons[errorCode]; 48 | helper_1.assert(reason, 'Unknown error code: ' + errorCode); 49 | await this._interceptedPromise; 50 | // In certain cases, protocol will return error if the request was already canceled 51 | // or the page was closed. We should tolerate these errors. 52 | await this._session.sendMayFail('Network.interceptAsError', { requestId: this._requestId, reason }); 53 | } 54 | async fulfill(response) { 55 | await this._interceptedPromise; 56 | const base64Encoded = !!response.body && !helper_1.helper.isString(response.body); 57 | const responseBody = response.body ? (base64Encoded ? response.body.toString('base64') : response.body) : ''; 58 | const responseHeaders = {}; 59 | if (response.headers) { 60 | for (const header of Object.keys(response.headers)) 61 | responseHeaders[header.toLowerCase()] = String(response.headers[header]); 62 | } 63 | let mimeType = base64Encoded ? 'application/octet-stream' : 'text/plain'; 64 | if (response.contentType) { 65 | responseHeaders['content-type'] = response.contentType; 66 | const index = response.contentType.indexOf(';'); 67 | if (index !== -1) 68 | mimeType = response.contentType.substring(0, index).trimEnd(); 69 | else 70 | mimeType = response.contentType.trim(); 71 | } 72 | if (responseBody && !('content-length' in responseHeaders)) 73 | responseHeaders['content-length'] = String(Buffer.byteLength(responseBody)); 74 | // In certain cases, protocol will return error if the request was already canceled 75 | // or the page was closed. We should tolerate these errors. 76 | await this._session.sendMayFail('Network.interceptWithResponse', { 77 | requestId: this._requestId, 78 | status: response.status || 200, 79 | statusText: network.STATUS_TEXTS[String(response.status || 200)], 80 | mimeType, 81 | headers: responseHeaders, 82 | base64Encoded, 83 | content: responseBody 84 | }); 85 | } 86 | async continue(overrides) { 87 | await this._interceptedPromise; 88 | // In certain cases, protocol will return error if the request was already canceled 89 | // or the page was closed. We should tolerate these errors. 90 | await this._session.sendMayFail('Network.interceptContinue', { 91 | requestId: this._requestId, 92 | method: overrides.method, 93 | headers: overrides.headers, 94 | postData: overrides.postData ? Buffer.from(overrides.postData).toString('base64') : undefined 95 | }); 96 | } 97 | createResponse(responsePayload) { 98 | const getResponseBody = async () => { 99 | const response = await this._session.send('Network.getResponseBody', { requestId: this._requestId }); 100 | return Buffer.from(response.body, response.base64Encoded ? 'base64' : 'utf8'); 101 | }; 102 | return new network.Response(this.request, responsePayload.status, responsePayload.statusText, headersObject(responsePayload.headers), getResponseBody); 103 | } 104 | } 105 | exports.WKInterceptableRequest = WKInterceptableRequest; 106 | function headersObject(headers) { 107 | const result = {}; 108 | for (const key of Object.keys(headers)) 109 | result[key.toLowerCase()] = headers[key]; 110 | return result; 111 | } 112 | //# sourceMappingURL=wkInterceptableRequest.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkProvisionalPage.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const helper_1 = require("../helper"); 19 | class WKProvisionalPage { 20 | constructor(session, page) { 21 | this._sessionListeners = []; 22 | this._mainFrameId = null; 23 | this._session = session; 24 | this._wkPage = page; 25 | const overrideFrameId = (handler) => { 26 | return (payload) => { 27 | // Pretend that the events happened in the same process. 28 | if (payload.frameId) 29 | payload.frameId = this._wkPage._page._frameManager.mainFrame()._id; 30 | handler(payload); 31 | }; 32 | }; 33 | const wkPage = this._wkPage; 34 | this._sessionListeners = [ 35 | helper_1.helper.addEventListener(session, 'Network.requestWillBeSent', overrideFrameId(e => wkPage._onRequestWillBeSent(session, e))), 36 | helper_1.helper.addEventListener(session, 'Network.requestIntercepted', overrideFrameId(e => wkPage._onRequestIntercepted(e))), 37 | helper_1.helper.addEventListener(session, 'Network.responseReceived', overrideFrameId(e => wkPage._onResponseReceived(e))), 38 | helper_1.helper.addEventListener(session, 'Network.loadingFinished', overrideFrameId(e => wkPage._onLoadingFinished(e))), 39 | helper_1.helper.addEventListener(session, 'Network.loadingFailed', overrideFrameId(e => wkPage._onLoadingFailed(e))), 40 | ]; 41 | this.initializationPromise = this._wkPage._initializeSession(session, true, ({ frameTree }) => this._handleFrameTree(frameTree)); 42 | } 43 | dispose() { 44 | helper_1.helper.removeEventListeners(this._sessionListeners); 45 | } 46 | commit() { 47 | helper_1.assert(this._mainFrameId); 48 | this._wkPage._onFrameAttached(this._mainFrameId, null); 49 | } 50 | _handleFrameTree(frameTree) { 51 | helper_1.assert(!frameTree.frame.parentId); 52 | this._mainFrameId = frameTree.frame.id; 53 | } 54 | } 55 | exports.WKProvisionalPage = WKProvisionalPage; 56 | //# sourceMappingURL=wkProvisionalPage.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/lib/webkit/wkWorkers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright 2019 Microsoft Corporation All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | Object.defineProperty(exports, "__esModule", { value: true }); 18 | const helper_1 = require("../helper"); 19 | const page_1 = require("../page"); 20 | const wkConnection_1 = require("./wkConnection"); 21 | const wkExecutionContext_1 = require("./wkExecutionContext"); 22 | class WKWorkers { 23 | constructor(page) { 24 | this._sessionListeners = []; 25 | this._workerSessions = new Map(); 26 | this._page = page; 27 | } 28 | setSession(session) { 29 | helper_1.helper.removeEventListeners(this._sessionListeners); 30 | this.clear(); 31 | this._sessionListeners = [ 32 | helper_1.helper.addEventListener(session, 'Worker.workerCreated', (event) => { 33 | const worker = new page_1.Worker(this._page, event.url); 34 | const workerSession = new wkConnection_1.WKSession(session.connection, event.workerId, 'Most likely the worker has been closed.', (message) => { 35 | session.send('Worker.sendMessageToWorker', { 36 | workerId: event.workerId, 37 | message: JSON.stringify(message) 38 | }).catch(e => { 39 | workerSession.dispatchMessage({ id: message.id, error: { message: e.message } }); 40 | }); 41 | }); 42 | this._workerSessions.set(event.workerId, workerSession); 43 | worker._createExecutionContext(new wkExecutionContext_1.WKExecutionContext(workerSession, undefined)); 44 | this._page._addWorker(event.workerId, worker); 45 | workerSession.on('Console.messageAdded', event => this._onConsoleMessage(worker, event)); 46 | Promise.all([ 47 | workerSession.send('Runtime.enable'), 48 | workerSession.send('Console.enable'), 49 | session.send('Worker.initialized', { workerId: event.workerId }) 50 | ]).catch(e => { 51 | // Worker can go as we are initializing it. 52 | this._page._removeWorker(event.workerId); 53 | }); 54 | }), 55 | helper_1.helper.addEventListener(session, 'Worker.dispatchMessageFromWorker', (event) => { 56 | const workerSession = this._workerSessions.get(event.workerId); 57 | if (!workerSession) 58 | return; 59 | workerSession.dispatchMessage(JSON.parse(event.message)); 60 | }), 61 | helper_1.helper.addEventListener(session, 'Worker.workerTerminated', (event) => { 62 | const workerSession = this._workerSessions.get(event.workerId); 63 | if (!workerSession) 64 | return; 65 | workerSession.dispose(); 66 | this._workerSessions.delete(event.workerId); 67 | this._page._removeWorker(event.workerId); 68 | }) 69 | ]; 70 | } 71 | clear() { 72 | this._page._clearWorkers(); 73 | this._workerSessions.clear(); 74 | } 75 | async initializeSession(session) { 76 | await session.send('Worker.enable'); 77 | } 78 | async _onConsoleMessage(worker, event) { 79 | const { type, level, text, parameters, url, line: lineNumber, column: columnNumber } = event.message; 80 | let derivedType = type || ''; 81 | if (type === 'log') 82 | derivedType = level; 83 | else if (type === 'timing') 84 | derivedType = 'timeEnd'; 85 | const handles = (parameters || []).map(p => { 86 | return worker._existingExecutionContext.createHandle(p); 87 | }); 88 | this._page._addConsoleMessage(derivedType, handles, { url, lineNumber: (lineNumber || 1) - 1, columnNumber: (columnNumber || 1) - 1 }, handles.length ? undefined : text); 89 | } 90 | } 91 | exports.WKWorkers = WKWorkers; 92 | //# sourceMappingURL=wkWorkers.js.map -------------------------------------------------------------------------------- /.yarn/unplugged/playwright-npm-1.1.1-eadb08ceef/node_modules/playwright/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "playwright", 3 | "version": "1.1.1", 4 | "description": "A high-level API to automate web browsers", 5 | "repository": "github:Microsoft/playwright", 6 | "engines": { 7 | "node": ">=10.15.0" 8 | }, 9 | "homepage": "https://playwright.dev", 10 | "main": "index.js", 11 | "scripts": { 12 | "install": "node install.js" 13 | }, 14 | "author": { 15 | "name": "Microsoft Corporation" 16 | }, 17 | "license": "Apache-2.0", 18 | "dependencies": { 19 | "debug": "^4.1.1", 20 | "extract-zip": "^2.0.0", 21 | "https-proxy-agent": "^3.0.0", 22 | "jpeg-js": "^0.3.7", 23 | "mime": "^2.4.4", 24 | "pngjs": "^5.0.0", 25 | "progress": "^2.0.3", 26 | "proxy-from-env": "^1.1.0", 27 | "rimraf": "^3.0.2", 28 | "ws": "^6.1.0" 29 | } 30 | } -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs 3 | spec: "@yarnpkg/plugin-typescript" 4 | 5 | yarnPath: .yarn/releases/yarn-berry.js 6 | -------------------------------------------------------------------------------- /images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orta/nightly-profile-updater/78c9073716bb072db646d73263a841c0cb2a0500/images/.gitkeep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "Hippocratic-2.1", 3 | "scripts": { 4 | "run": "ts-node run.ts" 5 | }, 6 | "dependencies": { 7 | "@octokit/graphql": "^4.5.1", 8 | "@types/node": "^14.0.14", 9 | "gm": "^1.23.1", 10 | "playwright": "^1.1.1", 11 | "ts-node": "^8.10.2", 12 | "typescript": "^3.9.5" 13 | }, 14 | "devDependencies": { 15 | "@types/gm": "^1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /run.ts: -------------------------------------------------------------------------------- 1 | const { join } = require("path"); 2 | import { graphql } from "@octokit/graphql"; 3 | import * as playwright from 'playwright'; 4 | import { existsSync } from "fs"; 5 | import { execSync } from "child_process"; 6 | 7 | 8 | (async () => { 9 | 10 | const response: any = await graphql( 11 | ` 12 | query { 13 | viewer { 14 | login 15 | pullRequests(last: 5) { 16 | nodes { 17 | repository { 18 | name 19 | owner { 20 | avatarUrl 21 | login 22 | } 23 | } 24 | state 25 | title 26 | bodyHTML 27 | } 28 | } 29 | } 30 | } 31 | `, 32 | { 33 | headers: { 34 | authorization: `token ${process.env.GITHUB_API_TOKEN}`, 35 | }, 36 | } 37 | ); 38 | console.log(`Got PRs for ${response.viewer.login}`) 39 | const prs = response.viewer.pullRequests.nodes 40 | 41 | const browser = await playwright["chromium"].launch(); 42 | for (const pr of prs) { 43 | const i = prs.indexOf(pr) 44 | const context = await browser.newContext(); 45 | const page = await context.newPage(); 46 | 47 | const url = `file:${join(__dirname, 'web', 'index.html')}`; 48 | await page.goto(url); 49 | 50 | const JS = ` 51 | document.getElementById("org-icon").src = '${pr.repository.owner.avatarUrl}' 52 | document.getElementById("repo-name").innerText = '${pr.repository.owner.login}/${pr.repository.name}' 53 | document.getElementById("pr-name").innerText = \`${pr.title.replace(/`/g, "'")}\` 54 | document.getElementById("pr-body").innerHTML = \`${pr.bodyHTML.replace(/`/g, "'")}\` 55 | document.getElementById("status").style.display = \`${pr.state === "MERGED" ? "block" : "none"}\` 56 | 57 | setIndex(${i}, ${prs.length}) 58 | ` 59 | try { 60 | await page.evaluate(JS); 61 | await page.screenshot({ path: `./images/${i}.png`, clip: { x: 0, y: 0, width: 378, height: 100 } }); 62 | } catch (error) { 63 | console.error(error) 64 | console.log(JS) 65 | await browser.close(); 66 | } 67 | } 68 | console.log("made screenshots") 69 | await browser.close(); 70 | 71 | if (existsSync("dd2892cdc1b724f5434cf674fa83f3a8")) { 72 | execSync("rm -rf dd2892cdc1b724f5434cf674fa83f3a8") 73 | } 74 | execSync(`git clone https://orta:${process.env.GITHUB_API_TOKEN}@gist.github.com/dd2892cdc1b724f5434cf674fa83f3a8.git`) 75 | execSync("rm dd2892cdc1b724f5434cf674fa83f3a8/*") 76 | 77 | 78 | const Gm = require("gm"); 79 | Gm() 80 | .in("images/*.png") 81 | .delay(400) 82 | .resize(378, 100) 83 | .write("dd2892cdc1b724f5434cf674fa83f3a8/main.gif", async function(err){ 84 | if (err) throw err; 85 | console.log("animated.gif created"); 86 | 87 | 88 | execSync("git add .", { cwd: "dd2892cdc1b724f5434cf674fa83f3a8" }) 89 | execSync("git commit -m 'update'", { cwd: "dd2892cdc1b724f5434cf674fa83f3a8" }) 90 | execSync("git push", { cwd: "dd2892cdc1b724f5434cf674fa83f3a8" }) 91 | 92 | console.log("done") 93 | }) 94 | })(); 95 | -------------------------------------------------------------------------------- /web/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orta/nightly-profile-updater/78c9073716bb072db646d73263a841c0cb2a0500/web/bg.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 86 | 99 | 100 | 101 |
102 |
103 | 104 |

danger/danger-js

105 |

106 | 109 |

110 |
111 |
112 |

Azure Devops support

113 |

some content, sure

114 |
115 |
116 |
117 |
118 |
119 |
120 | 121 | 122 | --------------------------------------------------------------------------------