diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9f1f55..06fe398 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,7 @@ jobs: - name: Install dependencies run: | pnpm install + npx puppeteer browsers install chrome cd test && pnpm install - name: Build the extension run: pnpm build diff --git a/.gitignore b/.gitignore index 53429cf..7829f90 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ node_modules/ # dev tools .bin +.cache # misc .DS_Store diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs new file mode 100644 index 0000000..5e5c94d --- /dev/null +++ b/.puppeteerrc.cjs @@ -0,0 +1,8 @@ +const { join } = require("path"); + +/** + * @type {import("puppeteer").Configuration} + */ +module.exports = { + cacheDirectory: join(__dirname, ".cache", "puppeteer"), +}; diff --git a/package.json b/package.json index 8fe0a84..dc663e3 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "mocha": "^10.6.0", "postcss": "^8.4.47", "prettier": "3.3.3", - "puppeteer": "^22.12.1", + "puppeteer": "^23.6.0", "source-map-support": "^0.5.21", "tailwindcss": "^3.4.13", "ts-node": "^10.9.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb89fcf..7e22724 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -106,8 +106,8 @@ importers: specifier: 3.3.3 version: 3.3.3 puppeteer: - specifier: ^22.12.1 - version: 22.12.1(typescript@5.5.4) + specifier: ^23.6.0 + version: 23.6.0(typescript@5.5.4) source-map-support: specifier: ^0.5.21 version: 0.5.21 @@ -1352,8 +1352,8 @@ packages: resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} engines: {node: '>=12'} - '@puppeteer/browsers@2.2.3': - resolution: {integrity: sha512-bJ0UBsk0ESOs6RFcLXOt99a3yTDcOKlzfjad+rhFwdaG1Lu/Wzq58GHYCDTlZ9z6mldf4g+NTb+TXEfe0PpnsQ==} + '@puppeteer/browsers@2.4.0': + resolution: {integrity: sha512-x8J1csfIygOwf6D6qUAZ0ASk3z63zPb7wkNeHRerCMh82qWKUrOgkuP005AJC8lDL6/evtXETGEJVcwykKT4/g==} engines: {node: '>=18'} hasBin: true @@ -2031,8 +2031,8 @@ packages: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} - chromium-bidi@0.5.24: - resolution: {integrity: sha512-5xQNN2SVBdZv4TxeMLaI+PelrnZsHDhn8h2JtyriLr+0qHcZS8BMuo93qN6J1VmtmrgYP+rmcLHcbpnA8QJh+w==} + chromium-bidi@0.8.0: + resolution: {integrity: sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==} peerDependencies: devtools-protocol: '*' @@ -2192,6 +2192,15 @@ packages: supports-color: optional: true + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} @@ -2247,8 +2256,8 @@ packages: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} - devtools-protocol@0.0.1299070: - resolution: {integrity: sha512-+qtL3eX50qsJ7c+qVyagqi7AWMoQCBGNfoyJZMwm/NSXVqLYbuitrWEEIzxfUmTNy7//Xe8yhMmQ+elj3uAqSg==} + devtools-protocol@0.0.1354347: + resolution: {integrity: sha512-BlmkSqV0V84E2WnEnoPnwyix57rQxAM5SKJjf4TbYOCGLAWtz8CDH8RIaGOjPgPCXo2Mce3kxSY497OySidY3Q==} didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -3538,12 +3547,12 @@ packages: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} - puppeteer-core@22.12.1: - resolution: {integrity: sha512-XmqeDPVdC5/3nGJys1jbgeoZ02wP0WV1GBlPtr/ULRbGXJFuqgXMcKQ3eeNtFpBzGRbpeoCGWHge1ZWKWl0Exw==} + puppeteer-core@23.6.0: + resolution: {integrity: sha512-se1bhgUpR9C529SgHGr/eyT92mYyQPAhA2S9pGtGrVG2xob9qE6Pbp7TlqiSPlnnY1lINqhn6/67EwkdzOmKqQ==} engines: {node: '>=18'} - puppeteer@22.12.1: - resolution: {integrity: sha512-1GxY8dnEnHr1SLzdSDr0FCjM6JQfAh2E2I/EqzeF8a58DbGVk9oVjj4lFdqNoVbpgFSpAbz7VER9St7S1wDpNg==} + puppeteer@23.6.0: + resolution: {integrity: sha512-l+Fgo8SVFSd51STtq2crz8t1Y3VXowsuR4zfR64qDOn6oggz7YIZauWiNR4IJjczQ6nvFs3S4cgng55/nesxTQ==} engines: {node: '>=18'} hasBin: true @@ -3718,13 +3727,13 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} hasBin: true @@ -3876,8 +3885,8 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - tar-fs@3.0.5: - resolution: {integrity: sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==} + tar-fs@3.0.6: + resolution: {integrity: sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==} tar-stream@3.1.6: resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==} @@ -4008,6 +4017,9 @@ packages: typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + typed-query-selector@2.12.0: + resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} + typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} @@ -5836,14 +5848,14 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@puppeteer/browsers@2.2.3': + '@puppeteer/browsers@2.4.0': dependencies: - debug: 4.3.4 + debug: 4.3.7 extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.4.0 - semver: 7.6.0 - tar-fs: 3.0.5 + semver: 7.6.3 + tar-fs: 3.0.6 unbzip2-stream: 1.4.3 yargs: 17.7.2 transitivePeerDependencies: @@ -6265,7 +6277,7 @@ snapshots: agent-base@7.1.0: dependencies: - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -6554,9 +6566,9 @@ snapshots: chrome-trace-event@1.0.3: {} - chromium-bidi@0.5.24(devtools-protocol@0.0.1299070): + chromium-bidi@0.8.0(devtools-protocol@0.0.1354347): dependencies: - devtools-protocol: 0.0.1299070 + devtools-protocol: 0.0.1354347 mitt: 3.0.1 urlpattern-polyfill: 10.0.0 zod: 3.23.8 @@ -6713,6 +6725,10 @@ snapshots: optionalDependencies: supports-color: 8.1.1 + debug@4.3.7: + dependencies: + ms: 2.1.3 + decamelize@4.0.0: {} decompress-response@6.0.0: @@ -6757,7 +6773,7 @@ snapshots: detect-libc@2.0.3: {} - devtools-protocol@0.0.1299070: {} + devtools-protocol@0.0.1354347: {} didyoumean@1.2.2: {} @@ -7069,7 +7085,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -7197,7 +7213,7 @@ snapshots: dependencies: basic-ftp: 5.0.3 data-uri-to-buffer: 5.0.1 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -7345,7 +7361,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -7357,7 +7373,7 @@ snapshots: https-proxy-agent@7.0.4: dependencies: agent-base: 7.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -7989,7 +8005,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 get-uri: 6.0.1 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 @@ -8224,7 +8240,7 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 lru-cache: 7.18.3 @@ -8246,24 +8262,27 @@ snapshots: punycode@2.3.0: {} - puppeteer-core@22.12.1: + puppeteer-core@23.6.0: dependencies: - '@puppeteer/browsers': 2.2.3 - chromium-bidi: 0.5.24(devtools-protocol@0.0.1299070) - debug: 4.3.5(supports-color@8.1.1) - devtools-protocol: 0.0.1299070 + '@puppeteer/browsers': 2.4.0 + chromium-bidi: 0.8.0(devtools-protocol@0.0.1354347) + debug: 4.3.7 + devtools-protocol: 0.0.1354347 + typed-query-selector: 2.12.0 ws: 8.18.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - puppeteer@22.12.1(typescript@5.5.4): + puppeteer@23.6.0(typescript@5.5.4): dependencies: - '@puppeteer/browsers': 2.2.3 + '@puppeteer/browsers': 2.4.0 + chromium-bidi: 0.8.0(devtools-protocol@0.0.1354347) cosmiconfig: 9.0.0(typescript@5.5.4) - devtools-protocol: 0.0.1299070 - puppeteer-core: 22.12.1 + devtools-protocol: 0.0.1354347 + puppeteer-core: 23.6.0 + typed-query-selector: 2.12.0 transitivePeerDependencies: - bufferutil - supports-color @@ -8438,12 +8457,10 @@ snapshots: dependencies: lru-cache: 6.0.0 - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - semver@7.6.2: {} + semver@7.6.3: {} + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 @@ -8505,7 +8522,7 @@ snapshots: socks-proxy-agent@8.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -8671,7 +8688,7 @@ snapshots: transitivePeerDependencies: - ts-node - tar-fs@3.0.5: + tar-fs@3.0.6: dependencies: pump: 3.0.0 tar-stream: 3.1.6 @@ -8821,6 +8838,8 @@ snapshots: for-each: 0.3.3 is-typed-array: 1.1.12 + typed-query-selector@2.12.0: {} + typescript@5.2.2: {} typescript@5.5.4: {} @@ -9056,7 +9075,7 @@ snapshots: yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.1 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 diff --git a/test/src/button-contributions.spec.ts b/test/src/button-contributions.spec.ts index 4b2a12c..f09c9c5 100644 --- a/test/src/button-contributions.spec.ts +++ b/test/src/button-contributions.spec.ts @@ -11,6 +11,7 @@ describe("Query Selector Tests", function () { before(async function () { browser = await puppeteer.launch({ headless: "new", + product: "chrome", }); page = await browser.newPage(); });