Skip to content

The free and privacy-friendly screen recorder with no limits 🎥

Improve upload stalls and better diagnostics

Alyssa X1ecf37779a01
diff --git a/package-lock.json b/package-lock.json
index bd43e33..3b77b78 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -73,6 +73,8 @@
"sass-loader": "^16.0.7",
"source-map-loader": "^3.0.1",
"style-loader": "^3.3.1",
+ "stylelint": "^17.8.0",
+ "stylelint-config-standard-scss": "^17.0.0",
"terser-webpack-plugin": "^5.3.6",
"ts-loader": "^9.4.1",
"typescript": "^4.9.3",
@@ -1613,6 +1615,192 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@cacheable/memory": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.8.tgz",
+ "integrity": "sha512-FvEb29x5wVwu/Kf93IWwsOOEuhHh6dYCJF3vcKLzXc0KXIW181AOzv6ceT4ZpBHDvAfG60eqb+ekmrnLHIy+jw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cacheable/utils": "^2.4.0",
+ "@keyv/bigmap": "^1.3.1",
+ "hookified": "^1.15.1",
+ "keyv": "^5.6.0"
+ }
+ },
+ "node_modules/@cacheable/utils": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.4.1.tgz",
+ "integrity": "sha512-eiFgzCbIneyMlLOmNG4g9xzF7Hv3Mga4LjxjcSC/ues6VYq2+gUbQI8JqNuw/ZM8tJIeIaBGpswAsqV2V7ApgA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hashery": "^1.5.1",
+ "keyv": "^5.6.0"
+ }
+ },
+ "node_modules/@csstools/css-calc": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.2.0.tgz",
+ "integrity": "sha512-bR9e6o2BDB12jzN/gIbjHa5wLJ4UjD1CB9pM7ehlc0ddk6EBz+yYS1EV2MF55/HUxrHcB/hehAyt5vhsA3hx7w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^4.0.0",
+ "@csstools/css-tokenizer": "^4.0.0"
+ }
+ },
+ "node_modules/@csstools/css-parser-algorithms": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.0.tgz",
+ "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-tokenizer": "^4.0.0"
+ }
+ },
+ "node_modules/@csstools/css-syntax-patches-for-csstree": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.3.tgz",
+ "integrity": "sha512-SH60bMfrRCJF3morcdk57WklujF4Jr/EsQUzqkarfHXEFcAR1gg7fS/chAE922Sehgzc1/+Tz5H3Ypa1HiEKrg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
+ "peerDependencies": {
+ "css-tree": "^3.2.1"
+ },
+ "peerDependenciesMeta": {
+ "css-tree": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@csstools/css-tokenizer": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.0.tgz",
+ "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ }
+ },
+ "node_modules/@csstools/media-query-list-parser": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-5.0.0.tgz",
+ "integrity": "sha512-T9lXmZOfnam3eMERPsszjY5NK0jX8RmThmmm99FZ8b7z8yMaFZWKwLWGZuTwdO3ddRY5fy13GmmEYZXB4I98Eg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^4.0.0",
+ "@csstools/css-tokenizer": "^4.0.0"
+ }
+ },
+ "node_modules/@csstools/selector-resolve-nested": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-4.0.0.tgz",
+ "integrity": "sha512-9vAPxmp+Dx3wQBIUwc1v7Mdisw1kbbaGqXUM8QLTgWg7SoPGYtXBsMXvsFs/0Bn5yoFhcktzxNZGNaUt0VjgjA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "postcss-selector-parser": "^7.1.1"
+ }
+ },
+ "node_modules/@csstools/selector-specificity": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-6.0.0.tgz",
+ "integrity": "sha512-4sSgl78OtOXEX/2d++8A83zHNTgwCJMaR24FvsYL7Uf/VS8HZk9PTwR51elTbGqMuwH3szLvvOXEaVnqn0Z3zA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "postcss-selector-parser": "^7.1.1"
+ }
+ },
"node_modules/@discoveryjs/json-ext": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz",
@@ -1717,6 +1905,30 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
+ "node_modules/@keyv/bigmap": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz",
+ "integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hashery": "^1.4.0",
+ "hookified": "^1.15.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "peerDependencies": {
+ "keyv": "^5.6.0"
+ }
+ },
+ "node_modules/@keyv/serialize": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz",
+ "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@leichtgewicht/ip-codec": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz",
@@ -3768,6 +3980,19 @@
"node": ">=8"
}
},
+ "node_modules/@sindresorhus/merge-streams": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/@tanem/svg-injector": {
"version": "10.1.68",
"resolved": "https://registry.npmjs.org/@tanem/svg-injector/-/svg-injector-10.1.68.tgz",
@@ -4524,6 +4749,13 @@
"node": ">= 6"
}
},
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true,
+ "license": "Python-2.0"
+ },
"node_modules/aria-hidden": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz",
@@ -4550,6 +4782,16 @@
"node": ">=8"
}
},
+ "node_modules/astral-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
@@ -4865,6 +5107,20 @@
"node": ">= 0.8"
}
},
+ "node_modules/cacheable": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.3.4.tgz",
+ "integrity": "sha512-djgxybDbw9fL/ZWMI3+CE8ZilNxcwFkVtDc1gJ+IlOSSWkSMPQabhV/XCHTQ6pwwN6aivXPZ43omTooZiX06Ew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cacheable/memory": "^2.0.8",
+ "@cacheable/utils": "^2.4.0",
+ "hookified": "^1.15.0",
+ "keyv": "^5.6.0",
+ "qified": "^0.9.0"
+ }
+ },
"node_modules/call-bind": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
@@ -4909,6 +5165,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/camel-case": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
@@ -5105,6 +5371,13 @@
"color-support": "bin.js"
}
},
+ "node_modules/colord": {
+ "version": "2.9.3",
+ "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz",
+ "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/colorette": {
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
@@ -5407,6 +5680,33 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
+ "node_modules/cosmiconfig": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.1.tgz",
+ "integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "env-paths": "^2.2.1",
+ "import-fresh": "^3.3.0",
+ "js-yaml": "^4.1.0",
+ "parse-json": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/d-fischer"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.9.5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/cross-env": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
@@ -5438,6 +5738,16 @@
"node": ">= 8"
}
},
+ "node_modules/css-functions-list": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.3.3.tgz",
+ "integrity": "sha512-8HFEBPKhOpJPEPu70wJJetjKta86Gw9+CCyCnB3sui2qQfOvRyqBy4IKLKKAwdMpWb2lHXWk9Wb4Z6AmaUT1Pg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/css-loader": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz",
@@ -5501,6 +5811,20 @@
"url": "https://github.com/sponsors/fb55"
}
},
+ "node_modules/css-tree": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
+ "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mdn-data": "2.27.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
+ }
+ },
"node_modules/css-what": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz",
@@ -5928,6 +6252,16 @@
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
+ "node_modules/env-paths": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/envinfo": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.18.0.tgz",
@@ -5940,6 +6274,16 @@
"node": ">=4"
}
},
+ "node_modules/error-ex": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",
+ "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-arrayish": "^0.2.1"
+ }
+ },
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
@@ -6298,6 +6642,16 @@
"node": ">=0.8.0"
}
},
+ "node_modules/file-entry-cache": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.2.tgz",
+ "integrity": "sha512-N2WFfK12gmrK1c1GXOqiAJ1tc5YE+R53zvQ+t5P8S5XhnmKYVB5eZEiLNZKDSmoG8wqqbF9EXYBBW/nef19log==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flat-cache": "^6.1.20"
+ }
+ },
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
@@ -6396,6 +6750,25 @@
"flat": "cli.js"
}
},
+ "node_modules/flat-cache": {
+ "version": "6.1.22",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.22.tgz",
+ "integrity": "sha512-N2dnzVJIphnNsjHcrxGW7DePckJ6haPrSFqpsBUhHYgwtKGVq4JrBGielEGD2fCVnsGm1zlBVZ8wGhkyuetgug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cacheable": "^2.3.4",
+ "flatted": "^3.4.2",
+ "hookified": "^1.15.0"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
+ "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
@@ -6533,6 +6906,19 @@
"node": "6.* || 8.* || >= 10.*"
}
},
+ "node_modules/get-east-asian-width": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz",
+ "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -6634,28 +7020,76 @@
"license": "BSD-2-Clause",
"peer": true
},
- "node_modules/globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "node_modules/global-modules": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
+ "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
"dev": true,
+ "license": "MIT",
"dependencies": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
+ "global-prefix": "^3.0.0"
},
"engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
+ "node": ">=6"
}
},
- "node_modules/gopd": {
- "version": "1.2.0",
+ "node_modules/global-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+ "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ini": "^1.3.5",
+ "kind-of": "^6.0.2",
+ "which": "^1.3.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/global-prefix/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
+ "node_modules/globby": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
+ "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "dev": true,
+ "dependencies": {
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.2.9",
+ "ignore": "^5.2.0",
+ "merge2": "^1.4.1",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/globjoin": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz",
+ "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"engines": {
@@ -6726,6 +7160,19 @@
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
"optional": true
},
+ "node_modules/hashery": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz",
+ "integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hookified": "^1.15.0"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
@@ -6746,6 +7193,13 @@
"he": "bin/he"
}
},
+ "node_modules/hookified": {
+ "version": "1.15.1",
+ "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz",
+ "integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/hpack.js": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz",
@@ -6827,6 +7281,19 @@
"node": ">=12"
}
},
+ "node_modules/html-tags": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-5.1.0.tgz",
+ "integrity": "sha512-n6l5uca7/y5joxZ3LUePhzmBFUJ+U2YWzhMa8XUTecSeSlQiZdF5XAd/Q3/WUl0VsXgUwWi8I7CNIwdI5WN1SQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/html-webpack-plugin": {
"version": "5.6.4",
"resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.4.tgz",
@@ -7049,6 +7516,33 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/import-fresh/node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/import-local": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz",
@@ -7141,6 +7635,17 @@
"node": ">=8"
}
},
+ "node_modules/import-meta-resolve": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",
+ "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@@ -7157,6 +7662,13 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
+ "node_modules/ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/int64-buffer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/int64-buffer/-/int64-buffer-1.1.0.tgz",
@@ -7180,6 +7692,13 @@
"node": ">= 10"
}
},
+ "node_modules/is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
@@ -7258,6 +7777,19 @@
"node": ">=0.12.0"
}
},
+ "node_modules/is-path-inside": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz",
+ "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-plain-obj": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz",
@@ -7348,6 +7880,19 @@
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
+ "node_modules/js-yaml": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
"node_modules/jsdom": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz",
@@ -7408,8 +7953,7 @@
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
- "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
- "peer": true
+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
"node_modules/json-schema-traverse": {
"version": "1.0.0",
@@ -7475,6 +8019,16 @@
"setimmediate": "^1.0.5"
}
},
+ "node_modules/keyv": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz",
+ "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@keyv/serialize": "^1.1.1"
+ }
+ },
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -7492,6 +8046,13 @@
"graceful-fs": "^4.1.11"
}
},
+ "node_modules/known-css-properties": {
+ "version": "0.37.0",
+ "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.37.0.tgz",
+ "integrity": "sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/launch-editor": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.11.1.tgz",
@@ -7510,6 +8071,13 @@
"immediate": "~3.0.5"
}
},
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/loader-runner": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz",
@@ -7584,6 +8152,13 @@
"integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==",
"dev": true
},
+ "node_modules/lodash.truncate": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
+ "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
@@ -7635,6 +8210,24 @@
"node": ">= 0.4"
}
},
+ "node_modules/mathml-tag-names": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-4.0.0.tgz",
+ "integrity": "sha512-aa6AU2Pcx0VP/XWnh8IGL0SYSgQHDT6Ucror2j2mXeFAlN3ahaNs8EZtG1YiticMkSLj3Gt6VPFfZogt7G5iFQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/mdn-data": {
+ "version": "2.27.1",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
+ "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -7672,6 +8265,19 @@
"node": ">= 4.0.0"
}
},
+ "node_modules/meow": {
+ "version": "14.1.0",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-14.1.0.tgz",
+ "integrity": "sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/merge-descriptors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
@@ -8229,6 +8835,38 @@
"tslib": "^2.0.3"
}
},
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-json": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "error-ex": "^1.3.1",
+ "json-parse-even-better-errors": "^2.3.0",
+ "lines-and-columns": "^1.1.6"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/parse5": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
@@ -8416,9 +9054,9 @@
}
},
"node_modules/postcss": {
- "version": "8.5.6",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
- "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
+ "version": "8.5.10",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz",
+ "integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==",
"dev": true,
"funding": [
{
@@ -8434,6 +9072,7 @@
"url": "https://github.com/sponsors/ai"
}
],
+ "license": "MIT",
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -8443,6 +9082,13 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/postcss-media-query-parser": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz",
+ "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/postcss-modules-extract-imports": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz",
@@ -8502,11 +9148,73 @@
"postcss": "^8.1.0"
}
},
+ "node_modules/postcss-resolve-nested-selector": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz",
+ "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/postcss-safe-parser": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.0.1.tgz",
+ "integrity": "sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss-safe-parser"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4.31"
+ }
+ },
+ "node_modules/postcss-scss": {
+ "version": "4.0.9",
+ "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz",
+ "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss-scss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4.29"
+ }
+ },
"node_modules/postcss-selector-parser": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz",
- "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",
+ "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
@@ -8608,6 +9316,26 @@
"node": ">=6"
}
},
+ "node_modules/qified": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/qified/-/qified-0.9.1.tgz",
+ "integrity": "sha512-n7mar4T0xQ+39dE2vGTAlbxUEpndwPANH0kDef1/MYsB8Bba9wshkybIRx74qgcvKQPEWErf9AqAdYjhzY2Ilg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hookified": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/qified/node_modules/hookified": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/hookified/-/hookified-2.1.1.tgz",
+ "integrity": "sha512-AHb76R16GB5EsPBE2J7Ko5kiEyXwviB9P5SMrAKcuAu4vJPZttViAbj9+tZeaQE5zjDme+1vcHP78Yj/WoAveA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/qs": {
"version": "6.14.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz",
@@ -9745,6 +10473,24 @@
"node": ">=8"
}
},
+ "node_modules/slice-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"
+ }
+ },
"node_modules/sockjs": {
"version": "0.3.24",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
@@ -9923,6 +10669,296 @@
"webpack": "^5.0.0"
}
},
+ "node_modules/stylelint": {
+ "version": "17.8.0",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-17.8.0.tgz",
+ "integrity": "sha512-oHkld9T60LDSaUQ4CSVc+tlt9eUoDlxhaGWShsUCKyIL14boZfmK5bSphZqx64aiC5tCqX+BsQMTMoSz8D1zIg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stylelint"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/stylelint"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@csstools/css-calc": "^3.1.1",
+ "@csstools/css-parser-algorithms": "^4.0.0",
+ "@csstools/css-syntax-patches-for-csstree": "^1.1.2",
+ "@csstools/css-tokenizer": "^4.0.0",
+ "@csstools/media-query-list-parser": "^5.0.0",
+ "@csstools/selector-resolve-nested": "^4.0.0",
+ "@csstools/selector-specificity": "^6.0.0",
+ "colord": "^2.9.3",
+ "cosmiconfig": "^9.0.1",
+ "css-functions-list": "^3.3.3",
+ "css-tree": "^3.2.1",
+ "debug": "^4.4.3",
+ "fast-glob": "^3.3.3",
+ "fastest-levenshtein": "^1.0.16",
+ "file-entry-cache": "^11.1.2",
+ "global-modules": "^2.0.0",
+ "globby": "^16.2.0",
+ "globjoin": "^0.1.4",
+ "html-tags": "^5.1.0",
+ "ignore": "^7.0.5",
+ "import-meta-resolve": "^4.2.0",
+ "is-plain-object": "^5.0.0",
+ "mathml-tag-names": "^4.0.0",
+ "meow": "^14.1.0",
+ "micromatch": "^4.0.8",
+ "normalize-path": "^3.0.0",
+ "picocolors": "^1.1.1",
+ "postcss": "^8.5.9",
+ "postcss-safe-parser": "^7.0.1",
+ "postcss-selector-parser": "^7.1.1",
+ "postcss-value-parser": "^4.2.0",
+ "string-width": "^8.2.0",
+ "supports-hyperlinks": "^4.4.0",
+ "svg-tags": "^1.0.0",
+ "table": "^6.9.0",
+ "write-file-atomic": "^7.0.1"
+ },
+ "bin": {
+ "stylelint": "bin/stylelint.mjs"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ }
+ },
+ "node_modules/stylelint-config-recommended": {
+ "version": "18.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-18.0.0.tgz",
+ "integrity": "sha512-mxgT2XY6YZ3HWWe3Di8umG6aBmWmHTblTgu/f10rqFXnyWxjKWwNdjSWkgkwCtxIKnqjSJzvFmPT5yabVIRxZg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stylelint"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/stylelint"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "stylelint": "^17.0.0"
+ }
+ },
+ "node_modules/stylelint-config-recommended-scss": {
+ "version": "17.0.1",
+ "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-17.0.1.tgz",
+ "integrity": "sha512-x5DVehzJudcwF0od3sGpgkln2PLLranFE7twwbp7dqDINCyZvwzFkMc6TLhNOvazRiVBJYATQLouJY0xPGB8WA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "postcss-scss": "^4.0.9",
+ "stylelint-config-recommended": "^18.0.0",
+ "stylelint-scss": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "postcss": "^8.3.3",
+ "stylelint": "^17.0.0"
+ },
+ "peerDependenciesMeta": {
+ "postcss": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/stylelint-config-standard": {
+ "version": "40.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-40.0.0.tgz",
+ "integrity": "sha512-EznGJxOUhtWck2r6dJpbgAdPATIzvpLdK9+i5qPd4Lx70es66TkBPljSg4wN3Qnc6c4h2n+WbUrUynQ3fanjHw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stylelint"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/stylelint"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "stylelint-config-recommended": "^18.0.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "stylelint": "^17.0.0"
+ }
+ },
+ "node_modules/stylelint-config-standard-scss": {
+ "version": "17.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-17.0.0.tgz",
+ "integrity": "sha512-uLJS6xgOCBw5EMsDW7Ukji8l28qRoMnkRch15s0qwZpskXvWt9oPzMmcYM307m9GN4MxuWLsQh4I6hU9yI53cQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "stylelint-config-recommended-scss": "^17.0.0",
+ "stylelint-config-standard": "^40.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "postcss": "^8.3.3",
+ "stylelint": "^17.0.0"
+ },
+ "peerDependenciesMeta": {
+ "postcss": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/stylelint-scss": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-7.0.0.tgz",
+ "integrity": "sha512-H88kCC+6Vtzj76NsC8rv6x/LW8slBzIbyeSjsKVlS+4qaEJoDrcJR4L+8JdrR2ORdTscrBzYWiiT2jq6leYR1Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "css-tree": "^3.0.1",
+ "is-plain-object": "^5.0.0",
+ "known-css-properties": "^0.37.0",
+ "mdn-data": "^2.25.0",
+ "postcss-media-query-parser": "^0.2.3",
+ "postcss-resolve-nested-selector": "^0.1.6",
+ "postcss-selector-parser": "^7.1.1",
+ "postcss-value-parser": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "stylelint": "^16.8.2 || ^17.0.0"
+ }
+ },
+ "node_modules/stylelint-scss/node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stylelint/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/stylelint/node_modules/globby": {
+ "version": "16.2.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-16.2.0.tgz",
+ "integrity": "sha512-QrJia2qDf5BB/V6HYlDTs0I0lBahyjLzpGQg3KT7FnCdTonAyPy2RtY802m2k4ALx6Dp752f82WsOczEVr3l6Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@sindresorhus/merge-streams": "^4.0.0",
+ "fast-glob": "^3.3.3",
+ "ignore": "^7.0.5",
+ "is-path-inside": "^4.0.0",
+ "slash": "^5.1.0",
+ "unicorn-magic": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/stylelint/node_modules/ignore": {
+ "version": "7.0.5",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/stylelint/node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stylelint/node_modules/slash": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
+ "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/stylelint/node_modules/string-width": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz",
+ "integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "get-east-asian-width": "^1.5.0",
+ "strip-ansi": "^7.1.2"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/stylelint/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
"node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
@@ -9937,6 +10973,49 @@
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
+ "node_modules/supports-hyperlinks": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-4.4.0.tgz",
+ "integrity": "sha512-UKbpT93hN5Nr9go5UY7bopIB9YQlMz9nm/ct4IXt/irb5YRkn9WaqrOBJGZ5Pwvsd5FQzSVeYlGdXoCAPQZrPg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^5.0.1",
+ "supports-color": "^10.2.2"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-hyperlinks?sponsor=1"
+ }
+ },
+ "node_modules/supports-hyperlinks/node_modules/has-flag": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-5.0.1.tgz",
+ "integrity": "sha512-CsNUt5x9LUdx6hnk/E2SZLsDyvfqANZSUq4+D3D8RzDJ2M+HDTIkF60ibS1vHaK55vzgiZw1bEPFG9yH7l33wA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-hyperlinks/node_modules/supports-color": {
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
@@ -9949,12 +11028,35 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/svg-tags": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz",
+ "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
+ "dev": true
+ },
"node_modules/symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
"optional": true
},
+ "node_modules/table": {
+ "version": "6.9.0",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz",
+ "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "ajv": "^8.0.1",
+ "lodash.truncate": "^4.4.2",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.3",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
"node_modules/tapable": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",
@@ -10242,6 +11344,19 @@
"node": ">=4"
}
},
+ "node_modules/unicorn-magic": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz",
+ "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/universalify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
@@ -10830,6 +11945,32 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"devOptional": true
},
+ "node_modules/write-file-atomic": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-7.0.1.tgz",
+ "integrity": "sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "signal-exit": "^4.0.1"
+ },
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
+ "node_modules/write-file-atomic/node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/ws": {
"version": "8.18.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
diff --git a/package.json b/package.json
index 4c183a5..0069006 100755
--- a/package.json
+++ b/package.json
@@ -3,16 +3,20 @@
"version": "4.3.0",
"description": "The free and privacy-friendly screen recorder with no sign in needed.",
"scripts": {
- "build": "cross-env NODE_ENV=production node utils/build.js",
+ "build": "cross-env NODE_ENV=development node utils/build.js",
+ "build:prod": "cross-env NODE_ENV=production node utils/build.js",
+ "build:release": "cross-env NODE_ENV=production SCREENITY_SKIP_ENV=true node utils/build.js",
"start": "cross-env NODE_ENV=development node utils/server.js",
"dev": "npm run hot-reload",
"watch": "cross-env NODE_ENV=development webpack --watch",
"hot-reload": "cross-env NODE_ENV=development webpack serve --hot",
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"postinstall": "patch-package && node scripts/patch-radix.js",
- "package": "npm run build && cd build && zip -r ../extension.zip . && cd ..",
+ "package": "npm run build:prod && cd build && zip -r ../extension.zip . && cd ..",
+ "package:release": "npm run build:release && cd build && zip -r ../extension.zip . && cd ..",
"clean": "rm -rf build && mkdir build",
- "lint": "eslint src/**/*.js --fix"
+ "lint": "eslint src/**/*.js --fix",
+ "build:content-css": "sass src/pages/Content/styles/app.scss src/pages/Content/styles/app.css --no-source-map"
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.27.1",
@@ -79,6 +83,8 @@
"sass-loader": "^16.0.7",
"source-map-loader": "^3.0.1",
"style-loader": "^3.3.1",
+ "stylelint": "^17.8.0",
+ "stylelint-config-standard-scss": "^17.0.0",
"terser-webpack-plugin": "^5.3.6",
"ts-loader": "^9.4.1",
"typescript": "^4.9.3",
diff --git a/src/manifest.json b/src/manifest.json
index b5af946..7bdf2f8 100755
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -3,7 +3,7 @@
"name": "__MSG_extName__",
"description": "__MSG_extDesc__",
"default_locale": "en",
- "version": "4.3.5",
+ "version": "4.3.6",
"background": {
"service_worker": "background.bundle.js"
},
@@ -33,7 +33,7 @@
"vendor/*",
"cloudrecorder.html",
"recorder.html",
- "recorderoffscreen.html",
+ "offscreenrecorder.html",
"sandbox.html",
"wrapper.html",
"camera.html",
@@ -116,7 +116,7 @@
"managed_schema": "schema.json"
},
"externally_connectable": {
- "matches": ["https://app.screenity.io/*"]
+ "matches": ["https://app.screenity.io/*", "http://localhost:3000/*"]
},
"optional_permissions": [
"offscreen",
diff --git a/src/pages/Background/alarms/alarmConstants.js b/src/pages/Background/alarms/alarmConstants.js
new file mode 100644
index 0000000..667222f
--- /dev/null
+++ b/src/pages/Background/alarms/alarmConstants.js
@@ -0,0 +1,2 @@
+export const FIRST_CHUNK_WATCHDOG_ALARM = "first-chunk-watchdog";
+export const RECORDER_KEEPALIVE_ALARM = "recorder-keepalive";
diff --git a/src/pages/Background/alarms/handleAlarm.js b/src/pages/Background/alarms/handleAlarm.js
index e2df230..4ddf347 100644
--- a/src/pages/Background/alarms/handleAlarm.js
+++ b/src/pages/Background/alarms/handleAlarm.js
@@ -3,13 +3,18 @@ import { sendMessageTab } from "../tabManagement";
import { sendMessageRecord } from "../recording/sendMessageRecord.js";
import { diagEvent } from "../../utils/diagnosticLog";
import { chunksStore } from "../recording/chunkHandler";
+import { emitRecordingTelemetry } from "../recording/emitRecordingTelemetry";
import {
CLOUD_LOCAL_PLAYBACK_KEY,
CLOUD_LOCAL_PLAYBACK_EVENT_KEY,
CLOUD_LOCAL_PLAYBACK_ALARM,
} from "../recording/cloudLocalPlaybackConstants";
+import {
+ FIRST_CHUNK_WATCHDOG_ALARM,
+ RECORDER_KEEPALIVE_ALARM,
+} from "./alarmConstants";
-export const FIRST_CHUNK_WATCHDOG_ALARM = "first-chunk-watchdog";
+export { FIRST_CHUNK_WATCHDOG_ALARM, RECORDER_KEEPALIVE_ALARM };
// Utility to handle tab messaging logic.
// `tab` is an optional Chrome Tab object used as a fallback when the stored
@@ -35,6 +40,120 @@ const handleTabMessaging = async (tab) => {
};
export const handleAlarm = async (alarm) => {
+ if (alarm.name === RECORDER_KEEPALIVE_ALARM) {
+ const snap = await chrome.storage.local.get([
+ "recordingTab",
+ "recording",
+ "pendingRecording",
+ "paused",
+ "firstChunkAt",
+ "lastChunkAt",
+ "recordingStallLevel",
+ ]);
+ if (!(snap.recording || snap.pendingRecording) || !snap.recordingTab) {
+ await chrome.alarms.clear(RECORDER_KEEPALIVE_ALARM);
+ await chrome.storage.local.set({
+ recordingStallLevel: 0,
+ firstChunkAt: null,
+ lastChunkAt: null,
+ });
+ return;
+ }
+
+ try {
+ await chrome.tabs.sendMessage(snap.recordingTab, {
+ type: "recorder-keepalive-ping",
+ });
+ } catch {}
+
+ const WATCHDOG_STALE_MS = 90_000; // chunks arrive every 2s; 45x headroom
+ const notReady = !snap.firstChunkAt;
+ const pausedNow = !!snap.paused;
+ const now = Date.now();
+ const age = now - (snap.lastChunkAt || 0);
+ const stallLevel = snap.recordingStallLevel || 0;
+
+ if (notReady || pausedNow || age < WATCHDOG_STALE_MS) {
+ if (stallLevel !== 0) {
+ await chrome.storage.local.set({ recordingStallLevel: 0 });
+ }
+ return;
+ }
+
+ if (stallLevel === 0) {
+ diagEvent("recording-stall-detected", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ void emitRecordingTelemetry("recording_stall_detected", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ try {
+ await chrome.tabs.sendMessage(snap.recordingTab, {
+ type: "recorder-wake-aggressive",
+ });
+ } catch {}
+ await chrome.storage.local.set({ recordingStallLevel: 1 });
+ return;
+ }
+
+ if (stallLevel === 1) {
+ diagEvent("recording-stall-escalated", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ void emitRecordingTelemetry("recording_stall_escalated", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ // Force-focus causes a brief tab flash but reliably unfreezes hard-throttled tabs.
+ try {
+ await chrome.tabs.update(snap.recordingTab, { active: true });
+ } catch {}
+ await chrome.storage.local.set({ recordingStallLevel: 2 });
+ return;
+ }
+
+ if (stallLevel === 2) {
+ diagEvent("recording-stall-unrecoverable", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ void emitRecordingTelemetry("recording_stall_unrecoverable", {
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ void emitRecordingTelemetry("recording_outcome", {
+ outcome: "unrecoverable",
+ ageMs: age,
+ tabId: snap.recordingTab,
+ });
+ try {
+ await chrome.alarms.clear(RECORDER_KEEPALIVE_ALARM);
+ } catch {}
+ try {
+ await chrome.storage.local.set({
+ recording: false,
+ pendingRecording: false,
+ recordingStallLevel: 0,
+ firstChunkAt: null,
+ lastChunkAt: null,
+ });
+ } catch {}
+ chrome.runtime
+ .sendMessage({
+ type: "recording-error",
+ error: "stream-error",
+ why: "Recording stopped: the recorder tab became unresponsive.",
+ errorCode: "recording-stall-unrecoverable",
+ })
+ .catch(() => {});
+ return;
+ }
+ return;
+ }
+
if (alarm.name === "recording-alarm") {
const { recording } = await chrome.storage.local.get(["recording"]);
diff --git a/src/pages/Background/listeners/onActionButtonClickedListener.js b/src/pages/Background/listeners/onActionButtonClickedListener.js
index b4340c4..d5b5746 100644
--- a/src/pages/Background/listeners/onActionButtonClickedListener.js
+++ b/src/pages/Background/listeners/onActionButtonClickedListener.js
@@ -6,16 +6,33 @@ import {
} from "../tabManagement";
import { sendMessageRecord } from "../recording/sendMessageRecord.js";
import { loginWithWebsite } from "../auth/loginWithWebsite.js";
+import { tryResumePendingUploads } from "../recording/resumePendingUploads";
const CLOUD_FEATURES_ENABLED =
process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true";
// Utility to handle tab messaging logic
const handleTabMessaging = async (tab) => {
- const { activeTab, recordingUiTabId } = await chrome.storage.local.get([
- "activeTab",
- "recordingUiTabId",
- ]);
+ const { activeTab, recordingUiTabId, offscreen } =
+ await chrome.storage.local.get([
+ "activeTab",
+ "recordingUiTabId",
+ "offscreen",
+ ]);
+
+ if (offscreen) {
+ try {
+ await sendMessageRecord({ type: "stop-recording-tab" });
+ return;
+ } catch (err) {
+ console.error(
+ "[Screenity][ActionClick] offscreen stop-recording send failed:",
+ err,
+ );
+ return;
+ }
+ }
+
const preferredTabId = recordingUiTabId || activeTab;
try {
@@ -153,6 +170,7 @@ const isOffscreenAlive = async () => {
// Main action button listener
export const onActionButtonClickedListener = () => {
chrome.action.onClicked.addListener(async (tab) => {
+ tryResumePendingUploads({ trigger: "actionClick" }).catch(() => {});
try {
const snap = await chrome.storage.local.get([
"recording", "pendingRecording", "restarting", "recorderSession",
diff --git a/src/pages/Background/listeners/onInstalledListener.js b/src/pages/Background/listeners/onInstalledListener.js
index 8f49f36..4ef6c00 100644
--- a/src/pages/Background/listeners/onInstalledListener.js
+++ b/src/pages/Background/listeners/onInstalledListener.js
@@ -1,6 +1,7 @@
import { removeTab } from "../tabManagement";
import { executeScripts } from "../utils/executeScripts";
import { supportContextQuery } from "../../utils/buildSupportContext";
+import { tryResumePendingUploads } from "../recording/resumePendingUploads";
const cloudFeaturesEnabled =
process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true";
@@ -75,6 +76,7 @@ export const onInstalledListener = () => {
if (details.reason === "install") {
chrome.storage.local.set({ systemAudio: true });
}
+ chrome.storage.local.set({ offscreenRecording: false });
const { backupTab } = await chrome.storage.local.get(["backupTab"]);
if (backupTab) {
@@ -82,5 +84,11 @@ export const onInstalledListener = () => {
}
executeScripts();
+
+ setTimeout(() => {
+ tryResumePendingUploads({ trigger: `onInstalled:${details.reason}` }).catch(
+ () => {},
+ );
+ }, 5000);
});
};
diff --git a/src/pages/Background/listeners/onStartupListener.js b/src/pages/Background/listeners/onStartupListener.js
index 82b0f3a..984d215 100644
--- a/src/pages/Background/listeners/onStartupListener.js
+++ b/src/pages/Background/listeners/onStartupListener.js
@@ -1,8 +1,13 @@
+import { tryResumePendingUploads } from "../recording/resumePendingUploads";
+
// For some reason without this the service worker doesn't always work
export const onStartupListener = async () => {
chrome.runtime.onStartup.addListener(() => {
if (globalThis.SCREENITY_VERBOSE_LOGS) {
console.log("Service worker started up successfully.");
}
+ setTimeout(() => {
+ tryResumePendingUploads({ trigger: "onStartup" }).catch(() => {});
+ }, 5000);
});
};
diff --git a/src/pages/Background/messaging/handlers.js b/src/pages/Background/messaging/handlers.js
index b4de815..2e60d36 100644
--- a/src/pages/Background/messaging/handlers.js
+++ b/src/pages/Background/messaging/handlers.js
@@ -19,7 +19,9 @@ import { addAlarmListener } from "../alarms/addAlarmListener";
import { cancelRecording, handleDismiss } from "../recording/cancelRecording";
import { handleDismissRecordingTab } from "../recording/discardRecording";
import { sendMessageRecord } from "../recording/sendMessageRecord";
-import { offscreenDocument } from "../offscreen/offscreenDocument";
+import { startRecorderSession } from "../recording/openRecorderTab";
+import { acquireStreamForOffscreen } from "../offscreen/acquireStream";
+import { registerProxyStorageHandlers } from "../offscreen/proxyStorageHandlers";
import { forceProcessing } from "../recording/forceProcessing";
import {
restartActiveTab,
@@ -49,7 +51,7 @@ import {
CLOUD_LOCAL_PLAYBACK_EVENT_KEY,
CLOUD_LOCAL_PLAYBACK_ALARM,
} from "../recording/cloudLocalPlaybackConstants";
-import { FIRST_CHUNK_WATCHDOG_ALARM } from "../alarms/handleAlarm";
+import { FIRST_CHUNK_WATCHDOG_ALARM, RECORDER_KEEPALIVE_ALARM } from "../alarms/alarmConstants";
import { desktopCapture } from "../recording/desktopCapture";
import {
writeFile,
@@ -709,29 +711,83 @@ export const copyToClipboard = (text) => {
// Initialize message router and register all handlers
export const setupHandlers = () => {
- registerMessage("desktop-capture", async (message) => {
+ registerProxyStorageHandlers();
+ registerMessage("desktop-capture", async (message, sender) => {
const now = Date.now();
- // Some pages (notably playground) can trigger duplicate start messages.
- // Gate starts briefly so Chrome doesn't show capture permission twice.
if (desktopCaptureInFlight || now - lastDesktopCaptureAt < 1200) {
return { ok: true, deduped: true };
}
desktopCaptureInFlight = true;
lastDesktopCaptureAt = now;
+
try {
- await desktopCapture(message);
+ await desktopCapture({
+ ...message,
+ ...(sender?.tab?.id != null ? { initiatingTabId: sender.tab.id } : {}),
+ });
return { ok: true };
} finally {
- // Keep the lock briefly to absorb closely-following duplicate dispatches.
setTimeout(() => {
desktopCaptureInFlight = false;
}, 1000);
}
});
registerMessage("backup-created", (message) =>
- offscreenDocument(message.request, message.tabId),
+ startRecorderSession(message.request, message.tabId),
);
+ registerMessage("start-recorder-keepalive-alarm", async () => {
+ try {
+ await chrome.alarms.create(RECORDER_KEEPALIVE_ALARM, {
+ periodInMinutes: 0.5, // fires every 30s
+ });
+ return { ok: true };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+ registerMessage("stop-recorder-keepalive-alarm", async () => {
+ try {
+ await chrome.alarms.clear(RECORDER_KEEPALIVE_ALARM);
+ return { ok: true };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+ registerMessage("offscreen-diag", async (message) => {
+ console.warn("[Screenity][OffscreenDiag]", message.source, message.payload);
+ return { ok: true };
+ });
+ registerMessage("offscreen-ready", async () => {
+ const { pendingOffscreenLoad } = await chrome.storage.local.get([
+ "pendingOffscreenLoad",
+ ]);
+ if (!pendingOffscreenLoad) return { ok: true, delivered: false };
+ await chrome.storage.local.set({ pendingOffscreenLoad: null });
+ chrome.runtime.sendMessage(pendingOffscreenLoad).catch(() => {});
+ return { ok: true, delivered: true };
+ });
+ registerMessage("offscreen-request-stream", async (message, sender) => {
+ try {
+ // Fall back to recordingUiTabId so the picker anchors to the user's tab, not the offscreen doc.
+ let initiatingTabId = message.initiatingTabId || null;
+ if (!initiatingTabId) {
+ const { recordingUiTabId } = await chrome.storage.local.get([
+ "recordingUiTabId",
+ ]);
+ initiatingTabId = recordingUiTabId || null;
+ }
+ const result = await acquireStreamForOffscreen({
+ mode: message.mode,
+ sources: message.sources,
+ initiatingTabId,
+ targetTabId: message.targetTabId,
+ });
+ return { ok: true, ...result };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
registerMessage("write-file", (message) => writeFile(message));
registerMessage("handle-restart", (message, sender) =>
handleRestart(message, sender),
@@ -1011,6 +1067,13 @@ export const setupHandlers = () => {
registerMessage("diag-editor-ready", (message) =>
diagEvent("editor-load-ready", { path: message?.path || null }),
);
+ // Only accept "sandbox-" / "sw-" prefixed events so a compromised context can't spoof lifecycle events.
+ registerMessage("diag-forward", (message) => {
+ const ev = typeof message?.event === "string" ? message.event : null;
+ if (!ev) return;
+ if (!ev.startsWith("sandbox-") && !ev.startsWith("sw-")) return;
+ diagEvent(ev, message?.data ?? null);
+ });
registerMessage("open-editor-recovery", async () => {
const { editorRecoveryUrl } = await chrome.storage.local.get(["editorRecoveryUrl"]);
if (!editorRecoveryUrl) return;
diff --git a/src/pages/Background/offscreen/acquireStream.js b/src/pages/Background/offscreen/acquireStream.js
new file mode 100644
index 0000000..09c2c56
--- /dev/null
+++ b/src/pages/Background/offscreen/acquireStream.js
@@ -0,0 +1,97 @@
+// SW-side stream acquisition for the offscreen recorder. Offscreen docs
+// can't call getDisplayMedia / tabCapture; SW acquires a streamId and hands
+// it over. Picker anchors to initiatingTabId so it appears on the user's tab.
+
+const DEFAULT_SCREEN_SOURCES = ["screen", "window", "tab", "audio"];
+
+const getInitiatingTab = async (tabId) => {
+ if (!tabId) return null;
+ try {
+ return await chrome.tabs.get(tabId);
+ } catch {
+ return null;
+ }
+};
+
+const acquireScreenStream = ({ sources, anchorTab }) =>
+ new Promise((resolve, reject) => {
+ const requested =
+ Array.isArray(sources) && sources.length ? sources : DEFAULT_SCREEN_SOURCES;
+ try {
+ console.log("[Screenity][acquireStream] chooseDesktopMedia invoked", {
+ requested,
+ anchorTabId: anchorTab?.id,
+ });
+ chrome.desktopCapture.chooseDesktopMedia(
+ requested,
+ anchorTab || undefined,
+ (streamId, opts) => {
+ console.log("[Screenity][acquireStream] chooseDesktopMedia callback", {
+ streamIdPresent: !!streamId,
+ streamIdPrefix: streamId ? streamId.slice(0, 16) + "..." : null,
+ opts,
+ lastError: chrome.runtime.lastError?.message || null,
+ });
+ if (chrome.runtime.lastError) {
+ reject(new Error(chrome.runtime.lastError.message));
+ return;
+ }
+ if (!streamId) {
+ resolve({ streamId: "", source: "cancelled" });
+ return;
+ }
+ resolve({
+ streamId,
+ source: "desktop",
+ canRequestAudioTrack: !!opts?.canRequestAudioTrack,
+ });
+ }
+ );
+ } catch (err) {
+ reject(err);
+ }
+ });
+
+const acquireTabStream = ({ targetTabId }) =>
+ new Promise((resolve, reject) => {
+ if (!targetTabId) {
+ reject(new Error("tab capture requires targetTabId"));
+ return;
+ }
+ try {
+ chrome.tabCapture.getMediaStreamId(
+ { targetTabId },
+ (streamId) => {
+ if (chrome.runtime.lastError) {
+ reject(new Error(chrome.runtime.lastError.message));
+ return;
+ }
+ if (!streamId) {
+ resolve({ streamId: "", source: "cancelled" });
+ return;
+ }
+ resolve({ streamId, source: "tab" });
+ }
+ );
+ } catch (err) {
+ reject(err);
+ }
+ });
+
+export const acquireStreamForOffscreen = async ({
+ mode,
+ initiatingTabId,
+ targetTabId,
+ sources,
+}) => {
+ if (mode === "camera") {
+ return { streamId: null, source: "camera" };
+ }
+
+ if (mode === "tab") {
+ return acquireTabStream({ targetTabId: targetTabId || initiatingTabId });
+ }
+
+ const anchorTab = await getInitiatingTab(initiatingTabId);
+ return acquireScreenStream({ sources, anchorTab });
+};
diff --git a/src/pages/Background/offscreen/closeOffscreenDocumentWithFlush.js b/src/pages/Background/offscreen/closeOffscreenDocumentWithFlush.js
new file mode 100644
index 0000000..eec35f3
--- /dev/null
+++ b/src/pages/Background/offscreen/closeOffscreenDocumentWithFlush.js
@@ -0,0 +1,51 @@
+export const closeOffscreenDocumentWithFlush = async ({
+ reason = "unknown",
+ timeoutMs = 25000,
+ shouldFinalize = true,
+} = {}) => {
+ let offDocExists = false;
+ try {
+ const existingContexts = await chrome.runtime.getContexts({});
+ offDocExists = existingContexts.some(
+ (c) => c.contextType === "OFFSCREEN_DOCUMENT"
+ );
+ } catch (err) {
+ console.warn("closeOffscreenDocumentWithFlush getContexts:", err);
+ }
+
+ if (!offDocExists) return { ok: true, existed: false };
+
+ const ackPromise = new Promise((resolve) => {
+ const timer = setTimeout(() => {
+ chrome.runtime.onMessage.removeListener(listener);
+ resolve({ ok: false, timedOut: true });
+ }, timeoutMs);
+ const listener = (msg) => {
+ if (msg?.type === "offscreen-shutdown-complete") {
+ clearTimeout(timer);
+ chrome.runtime.onMessage.removeListener(listener);
+ resolve({ ok: true, timedOut: false });
+ }
+ };
+ chrome.runtime.onMessage.addListener(listener);
+ });
+
+ chrome.runtime
+ .sendMessage({
+ type: "offscreen-shutdown",
+ reason,
+ shouldFinalize,
+ timeoutMs: Math.max(5000, timeoutMs - 2000),
+ })
+ .catch(() => {});
+
+ const result = await ackPromise;
+
+ try {
+ await chrome.offscreen.closeDocument();
+ } catch (err) {
+ console.warn("closeOffscreenDocumentWithFlush closeDocument:", err);
+ }
+
+ return { ok: true, existed: true, ...result };
+};
diff --git a/src/pages/Background/offscreen/discardOffscreenDocuments.js b/src/pages/Background/offscreen/discardOffscreenDocuments.js
index 144ca27..e94a894 100644
--- a/src/pages/Background/offscreen/discardOffscreenDocuments.js
+++ b/src/pages/Background/offscreen/discardOffscreenDocuments.js
@@ -1,16 +1,26 @@
+import { closeOffscreenDocumentWithFlush } from "./closeOffscreenDocumentWithFlush";
+
/**
* Closes any active offscreen document if it exists.
- * Also clears the offscreen storage flag to prevent stale state.
+ * Runs the flush handshake so in-flight recording state has a chance to
+ * drain before teardown, then clears the offscreen storage flag.
*/
-export const discardOffscreenDocuments = async () => {
+export const discardOffscreenDocuments = async ({
+ reason = "discard",
+ flush = true,
+} = {}) => {
+ console.warn("[Screenity][discardOffscreenDocuments]", { reason, flush, stack: new Error().stack });
try {
- const existingContexts = await chrome.runtime.getContexts({});
- const offscreenDocument = existingContexts.find(
- (c) => c.contextType === "OFFSCREEN_DOCUMENT"
- );
-
- if (offscreenDocument) {
- await chrome.offscreen.closeDocument();
+ if (flush) {
+ await closeOffscreenDocumentWithFlush({ reason });
+ } else {
+ const existingContexts = await chrome.runtime.getContexts({});
+ const offscreenDocument = existingContexts.find(
+ (c) => c.contextType === "OFFSCREEN_DOCUMENT"
+ );
+ if (offscreenDocument) {
+ await chrome.offscreen.closeDocument();
+ }
}
} catch (error) {
console.error("Failed to discard offscreen documents:", error.message);
diff --git a/src/pages/Background/offscreen/proxyStorageHandlers.js b/src/pages/Background/offscreen/proxyStorageHandlers.js
new file mode 100644
index 0000000..891ae93
--- /dev/null
+++ b/src/pages/Background/offscreen/proxyStorageHandlers.js
@@ -0,0 +1,63 @@
+// chrome.storage / chrome.tabs proxy handlers for the offscreen recorder.
+
+import { registerMessage } from "../../../messaging/messageRouter";
+
+const getArea = (area) => {
+ const a = chrome.storage?.[area];
+ if (!a) throw new Error(`Unknown storage area: ${area}`);
+ return a;
+};
+
+export const registerProxyStorageHandlers = () => {
+ registerMessage("proxy-storage-get", async ({ area, keys }) => {
+ try {
+ const a = getArea(area);
+ const result = await a.get(keys === null ? undefined : keys);
+ return { ok: true, result: result || {} };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+
+ registerMessage("proxy-storage-set", async ({ area, items }) => {
+ try {
+ await getArea(area).set(items || {});
+ return { ok: true };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+
+ registerMessage("proxy-storage-remove", async ({ area, keys }) => {
+ try {
+ await getArea(area).remove(keys);
+ return { ok: true };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+
+ registerMessage("proxy-storage-clear", async ({ area }) => {
+ try {
+ await getArea(area).clear();
+ return { ok: true };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+
+ chrome.storage.onChanged.addListener((changes, area) => {
+ chrome.runtime
+ .sendMessage({ type: "proxy-storage-onchanged", changes, area })
+ .catch(() => {});
+ });
+
+ registerMessage("proxy-tabs-get", async ({ tabId }) => {
+ try {
+ const tab = await chrome.tabs.get(tabId);
+ return { ok: true, tab };
+ } catch (err) {
+ return { ok: false, error: err?.message || String(err) };
+ }
+ });
+};
diff --git a/src/pages/Background/recording/cancelRecording.js b/src/pages/Background/recording/cancelRecording.js
index 141f084..aaf9832 100644
--- a/src/pages/Background/recording/cancelRecording.js
+++ b/src/pages/Background/recording/cancelRecording.js
@@ -1,5 +1,6 @@
import { sendMessageTab, focusTab } from "../tabManagement";
import { discardOffscreenDocuments } from "../offscreen/discardOffscreenDocuments";
+import { resetWatchdogState } from "./resetWatchdogState";
export const handleDismiss = async () => {
try {
@@ -57,7 +58,10 @@ export const cancelRecording = async () => {
sendMessageTab(id, { type: "stop-pending" }).catch(() => {});
});
focusTab(activeTab);
- discardOffscreenDocuments();
+ try {
+ await discardOffscreenDocuments();
+ } catch {}
+ await resetWatchdogState();
chrome.runtime.sendMessage({ type: "turn-off-pip" });
chrome.storage.local.set({ pipForceClose: Date.now() });
chrome.storage.local.set({
diff --git a/src/pages/Background/recording/chunkHandler.js b/src/pages/Background/recording/chunkHandler.js
index fc1971a..7c05c26 100644
--- a/src/pages/Background/recording/chunkHandler.js
+++ b/src/pages/Background/recording/chunkHandler.js
@@ -1,6 +1,7 @@
import localforage from "localforage";
import { blobToBase64 } from "../utils/blobToBase64";
import { sendMessageTab } from "../tabManagement";
+import { diagEvent } from "../../utils/diagnosticLog";
localforage.config({
driver: localforage.INDEXEDDB,
@@ -141,6 +142,14 @@ export const handleChunks = async (chunks, override = false, target = null) => {
};
let currentIndex = 0;
+ // Sample first 3, last 3, every ~totalBatches/10 between - caps at ~10 diag events.
+ const totalBatches = Math.max(1, Math.ceil(chunks.length / batchSize));
+ const sampleStride = Math.max(1, Math.floor(totalBatches / 10));
+ const shouldEmitBatch = (batchIndex) => {
+ if (batchIndex < 3) return true;
+ if (batchIndex >= totalBatches - 3) return true;
+ return batchIndex % sampleStride === 0;
+ };
while (currentIndex < chunks.length) {
const end = Math.min(currentIndex + batchSize, chunks.length);
@@ -159,12 +168,21 @@ export const handleChunks = async (chunks, override = false, target = null) => {
const filtered = batch.filter(Boolean);
if (filtered.length > 0) {
+ const batchIndex = Math.floor(currentIndex / batchSize);
if (DEBUG_POSTSTOP)
console.debug("[Screenity][BG] sending filtered batch", {
filteredLen: filtered.length,
currentIndex,
});
const ok = await sendBatch(filtered);
+ if (shouldEmitBatch(batchIndex)) {
+ diagEvent("sw-sendchunks-batch", {
+ batchIndex,
+ totalBatches,
+ batchSize: filtered.length,
+ ok,
+ });
+ }
if (!ok) {
if (DEBUG_POSTSTOP)
console.warn("[Screenity][BG] failed to send batch, aborting");
diff --git a/src/pages/Background/recording/desktopCapture.js b/src/pages/Background/recording/desktopCapture.js
index 0eaf2c7..d8c5206 100644
--- a/src/pages/Background/recording/desktopCapture.js
+++ b/src/pages/Background/recording/desktopCapture.js
@@ -1,9 +1,10 @@
import { getCurrentTab } from "../tabManagement";
import { initBackup } from "../backup/initBackup";
-import { offscreenDocument } from "../offscreen/offscreenDocument";
+import { startRecorderSession } from "./openRecorderTab";
import { localDirectoryStore } from "./chunkHandler";
export const desktopCapture = async (request) => {
+ console.log("[Screenity][desktopCapture] entered", request);
const { backup } = await chrome.storage.local.get(["backup"]);
const { backupSetup } = await chrome.storage.local.get(["backupSetup"]);
@@ -20,7 +21,6 @@ export const desktopCapture = async (request) => {
const activeTab = await getCurrentTab();
initBackup(request, activeTab.id);
} else {
- // Proceed with offscreen document creation
- offscreenDocument(request);
+ startRecorderSession(request);
}
};
diff --git a/src/pages/Background/recording/discardRecording.js b/src/pages/Background/recording/discardRecording.js
index 431308a..cc1eacd 100644
--- a/src/pages/Background/recording/discardRecording.js
+++ b/src/pages/Background/recording/discardRecording.js
@@ -1,13 +1,17 @@
import { sendMessageRecord } from "./sendMessageRecord";
import { removeTab } from "../tabManagement/removeTab";
import { discardOffscreenDocuments } from "../offscreen/discardOffscreenDocuments";
+import { resetWatchdogState } from "./resetWatchdogState";
export const discardRecording = async () => {
sendMessageRecord({ type: "dismiss-recording" });
chrome.action.setIcon({ path: "assets/icon-34.png" });
- // Clear offscreen documents if they exist
- discardOffscreenDocuments();
+ // Await teardown before flipping recording:false - otherwise handleAlarm fires against a torn-down offscreen.
+ try {
+ await discardOffscreenDocuments();
+ } catch {}
+ await resetWatchdogState();
const { multiMode, multiSceneCount, recordingTab } =
await chrome.storage.local.get([
diff --git a/src/pages/Background/recording/emitRecordingTelemetry.js b/src/pages/Background/recording/emitRecordingTelemetry.js
new file mode 100644
index 0000000..59ed238
--- /dev/null
+++ b/src/pages/Background/recording/emitRecordingTelemetry.js
@@ -0,0 +1,109 @@
+// SW analog of emitUploadTelemetry; fire-and-forget to /log/upload-event.
+
+const API_BASE = process.env.SCREENITY_API_BASE_URL;
+const ENDPOINT = `${API_BASE}/log/upload-event`;
+
+let disabled = false;
+
+const getOsName = () => {
+ const p =
+ (typeof navigator !== "undefined" && navigator.platform) || "";
+ if (p.includes("Mac")) return "macOS";
+ if (p.includes("Win")) return "Windows";
+ if (p.includes("Linux")) return "Linux";
+ return "Other";
+};
+
+const getBrowserName = () => {
+ const ua =
+ (typeof navigator !== "undefined" && navigator.userAgent) || "";
+ if (ua.includes("Edg/")) return "Edge";
+ if (ua.includes("Chrome/")) return "Chrome";
+ if (ua.includes("Firefox/")) return "Firefox";
+ if (ua.includes("Safari/") && !ua.includes("Chrome/")) return "Safari";
+ return "Other";
+};
+
+const getBrowserMajor = () => {
+ const ua =
+ (typeof navigator !== "undefined" && navigator.userAgent) || "";
+ const m = ua.match(/Chrome\/([0-9]+)/);
+ return m ? parseInt(m[1], 10) : null;
+};
+
+export const emitRecordingTelemetry = async (eventType, extra = {}) => {
+ if (disabled) return;
+ if (!API_BASE) return;
+ try {
+ const snap = await chrome.storage.local.get([
+ "recordingSessionId",
+ "recorderSession",
+ "screenityToken",
+ ]);
+ const session = snap.recorderSession || null;
+ const recordingSessionId =
+ extra.recordingSessionId ||
+ session?.recordingSessionId ||
+ session?.id ||
+ snap.recordingSessionId ||
+ null;
+ if (!recordingSessionId) return;
+
+ const screenUploader = session?.tracks?.screen?.uploader || null;
+ const cameraUploader = session?.tracks?.camera?.uploader || null;
+ const mediaId =
+ extra.mediaId ||
+ screenUploader?.mediaId ||
+ cameraUploader?.mediaId ||
+ null;
+
+ const extVersion = chrome?.runtime?.getManifest?.()?.version || null;
+
+ const body = JSON.stringify({
+ recordingId: mediaId,
+ recordingSessionId,
+ projectId: extra.projectId || session?.projectId || null,
+ sceneId: extra.sceneId || session?.sceneId || null,
+ mediaId,
+ source: "extension",
+ extVersion,
+ env: {
+ os: getOsName(),
+ browser: getBrowserName(),
+ browserMajor: getBrowserMajor(),
+ appVersion: null,
+ },
+ event: {
+ type: eventType,
+ t: Date.now(),
+ ...extra,
+ recordingSessionId,
+ projectId: extra.projectId || session?.projectId || null,
+ sceneId: extra.sceneId || session?.sceneId || null,
+ mediaId,
+ },
+ });
+
+ const headers = {
+ "Content-Type": "application/json",
+ "x-screenity-source": "extension",
+ };
+ if (extVersion) headers["x-screenity-ext-version"] = String(extVersion);
+ if (snap.screenityToken) {
+ headers.Authorization = `Bearer ${snap.screenityToken}`;
+ }
+
+ const res = await fetch(ENDPOINT, {
+ method: "POST",
+ headers,
+ credentials: "include",
+ keepalive: true,
+ body,
+ });
+ if (res.status === 404 || res.status === 405) {
+ disabled = true;
+ }
+ } catch {
+ // best-effort
+ }
+};
diff --git a/src/pages/Background/offscreen/offscreenDocument.js b/src/pages/Background/recording/openRecorderTab.js
similarity index 54%
rename from src/pages/Background/offscreen/offscreenDocument.js
rename to src/pages/Background/recording/openRecorderTab.js
index b789a47..a08b308 100644
--- a/src/pages/Background/offscreen/offscreenDocument.js
+++ b/src/pages/Background/recording/openRecorderTab.js
@@ -1,7 +1,7 @@
import { getCurrentTab } from "../tabManagement";
import { removeTab } from "../tabManagement/removeTab";
-import { sendMessageRecord } from "../recording/sendMessageRecord.js";
-import { closeOffscreenDocument } from "./closeOffscreenDocument.js";
+import { sendMessageRecord } from "./sendMessageRecord.js";
+import { closeOffscreenDocument } from "../offscreen/closeOffscreenDocument.js";
import { loginWithWebsite } from "../auth/loginWithWebsite.js";
import { traceStep } from "../../utils/startFlowTrace.js";
@@ -36,7 +36,7 @@ const openRecorderTab = async (
}
// Close any leftover recorder tab from a previous recording so we don't
- // end up with two pinned tabs. Only close actual extension recorder pages —
+ // end up with two pinned tabs. Only close actual extension recorder pages -
// for region recordings, recordingTab can temporarily point to the user's
// active page, which we must NOT close.
const { recordingTab: prevRecTab } = await chrome.storage.local.get([
@@ -53,24 +53,30 @@ const openRecorderTab = async (
await removeTab(prevRecTab);
}
} catch {
- // Tab doesn't exist — just clear the reference
+ // Tab doesn't exist - just clear the reference
}
chrome.storage.local.set({ recordingTab: null });
}
const finalUrl = isRegion ? `${recorderUrl}?tab=true` : recorderUrl;
- chrome.tabs
- .create({
- url: finalUrl,
- pinned: true,
- index: 0,
- // FLAG: Check this is ok?
- active: switchTab,
- })
- .then((tab) => {
- // Prevent Chrome from discarding this tab during recording
- chrome.tabs.update(tab.id, { autoDiscardable: false }).catch((err) => {
+ const tab = await chrome.tabs.create({
+ url: finalUrl,
+ pinned: true,
+ index: 0,
+ // FLAG: Check this is ok?
+ active: switchTab,
+ });
+
+ // Apply autoDiscardable before the load listener so the tab can't be discarded pre-mount.
+ let autoDiscardableApplied = false;
+ for (let attempt = 0; attempt < 2; attempt += 1) {
+ try {
+ await chrome.tabs.update(tab.id, { autoDiscardable: false });
+ autoDiscardableApplied = true;
+ break;
+ } catch (err) {
+ if (attempt === 1) {
console.warn(
"[Screenity] autoDiscardable failed for recorder tab",
tab.id,
@@ -83,45 +89,50 @@ const openRecorderTab = async (
error: String(err),
},
});
- });
+ } else {
+ await new Promise((r) => setTimeout(r, 50));
+ }
+ }
+ }
- chrome.storage.local.set({
- recordingTab: tab.id,
- offscreen: false,
- region: false,
- wasRegion: true,
- clickEvents: [],
- recordingUiTabId: activeTab.id,
- ...(isRegion ? { tabRecordedID: activeTab.id } : {}),
- });
+ chrome.storage.local.set({
+ recordingTab: tab.id,
+ offscreen: false,
+ region: false,
+ wasRegion: true,
+ clickEvents: [],
+ recordingUiTabId: activeTab.id,
+ autoDiscardableApplied,
+ ...(isRegion ? { tabRecordedID: activeTab.id } : {}),
+ });
- chrome.tabs.onUpdated.addListener(function _(tabId, changeInfo) {
- if (tabId === tab.id && changeInfo.status === "complete") {
- chrome.tabs.onUpdated.removeListener(_);
- traceStep("recorderTabCreated");
- // Include tabPreferred in the message so CloudRecorder can use it
- // synchronously without racing against its own storage read.
- const isPlayground = activeTab.url.includes(
- chrome.runtime.getURL("playground.html")
- );
- sendMessageRecord({
- type: "loaded",
- request: request,
- backup: backup,
- tabPreferred: isPlayground,
- ...(isRegion
- ? {
- isTab: true,
- tabID: activeTab.id,
- }
- : {}),
- });
- }
+ chrome.tabs.onUpdated.addListener(function _(tabId, changeInfo) {
+ if (tabId === tab.id && changeInfo.status === "complete") {
+ chrome.tabs.onUpdated.removeListener(_);
+ traceStep("recorderTabCreated");
+ // Include tabPreferred in the message so CloudRecorder can use it
+ // synchronously without racing against its own storage read.
+ const isPlayground = activeTab.url.includes(
+ chrome.runtime.getURL("playground.html")
+ );
+ sendMessageRecord({
+ type: "loaded",
+ request: request,
+ backup: backup,
+ tabPreferred: isPlayground,
+ ...(isRegion
+ ? {
+ isTab: true,
+ tabID: activeTab.id,
+ }
+ : {}),
});
- });
+ }
+ });
};
-export const offscreenDocument = async (request, tabId = null) => {
+export const startRecorderSession = async (request, tabId = null) => {
+ console.log("[Screenity][startRecorderSession] entered", { request, tabId });
const { backup } = await chrome.storage.local.get(["backup"]);
let activeTab = await getCurrentTab();
@@ -147,14 +158,13 @@ export const offscreenDocument = async (request, tabId = null) => {
if (request.region) {
if (tabId !== null) chrome.tabs.update(tabId, { active: true });
- chrome.storage.local.set({
- recordingTab: activeTab.id,
- offscreen: false,
- region: true,
- recordingUiTabId: activeTab.id,
- });
-
if (request.customRegion) {
+ chrome.storage.local.set({
+ recordingTab: activeTab.id,
+ offscreen: false,
+ region: true,
+ recordingUiTabId: activeTab.id,
+ });
sendMessageRecord({
type: "loaded",
request: request,
@@ -162,50 +172,15 @@ export const offscreenDocument = async (request, tabId = null) => {
region: true,
});
} else {
- await openRecorderTab(activeTab, backup, true, false, request);
- }
- } else {
- if (!request.offscreenRecording || request.camera) {
- // Skip offscreen recording if conditions aren't met
- await openRecorderTab(activeTab, backup, false, request.camera, request);
- return;
- }
-
- try {
- if (tabId !== null) chrome.tabs.update(tabId, { active: true });
-
- const { qualityValue, fpsValue } = await chrome.storage.local.get([
- "qualityValue",
- "fpsValue",
- ]);
-
- await closeOffscreenDocument();
-
- await chrome.offscreen.createDocument({
- url: "recorderoffscreen.html",
- reasons: ["USER_MEDIA", "AUDIO_PLAYBACK", "DISPLAY_MEDIA"],
- justification: "Recording from getDisplayMedia API",
- });
-
chrome.storage.local.set({
- recordingTab: null,
- offscreen: true,
- region: false,
- wasRegion: false,
+ recordingTab: activeTab.id,
+ offscreen: false,
+ region: true,
recordingUiTabId: activeTab.id,
});
-
- sendMessageRecord({
- type: "loaded",
- request: request,
- isTab: false,
- quality: qualityValue,
- fps: fpsValue,
- backup: backup,
- });
- } catch (error) {
- console.error("Error creating offscreen document:", error);
- await openRecorderTab(activeTab, backup, false, request.camera, request);
+ await openRecorderTab(activeTab, backup, true, false, request);
}
+ } else {
+ await openRecorderTab(activeTab, backup, false, request.camera, request);
}
};
diff --git a/src/pages/Background/recording/recordingHelpers.js b/src/pages/Background/recording/recordingHelpers.js
index 4fd0c1f..7ede178 100644
--- a/src/pages/Background/recording/recordingHelpers.js
+++ b/src/pages/Background/recording/recordingHelpers.js
@@ -11,6 +11,7 @@ import { getStreamingData } from "./getStreamingData";
import { discardOffscreenDocuments } from "../offscreen/discardOffscreenDocuments";
import { diagEvent, endDiagSession } from "../../utils/diagnosticLog";
import { classifyError } from "../../utils/errorCodes";
+import { resetWatchdogState } from "./resetWatchdogState";
export const checkCapturePermissions = async ({ isLoggedIn, isSubscribed }) => {
const permissions = ["desktopCapture", "alarms", "offscreen"];
@@ -19,13 +20,15 @@ export const checkCapturePermissions = async ({ isLoggedIn, isSubscribed }) => {
permissions.push("clipboardWrite");
}
- // Check if required APIs are available in this browser context
- if (
- chrome.desktopCapture &&
- chrome.alarms &&
- chrome.offscreen &&
- (!permissions.includes("clipboardWrite") || chrome.clipboard)
- ) {
+ // API objects are exposed before optional_permission is granted - ask the permissions API directly.
+ const alreadyGranted = await new Promise((resolve) => {
+ chrome.permissions.contains({ permissions }, resolve);
+ });
+
+ console.log("[Screenity][PermCheck] requested:", permissions, "alreadyGranted:", alreadyGranted);
+
+ if (alreadyGranted) {
+ addAlarmListener();
return { status: "ok" };
}
@@ -33,6 +36,8 @@ export const checkCapturePermissions = async ({ isLoggedIn, isSubscribed }) => {
chrome.permissions.request({ permissions }, resolve);
});
+ console.log("[Screenity][PermCheck] request returned granted:", granted, "lastError:", chrome.runtime.lastError?.message);
+
if (granted) {
addAlarmListener();
return { status: "ok" };
@@ -83,9 +88,7 @@ export const handleRecordingComplete = async () => {
};
export const handleRecordingError = async (request) => {
- if (globalThis.SCREENITY_VERBOSE_LOGS) {
- console.log("handleRecordingError called with request:", request);
- }
+ console.warn("[Screenity][handleRecordingError]", request);
// Propagate or derive error code
const errorCode =
@@ -184,7 +187,10 @@ export const handleRecordingError = async (request) => {
}
}
chrome.storage.local.set({ recordingTab: null });
- discardOffscreenDocuments();
+ try {
+ await discardOffscreenDocuments();
+ } catch {}
+ await resetWatchdogState();
};
export const handleGetStreamingData = async () => {
@@ -193,7 +199,14 @@ export const handleGetStreamingData = async () => {
};
export const videoReady = async () => {
- const { backupTab } = await chrome.storage.local.get(["backupTab"]);
+ const { backupTab, recordingDuration } = await chrome.storage.local.get([
+ "backupTab",
+ "recordingDuration",
+ ]);
+ diagEvent("sw-received-video-ready", {
+ recordingDurationMs: Number(recordingDuration) || 0,
+ backupTabPresent: Boolean(backupTab),
+ });
if (backupTab) {
sendMessageTab(backupTab, { type: "close-writable" });
}
diff --git a/src/pages/Background/recording/resetWatchdogState.js b/src/pages/Background/recording/resetWatchdogState.js
new file mode 100644
index 0000000..1f50147
--- /dev/null
+++ b/src/pages/Background/recording/resetWatchdogState.js
@@ -0,0 +1,20 @@
+import {
+ FIRST_CHUNK_WATCHDOG_ALARM,
+ RECORDER_KEEPALIVE_ALARM,
+} from "../alarms/alarmConstants";
+
+export const resetWatchdogState = async () => {
+ try {
+ await chrome.alarms.clear(RECORDER_KEEPALIVE_ALARM);
+ } catch {}
+ try {
+ await chrome.alarms.clear(FIRST_CHUNK_WATCHDOG_ALARM);
+ } catch {}
+ try {
+ await chrome.storage.local.set({
+ firstChunkAt: null,
+ lastChunkAt: null,
+ recordingStallLevel: 0,
+ });
+ } catch {}
+};
diff --git a/src/pages/Background/recording/restartRecording.js b/src/pages/Background/recording/restartRecording.js
index 70a66ab..bc649cc 100644
--- a/src/pages/Background/recording/restartRecording.js
+++ b/src/pages/Background/recording/restartRecording.js
@@ -1,6 +1,7 @@
import { sendMessageRecord } from "./sendMessageRecord";
import { resetActiveTabRestart } from "../tabManagement/resetActiveTab";
import { diagEvent } from "../../utils/diagnosticLog";
+import { resetWatchdogState } from "./resetWatchdogState";
const RESTART_ACK_TIMEOUT_MS = 7000;
@@ -27,6 +28,8 @@ const resolveSourceTabId = (message, sender) =>
export const handleRestart = async (message = {}, sender = null) => {
const sourceTabId = resolveSourceTabId(message, sender);
+ // Reset watchdog BEFORE the round-trip so a mid-flight alarm can't fire tier-3 against stale keys.
+ await resetWatchdogState();
await chrome.storage.local.set({
restarting: true,
...(sourceTabId != null
diff --git a/src/pages/Background/recording/restoreCloudRecording.js b/src/pages/Background/recording/restoreCloudRecording.js
index a0c8299..6303f6d 100644
--- a/src/pages/Background/recording/restoreCloudRecording.js
+++ b/src/pages/Background/recording/restoreCloudRecording.js
@@ -1,5 +1,6 @@
import localforage from "localforage";
import { createTab, sendMessageTab } from "../tabManagement";
+import { resetWatchdogState } from "./resetWatchdogState";
const RECOVERABLE_CLOUD_STATUSES = new Set([
"recording",
@@ -48,6 +49,8 @@ export const restoreCloudRecording = async () => {
const { cloudRestore } = await checkCloudRestore();
if (!cloudRestore) return;
+ await resetWatchdogState();
+
const tab = await createTab("download.html", true, true);
if (!tab?.id) return;
diff --git a/src/pages/Background/recording/resumePendingUploads.js b/src/pages/Background/recording/resumePendingUploads.js
new file mode 100644
index 0000000..52a16fc
--- /dev/null
+++ b/src/pages/Background/recording/resumePendingUploads.js
@@ -0,0 +1,115 @@
+// Background retry queue for incomplete upload journals - resumed silently in an offscreen doc.
+
+const JOURNAL_KEY_PREFIX = "uploadJournal-";
+const MAX_RESUME_ATTEMPTS = 5;
+const RESUME_LOCK_TTL_MS = 10 * 60 * 1000; // 10 min - stale lock recovery.
+
+const getAllStorage = () =>
+ new Promise((resolve) => {
+ try {
+ chrome.storage.local.get(null, (all) => resolve(all || {}));
+ } catch {
+ resolve({});
+ }
+ });
+
+const pickResumeCandidates = (storage) => {
+ const pending = [];
+ const abandonedKeys = [];
+ for (const [key, value] of Object.entries(storage)) {
+ if (!key.startsWith(JOURNAL_KEY_PREFIX)) continue;
+ if (!value || typeof value !== "object") continue;
+ if (value.trackType === "audio") continue; // audio is diagnostic, never uploaded
+ if (value.status === "completed") continue;
+ if ((value.offset || 0) >= (value.totalBytes || 0)) continue;
+ if ((value.resumeAttempts || 0) >= MAX_RESUME_ATTEMPTS) {
+ abandonedKeys.push(key);
+ continue;
+ }
+ pending.push(value);
+ }
+ if (abandonedKeys.length) {
+ chrome.storage.local.remove(abandonedKeys).catch(() => {});
+ }
+ return pending;
+};
+
+export const tryResumePendingUploads = async ({
+ trigger = "unknown",
+} = {}) => {
+ try {
+ const snap = await chrome.storage.local.get([
+ "recording",
+ "pendingRecording",
+ "resumeInProgress",
+ "resumeLockAt",
+ ]);
+ if (snap.recording || snap.pendingRecording) {
+ return { skipped: "recording-active" };
+ }
+ if (snap.resumeInProgress) {
+ const lockAge = Date.now() - (snap.resumeLockAt || 0);
+ if (lockAge < RESUME_LOCK_TTL_MS) {
+ return { skipped: "resume-in-progress" };
+ }
+ console.warn("[ResumeUploads] stale lock detected, clearing");
+ }
+
+ const all = await getAllStorage();
+ const candidates = pickResumeCandidates(all);
+ if (!candidates.length) {
+ return { skipped: "no-pending-journals" };
+ }
+
+ console.log(
+ "[ResumeUploads] candidates found:",
+ candidates.length,
+ "trigger:",
+ trigger,
+ );
+
+ await chrome.storage.local.set({
+ resumeInProgress: true,
+ resumeLockAt: Date.now(),
+ });
+
+ try {
+ const contexts = await chrome.runtime.getContexts({
+ contextTypes: ["OFFSCREEN_DOCUMENT"],
+ });
+ if (!contexts || contexts.length === 0) {
+ await chrome.offscreen.createDocument({
+ url: "offscreenrecorder.html?resume=1",
+ reasons: ["BLOBS", "USER_MEDIA"],
+ justification: "Resuming incomplete TUS uploads",
+ });
+ await new Promise((r) => setTimeout(r, 300));
+ }
+
+ const response = await chrome.runtime
+ .sendMessage({
+ type: "resume-pending-uploads",
+ journals: candidates,
+ trigger,
+ })
+ .catch((err) => ({
+ ok: false,
+ error: err?.message || String(err),
+ }));
+
+ console.log("[ResumeUploads] offscreen response:", response);
+ return response || { ok: false };
+ } finally {
+ await chrome.storage.local.set({
+ resumeInProgress: false,
+ resumeLockAt: null,
+ });
+ }
+ } catch (err) {
+ console.error("[ResumeUploads] unexpected error:", err);
+ await chrome.storage.local
+ .set({ resumeInProgress: false, resumeLockAt: null })
+ .catch(() => {});
+ return { ok: false, error: err?.message || String(err) };
+ }
+};
diff --git a/src/pages/Background/recording/sendChunks.js b/src/pages/Background/recording/sendChunks.js
index 29ee090..9c0343c 100644
--- a/src/pages/Background/recording/sendChunks.js
+++ b/src/pages/Background/recording/sendChunks.js
@@ -3,6 +3,7 @@ import { handleChunks } from "./chunkHandler";
import { diagEvent } from "../../utils/diagnosticLog";
export const sendChunks = async (override = false, target = null) => {
+ const startedAt = Date.now();
try {
// Wait briefly for chunks to be flushed to IndexedDB
const maxAttempts = 50;
@@ -20,6 +21,11 @@ export const sendChunks = async (override = false, target = null) => {
if (chunkCount > 0) break;
await new Promise((r) => setTimeout(r, delayMs));
}
+ diagEvent("sw-sendchunks-start", {
+ initialCount: chunkCount,
+ override: Boolean(override),
+ targetTabId: target?.tabId ?? null,
+ });
if (chunkCount === 0) {
console.warn(
@@ -49,8 +55,16 @@ export const sendChunks = async (override = false, target = null) => {
// Await handleChunks to ensure messaging completes before returning
await handleChunks(chunks, override, target);
diagEvent("chunks-sent", { count: chunks.length });
+ diagEvent("sw-sendchunks-done", {
+ totalSent: chunks.length,
+ elapsedMs: Date.now() - startedAt,
+ });
return { status: "ok", chunkCount: chunks.length };
} catch (error) {
+ diagEvent("sw-sendchunks-error", {
+ error: String(error?.message || error).slice(0, 200),
+ elapsedMs: Date.now() - startedAt,
+ });
console.error("Failed to send chunks. Reloading extension.", error);
chrome.runtime.reload();
}
diff --git a/src/pages/CloudRecorder/CloudRecorder.jsx b/src/pages/CloudRecorder/CloudRecorder.jsx
index b41ab1b..777e179 100644
--- a/src/pages/CloudRecorder/CloudRecorder.jsx
+++ b/src/pages/CloudRecorder/CloudRecorder.jsx
@@ -10,6 +10,7 @@ import localforage from "localforage";
import { createVideoProject } from "./createVideoProject";
import { getUserMediaWithFallback } from "../utils/mediaDeviceFallback";
import { traceStep } from "../utils/startFlowTrace";
+import { IS_OFFSCREEN_HOST } from "../utils/recordingHost";
localforage.config({
driver: localforage.INDEXEDDB,
@@ -29,6 +30,8 @@ const STORAGE_CRITICAL_HEADROOM_BYTES = 120 * 1024 * 1024;
const AUDIO_MAX_BUFFER_BYTES = 150 * 1024 * 1024;
const LOCAL_SCREEN_PLAYBACK_TTL_MS = 20 * 60 * 1000;
const LOCAL_SCREEN_PLAYBACK_MAX_BYTES = 250 * 1024 * 1024;
+// Bytes kept past lastServerOffset before purging - covers in-flight PATCHes, HEAD resyncs, 409 retries.
+const CHUNK_PURGE_SAFETY_WINDOW_BYTES = 32 * 1024 * 1024;
const MAX_UPLOAD_TELEMETRY_EVENTS = 300;
const UPLOAD_TELEMETRY_KEY = "cloudUploadTelemetryEvents";
const UPLOAD_TELEMETRY_ENDPOINT = `${API_BASE}/log/upload-event`;
@@ -153,6 +156,12 @@ const CloudRecorder = () => {
const audioChunkIndexRef = useRef(0);
const cameraChunkStoreReadyRef = useRef(false);
const cameraChunkIndexRef = useRef(0);
+ const screenChunkByteRangesRef = useRef([]);
+ const cameraChunkByteRangesRef = useRef([]);
+ const chunksPurgedDuringRecordingRef = useRef(false);
+ const screenChunksPurgedCountRef = useRef(0);
+ const cameraChunksPurgedCountRef = useRef(0);
+ const chunksPurgedBytesRef = useRef(0);
const sessionStateIndexedRef = useRef(false);
const sessionHeartbeat = useRef(null);
const chunkStallTimer = useRef(null);
@@ -234,6 +243,8 @@ const CloudRecorder = () => {
const keepAliveInterval = useRef(null);
const keepAliveAudioCtx = useRef(null);
const keepAliveOscillator = useRef(null);
+ const keepAliveLockAbort = useRef(null);
+ const keepAliveMediaSessionActive = useRef(false);
const logDebugEvent = async () => {
// debug bundle feature removed; noop
@@ -343,6 +354,12 @@ const CloudRecorder = () => {
const ensureRecordingSessionId = () => {
if (!recordingSessionId.current) {
recordingSessionId.current = crypto.randomUUID();
+ // Persist so telemetry correlation survives document death.
+ try {
+ chrome.storage.local.set({
+ recordingSessionId: recordingSessionId.current,
+ });
+ } catch {}
}
return recordingSessionId.current;
};
@@ -451,7 +468,7 @@ const CloudRecorder = () => {
screenUploader.current?.getMeta?.()?.mediaId ||
cameraUploader.current?.getMeta?.()?.mediaId ||
null;
- if (!mediaId) {
+ if (!mediaId && eventPayload.event !== "recording_outcome") {
return null;
}
@@ -585,6 +602,34 @@ const CloudRecorder = () => {
}
};
+ const emitRecordingOutcome = (outcome, extra = {}) => {
+ const session = recorderSession.current;
+ const startedAt = session?.startedAt || null;
+ const durationMs = startedAt ? Date.now() - startedAt : null;
+ const screenState = sessionTrackState.current?.screen || {};
+ const cameraState = sessionTrackState.current?.camera || {};
+ const chunksPersisted =
+ (screenState.durableChunkCount || 0) +
+ (cameraState.durableChunkCount || 0);
+ const screenServerBytes =
+ Number(screenUploader.current?.lastServerOffset) ||
+ Number(screenUploader.current?.offset) ||
+ 0;
+ const cameraServerBytes =
+ Number(cameraUploader.current?.lastServerOffset) ||
+ Number(cameraUploader.current?.offset) ||
+ 0;
+ const serverBytesConfirmed = screenServerBytes + cameraServerBytes;
+ void emitUploadTelemetry("recording_outcome", {
+ outcome,
+ durationMs,
+ chunksPersisted,
+ serverBytesConfirmed,
+ uploaderType: "cloud_recorder",
+ ...extra,
+ });
+ };
+
const resetUnloadGuard = () => {
unloadGuardRef.current = {
pagehideSeen: false,
@@ -876,39 +921,66 @@ const CloudRecorder = () => {
* which would stop our recording. Playing silent audio keeps the tab active.
*/
const startTabKeepAlive = () => {
- try {
- if (keepAliveAudioCtx.current) return; // Already running
+ if (IS_OFFSCREEN_HOST) return;
- const ctx = new (window.AudioContext || window.webkitAudioContext)();
- keepAliveAudioCtx.current = ctx;
-
- // Create a silent oscillator (inaudible frequency at zero gain)
- const oscillator = ctx.createOscillator();
- const gainNode = ctx.createGain();
-
- oscillator.frequency.value = 0; // DC signal (no audible tone)
- gainNode.gain.value = 0; // Completely silent
-
- oscillator.connect(gainNode);
- gainNode.connect(ctx.destination);
- oscillator.start();
-
- keepAliveOscillator.current = oscillator;
+ // Multi-layered keepalive - Chrome's background-tab throttling stacks signals.
+ try {
+ if (!keepAliveAudioCtx.current) {
+ const ctx = new (window.AudioContext || window.webkitAudioContext)();
+ keepAliveAudioCtx.current = ctx;
+ const oscillator = ctx.createOscillator();
+ const gainNode = ctx.createGain();
+ oscillator.type = "sine";
+ oscillator.frequency.value = 20000;
+ gainNode.gain.value = 0.0001;
+ oscillator.connect(gainNode);
+ gainNode.connect(ctx.destination);
+ oscillator.start();
+ keepAliveOscillator.current = oscillator;
+ }
+ } catch (err) {
+ console.warn("[CloudRecorder] keepalive: audio layer failed:", err);
+ }
- // Also request that Chrome not discard this tab
- chrome.runtime.sendMessage({
- type: "set-tab-auto-discardable",
- discardable: false,
- });
+ try {
+ if (typeof navigator.locks !== "undefined" && !keepAliveLockAbort.current) {
+ const ac = new AbortController();
+ keepAliveLockAbort.current = ac;
+ navigator.locks
+ .request(
+ "screenity-recorder-keepalive",
+ { mode: "exclusive", signal: ac.signal },
+ () => new Promise(() => {}),
+ )
+ .catch(() => {});
+ }
+ } catch (err) {
+ console.warn("[CloudRecorder] keepalive: lock layer failed:", err);
+ }
- if (globalThis.SCREENITY_VERBOSE_LOGS) {
- if (DEBUG_START_FLOW) {
- console.log("[CloudRecorder] Tab keep-alive started");
- }
+ try {
+ if (navigator.mediaSession && !keepAliveMediaSessionActive.current) {
+ navigator.mediaSession.metadata = new window.MediaMetadata({
+ title: "Screenity recording",
+ artist: "Screenity",
+ });
+ navigator.mediaSession.playbackState = "playing";
+ try {
+ navigator.mediaSession.setActionHandler("pause", () => {});
+ } catch {}
+ keepAliveMediaSessionActive.current = true;
}
} catch (err) {
- console.warn("[CloudRecorder] Failed to start tab keep-alive:", err);
+ console.warn("[CloudRecorder] keepalive: mediaSession layer failed:", err);
}
+
+ chrome.runtime.sendMessage({
+ type: "set-tab-auto-discardable",
+ discardable: false,
+ });
+ chrome.runtime
+ .sendMessage({ type: "start-recorder-keepalive-alarm" })
+ .catch(() => {});
};
/**
@@ -917,20 +989,33 @@ const CloudRecorder = () => {
const stopTabKeepAlive = () => {
try {
if (keepAliveOscillator.current) {
- keepAliveOscillator.current.stop();
- keepAliveOscillator.current.disconnect();
+ try { keepAliveOscillator.current.stop(); } catch {}
+ try { keepAliveOscillator.current.disconnect(); } catch {}
keepAliveOscillator.current = null;
}
if (keepAliveAudioCtx.current) {
- keepAliveAudioCtx.current.close();
+ try { keepAliveAudioCtx.current.close(); } catch {}
keepAliveAudioCtx.current = null;
}
+ if (keepAliveLockAbort.current) {
+ try { keepAliveLockAbort.current.abort(); } catch {}
+ keepAliveLockAbort.current = null;
+ }
+ if (keepAliveMediaSessionActive.current && navigator.mediaSession) {
+ try { navigator.mediaSession.playbackState = "none"; } catch {}
+ try { navigator.mediaSession.metadata = null; } catch {}
+ try { navigator.mediaSession.setActionHandler("pause", null); } catch {}
+ keepAliveMediaSessionActive.current = false;
+ }
// Allow Chrome to discard this tab again if needed
chrome.runtime.sendMessage({
type: "set-tab-auto-discardable",
discardable: true,
});
+ chrome.runtime
+ .sendMessage({ type: "stop-recorder-keepalive-alarm" })
+ .catch(() => {});
// Cancel first-chunk watchdog
chrome.runtime
@@ -1137,6 +1222,51 @@ const CloudRecorder = () => {
}
};
+ // Purge IDB chunks Bunny has confirmed. Keeps chunk_0 (webm init segment).
+ const purgeConfirmedChunks = async (
+ store,
+ rangesRef,
+ uploader,
+ keyPrefix,
+ trackLabel,
+ ) => {
+ if (!uploader || !rangesRef.current.length) return;
+ const lastServerOffset = Number(uploader.lastServerOffset) || 0;
+ if (lastServerOffset <= CHUNK_PURGE_SAFETY_WINDOW_BYTES) return;
+ const cutoff = lastServerOffset - CHUNK_PURGE_SAFETY_WINDOW_BYTES;
+ const ranges = rangesRef.current;
+ let purgedCount = 0;
+ let purgedBytes = 0;
+ while (ranges.length > 0 && ranges[0].endByte <= cutoff) {
+ const entry = ranges[0];
+ if (entry.index === 0) {
+ ranges.shift();
+ continue;
+ }
+ try {
+ await store.removeItem(`${keyPrefix}${entry.index}`);
+ } catch (err) {
+ console.warn(
+ `[CloudRecorder] purge ${trackLabel} chunk_${entry.index} failed`,
+ err,
+ );
+ break;
+ }
+ ranges.shift();
+ purgedCount++;
+ purgedBytes += entry.size || 0;
+ }
+ if (purgedCount > 0) {
+ chunksPurgedDuringRecordingRef.current = true;
+ chunksPurgedBytesRef.current += purgedBytes;
+ if (trackLabel === "screen") {
+ screenChunksPurgedCountRef.current += purgedCount;
+ } else if (trackLabel === "camera") {
+ cameraChunksPurgedCountRef.current += purgedCount;
+ }
+ }
+ };
+
const clearLocalScreenPlaybackOffer = async (reason = "unknown") => {
const existingOffer = localScreenPlaybackOfferRef.current;
localScreenPlaybackOfferRef.current = null;
@@ -1175,6 +1305,19 @@ const CloudRecorder = () => {
return null;
}
+ if (chunksPurgedDuringRecordingRef.current) {
+ console.info(
+ "[CloudRecorder] Local-first screen offer skipped: chunks were purged mid-recording",
+ {
+ projectId,
+ sceneId,
+ purgedScreenChunks: screenChunksPurgedCountRef.current,
+ purgedBytes: chunksPurgedBytesRef.current,
+ },
+ );
+ return null;
+ }
+
let chunkCount = 0;
try {
chunkCount = await chunksStore.length();
@@ -2396,6 +2539,15 @@ const CloudRecorder = () => {
index.current = 0;
lastTimecode.current = 0;
+ try {
+ await chrome.storage.local.set({
+ firstChunkAt: null,
+ lastChunkAt: null,
+ recordingStallLevel: 0,
+ tabStreamIdCache: null,
+ });
+ } catch {}
+
if (IS_IFRAME_CONTEXT && !target.current) {
sendRecordingError("No crop target for restart.");
return false;
@@ -2731,6 +2883,12 @@ const CloudRecorder = () => {
lastTimecode.current = 0;
hasChunks.current = false;
index.current = 0;
+ screenChunkByteRangesRef.current = [];
+ cameraChunkByteRangesRef.current = [];
+ chunksPurgedDuringRecordingRef.current = false;
+ screenChunksPurgedCountRef.current = 0;
+ cameraChunksPurgedCountRef.current = 0;
+ chunksPurgedBytesRef.current = 0;
firstChunkLoggedRef.current = false;
resetUnloadGuard();
recoveryExportedRef.current = false;
@@ -2833,6 +2991,9 @@ const CloudRecorder = () => {
firstChunkLoggedRef.current = true;
logStartFlow("first_chunk", { type: "screen" });
assertCountdownBeforeFirstChunk(timestamp);
+ chrome.storage.local
+ .set({ firstChunkAt: Date.now() })
+ .catch(() => {});
}
} else if (timestamp < lastTimecode.current) {
return; // Skip duplicate
@@ -2840,6 +3001,10 @@ const CloudRecorder = () => {
lastTimecode.current = timestamp;
}
+ chrome.storage.local
+ .set({ lastChunkAt: Date.now() })
+ .catch(() => {});
+
await chunksStore
.setItem(`chunk_${index.current}`, {
index: index.current,
@@ -2873,6 +3038,20 @@ const CloudRecorder = () => {
}
await screenUploader.current.write(blob);
consecutiveScreenFailures.current = 0; // Reset on success
+ const endByte =
+ Number(screenUploader.current?.totalBytes) || 0;
+ screenChunkByteRangesRef.current.push({
+ index: index.current,
+ endByte,
+ size: blob?.size || 0,
+ });
+ void purgeConfirmedChunks(
+ chunksStore,
+ screenChunkByteRangesRef,
+ screenUploader.current,
+ "chunk_",
+ "screen",
+ );
} catch (uploadErr) {
console.error("Failed to upload chunk to Bunny:", uploadErr);
consecutiveScreenFailures.current++;
@@ -3050,6 +3229,7 @@ const CloudRecorder = () => {
assertCountdownBeforeFirstChunk(Date.now());
}
+ let cameraPersistedIndex = null;
if (cameraChunkStoreReadyRef.current) {
const cameraChunkIndex = cameraChunkIndexRef.current;
cameraChunkIndexRef.current += 1;
@@ -3062,6 +3242,7 @@ const CloudRecorder = () => {
timestamp: Date.now(),
},
);
+ cameraPersistedIndex = cameraChunkIndex;
patchTrackState("camera", {
durableChunkCount: cameraChunkIndex + 1,
lastPersistedChunkIndex: cameraChunkIndex,
@@ -3083,6 +3264,22 @@ const CloudRecorder = () => {
if (cameraUploader.current?.isPaused) return;
await cameraUploader.current.write(blob);
consecutiveCameraFailures.current = 0; // Reset on success
+ if (cameraPersistedIndex !== null) {
+ const endByte =
+ Number(cameraUploader.current?.totalBytes) || 0;
+ cameraChunkByteRangesRef.current.push({
+ index: cameraPersistedIndex,
+ endByte,
+ size: blob?.size || 0,
+ });
+ void purgeConfirmedChunks(
+ cameraChunksStore,
+ cameraChunkByteRangesRef,
+ cameraUploader.current,
+ "camera_chunk_",
+ "camera",
+ );
+ }
} catch (uploadErr) {
console.error(
"Failed to upload camera chunk to Bunny:",
@@ -3404,6 +3601,8 @@ const CloudRecorder = () => {
}
};
+ if (IS_OFFSCREEN_HOST) return undefined;
+
window.addEventListener("pagehide", onHide);
return () => window.removeEventListener("pagehide", onHide);
}, []);
@@ -3415,6 +3614,25 @@ const CloudRecorder = () => {
visibilityState: "hidden",
visibilityChangedAt: Date.now(),
});
+ } else if (document.visibilityState === "visible") {
+ // Force stall-recovery on uploaders - in-tab heartbeat may have been throttled while hidden.
+ try {
+ const now = Date.now();
+ const staleThreshold = 10_000;
+ [screenUploader.current, cameraUploader.current].forEach((up) => {
+ if (!up) return;
+ const idle = now - (up.lastProgressAt || 0);
+ if (idle > staleThreshold && up.queuedBytes > 0) {
+ up.attemptStallRecovery?.(idle).catch(() => {});
+ }
+ });
+ } catch (err) {
+ console.warn("[CloudRecorder] visibility-triggered recovery failed:", err);
+ }
+ persistSessionState({
+ visibilityState: "visible",
+ visibilityChangedAt: Date.now(),
+ });
}
};
@@ -3431,6 +3649,8 @@ const CloudRecorder = () => {
}
};
+ if (IS_OFFSCREEN_HOST) return undefined;
+
document.addEventListener("visibilitychange", onVisibilityChange);
window.addEventListener("beforeunload", onBeforeUnload);
@@ -3897,7 +4117,8 @@ const CloudRecorder = () => {
type: "prepare-editor-existing",
multiMode: multiMode,
});
- } else if (!multiMode && !recordingToScene) {
+ } else if (!multiMode && !recordingToScene && projectId) {
+ // Opening /editor/null on cancelled-before-create yields a broken page.
chrome.runtime.sendMessage({
type: "prepare-open-editor",
projectId,
@@ -3946,6 +4167,9 @@ const CloudRecorder = () => {
reason: reason || "stop-without-finalize",
uploaderType: "cloud_recorder",
});
+ emitRecordingOutcome("abandoned", {
+ reason: reason || "stop-without-finalize",
+ });
try {
await chrome.storage.local.set({ sceneIdStatus: "cancelled" });
} catch {
@@ -4046,6 +4270,9 @@ const CloudRecorder = () => {
reason: "uploader-finalize-incomplete",
uploaderType: "cloud_recorder",
});
+ emitRecordingOutcome("unrecoverable", {
+ reason: "uploader-finalize-incomplete",
+ });
await exportLocalRecovery("finalize-error");
await chunksStore.clear().catch((e) =>
console.warn("[CloudRecorder] chunksStore.clear failed (finalize-error):", e),
@@ -4120,6 +4347,7 @@ const CloudRecorder = () => {
await chunksStore.clear().catch((e) =>
console.warn("[CloudRecorder] chunksStore.clear failed (no-upload):", e),
);
+ emitRecordingOutcome("abandoned", { reason: "no-upload" });
await finalizeRecorderSession("failed");
await clearAudioChunkStore("no-upload");
await clearCameraChunkStore("no-upload");
@@ -4151,6 +4379,15 @@ const CloudRecorder = () => {
sceneId: uploadMeta.sceneId,
});
+ if (chunksPurgedDuringRecordingRef.current) {
+ void emitUploadTelemetry("upload_local_chunks_purged", {
+ screenChunksPurged: screenChunksPurgedCountRef.current,
+ cameraChunksPurged: cameraChunksPurgedCountRef.current,
+ bytesFreed: chunksPurgedBytesRef.current,
+ safetyWindowBytes: CHUNK_PURGE_SAFETY_WINDOW_BYTES,
+ });
+ }
+
localScreenPlaybackOfferRef.current = await registerLocalScreenPlaybackOffer(
{
projectId,
@@ -4208,6 +4445,11 @@ const CloudRecorder = () => {
projectId,
sceneId: uploadMeta.sceneId,
});
+ emitRecordingOutcome("completed", {
+ projectId,
+ sceneId: uploadMeta.sceneId,
+ mediaId: uploadMeta.screen?.mediaId || uploadMeta.camera?.mediaId || null,
+ });
await finalizeRecorderSession("completed");
void emitUploadTelemetry("upload_complete_client", {
projectId,
@@ -4248,6 +4490,13 @@ const CloudRecorder = () => {
projectId,
sceneId: uploadMeta.sceneId,
});
+ emitRecordingOutcome("unrecoverable", {
+ reason: "scene-create-failed",
+ message: err?.message || String(err),
+ projectId,
+ sceneId: uploadMeta.sceneId,
+ mediaId: uploadMeta.screen?.mediaId || uploadMeta.camera?.mediaId || null,
+ });
sendRecordingError(userMessage);
chrome.storage.local.set({
@@ -4396,7 +4645,11 @@ const CloudRecorder = () => {
);
};
- const startStream = async (data, id, permissions, permissions2) => {
+ const startStream = async (data, id, permissions, permissions2, streamOpts = {}) => {
+ const canCaptureSourceAudio =
+ streamOpts.canRequestAudioTrack !== false;
+ const useDisplayMedia = !!streamOpts.useDisplayMedia;
+ const prewarmedStream = streamOpts.prewarmedStream || null;
// Defaulting quality for now
//const { qualityValue } = await chrome.storage.local.get(["qualityValue"]);
const { width = 1920, height = 1080 } = getResolutionForQuality() || {};
@@ -4529,19 +4782,33 @@ const CloudRecorder = () => {
return;
}
} else {
- const tabWidth = isTab.current ? window.innerWidth : width;
- const tabHeight = isTab.current ? window.innerHeight : height;
+ // Offscreen has no viewport - window.innerWidth/Height are 0, so fall back to quality dimensions.
+ const safeInnerWidth =
+ typeof window !== "undefined" && window.innerWidth
+ ? window.innerWidth
+ : width;
+ const safeInnerHeight =
+ typeof window !== "undefined" && window.innerHeight
+ ? window.innerHeight
+ : height;
+ const tabWidth = isTab.current ? safeInnerWidth : width;
+ const tabHeight = isTab.current ? safeInnerHeight : height;
const videoConstraints = isTab.current
- ? {
- // Tab recording - minimal constraints, let Chrome determine optimal capture
- chromeMediaSource: "tab",
- chromeMediaSourceId: id,
- maxFrameRate: fps,
- // No width/height constraints for tabs - Chrome will capture at the tab's natural size
- maxWidth: tabWidth,
- maxHeight: tabHeight,
- }
+ ? IS_OFFSCREEN_HOST
+ ? {
+ // Offscreen can't measure the tab - let Chrome pick sizing or it throws OverconstrainedError.
+ chromeMediaSource: "tab",
+ chromeMediaSourceId: id,
+ maxFrameRate: fps,
+ }
+ : {
+ chromeMediaSource: "tab",
+ chromeMediaSourceId: id,
+ maxFrameRate: fps,
+ maxWidth: tabWidth,
+ maxHeight: tabHeight,
+ }
: {
// Desktop/window recording - use quality settings as max bounds
chromeMediaSource: "desktop",
@@ -4552,21 +4819,85 @@ const CloudRecorder = () => {
};
const desktopConstraints = {
- audio: {
- mandatory: {
- chromeMediaSource: isTab.current ? "tab" : "desktop",
- chromeMediaSourceId: id,
- },
- },
+ audio: canCaptureSourceAudio
+ ? {
+ mandatory: {
+ chromeMediaSource: isTab.current ? "tab" : "desktop",
+ chromeMediaSourceId: id,
+ },
+ }
+ : false,
video: {
mandatory: { ...videoConstraints },
},
};
try {
- screenStream.current = await navigator.mediaDevices.getUserMedia(
- desktopConstraints,
- );
+ if (prewarmedStream) {
+ console.log(
+ "[CloudRecorder] using prewarmed tab MediaStream",
+ {
+ videoTracks: prewarmedStream.getVideoTracks().length,
+ audioTracks: prewarmedStream.getAudioTracks().length,
+ },
+ );
+ screenStream.current = prewarmedStream;
+ if (typeof window !== "undefined") {
+ window.__screenityPrewarmedTabStream = null;
+ }
+ } else if (useDisplayMedia) {
+ // Aliases to avoid TDZ with the later `const {width, height}` destructuring.
+ const targetFps = fps;
+ const targetWidth = width;
+ const targetHeight = height;
+ const isTabModeRequest =
+ data.recordingType === "region" || isTab.current;
+ const displayConstraints = {
+ audio: data.systemAudio ? true : false,
+ video: {
+ frameRate: { ideal: targetFps, max: targetFps },
+ width: { ideal: targetWidth, max: targetWidth },
+ height: { ideal: targetHeight, max: targetHeight },
+ ...(isTabModeRequest ? { displaySurface: "browser" } : {}),
+ },
+ };
+ console.log(
+ "[CloudRecorder] offscreen getDisplayMedia constraints",
+ displayConstraints,
+ );
+ chrome.runtime
+ .sendMessage({
+ type: "offscreen-diag",
+ source: "getDisplayMedia-attempt",
+ payload: displayConstraints,
+ })
+ .catch(() => {});
+ screenStream.current = await navigator.mediaDevices.getDisplayMedia(
+ displayConstraints,
+ );
+ console.log("[CloudRecorder] offscreen getDisplayMedia OK");
+ } else {
+ console.log("[CloudRecorder] desktop getUserMedia constraints", {
+ audioEnabled: !!desktopConstraints.audio,
+ videoMandatory: desktopConstraints.video?.mandatory,
+ streamIdPrefix: String(id || "").slice(0, 16),
+ });
+ chrome.runtime
+ .sendMessage({
+ type: "offscreen-diag",
+ source: "desktop-gUM-attempt",
+ payload: {
+ audioEnabled: !!desktopConstraints.audio,
+ streamIdPrefix: String(id || "").slice(0, 16),
+ isTab: !!isTab.current,
+ },
+ })
+ .catch(() => {});
+ screenStream.current = await navigator.mediaDevices.getUserMedia(
+ desktopConstraints,
+ );
+ console.log("[CloudRecorder] desktop getUserMedia OK");
+ }
if (!screenStream.current?.getVideoTracks?.().length) {
sendRecordingError(
"Failed to access screen stream: no video track.",
@@ -4575,8 +4906,8 @@ const CloudRecorder = () => {
}
const track = screenStream.current.getVideoTracks()[0];
const {
- width,
- height,
+ width: _actualStreamWidth,
+ height: _actualStreamHeight,
displaySurface: surface,
} = track.getSettings(); // Always use displaySurface from track
@@ -4610,7 +4941,10 @@ const CloudRecorder = () => {
displays,
recordedMonitorId: monitorId,
monitorBounds,
- recordedStreamDimensions: { width, height },
+ recordedStreamDimensions: {
+ width: _actualStreamWidth,
+ height: _actualStreamHeight,
+ },
});
},
);
@@ -4630,12 +4964,64 @@ const CloudRecorder = () => {
bindScreenTrack(screenStream.current.getVideoTracks()[0]);
} catch (err) {
- if (isUserCaptureCancel(err)) {
+ console.error("[CloudRecorder] desktop getUserMedia threw", {
+ name: err?.name,
+ message: err?.message,
+ stack: err?.stack,
+ });
+ chrome.runtime.sendMessage({
+ type: "offscreen-diag",
+ source: "desktop-gUM-error",
+ payload: {
+ name: err?.name || null,
+ message: err?.message || null,
+ stack: err?.stack || null,
+ },
+ }).catch(() => {});
+ // Offscreen tab-mode fallback: pre-acquired streamId failed - retry with getDisplayMedia.
+ if (
+ IS_OFFSCREEN_HOST &&
+ isTab.current &&
+ id &&
+ !useDisplayMedia &&
+ (err?.name === "AbortError" || err?.name === "NotAllowedError")
+ ) {
+ console.warn(
+ "[CloudRecorder] tab streamId consumption failed - falling back to getDisplayMedia",
+ );
+ try {
+ const displayConstraints = {
+ audio: data.systemAudio ? true : false,
+ video: {
+ frameRate: { ideal: fps, max: fps },
+ width: { ideal: width, max: width },
+ height: { ideal: height, max: height },
+ displaySurface: "browser",
+ },
+ };
+ screenStream.current =
+ await navigator.mediaDevices.getDisplayMedia(displayConstraints);
+ console.log(
+ "[CloudRecorder] getDisplayMedia fallback OK after streamId rejection",
+ );
+ bindScreenTrack(screenStream.current.getVideoTracks()[0]);
+ } catch (fallbackErr) {
+ if (isUserCaptureCancel(fallbackErr)) {
+ sendRecordingError("User cancelled stream selection", true);
+ return;
+ }
+ sendRecordingError(
+ "Failed to access screen stream: " + fallbackErr.message,
+ );
+ return;
+ }
+ } else if (isUserCaptureCancel(err)) {
sendRecordingError("User cancelled stream selection", true);
return;
+ } else {
+ sendRecordingError("Failed to access screen stream: " + err.message);
+ return;
}
- sendRecordingError("Failed to access screen stream: " + err.message);
- return;
}
if (shouldUseCamera) {
@@ -4834,23 +5220,33 @@ const CloudRecorder = () => {
if (data.recordingType === "camera") {
startStream(data, null, permissions, permissions2);
+ } else if (IS_OFFSCREEN_HOST && isTab.current && tabID.current) {
+ // Pre-acquired tab streamId from action-icon click - frictionless path; picker fallback in catch.
+ console.log("[CloudRecorder][offscreen] using pre-acquired tab streamId");
+ startStream(data, tabID.current, permissions, permissions2);
+ } else if (IS_OFFSCREEN_HOST) {
+ startStream(data, null, permissions, permissions2, {
+ useDisplayMedia: true,
+ });
} else if (!isTab.current && (data.recordingType != "region" || tabPreferred.current)) {
// Show the desktop picker when:
// - not tab-capture mode AND not region recording, OR
// - tabPreferred=true (playground) forced isTab=false even for a region
// recording — in that case we still need the picker because there is
// no pre-obtained stream ID to pass to startStream.
- chrome.desktopCapture.chooseDesktopMedia(
- ["screen", "window", "tab", "audio"],
- null,
- (streamId) => {
- if (!streamId) {
- sendRecordingError("User cancelled stream selection", true);
- } else {
- startStream(data, streamId, permissions, permissions2);
- }
- },
- );
+ {
+ chrome.desktopCapture.chooseDesktopMedia(
+ ["screen", "window", "tab", "audio"],
+ null,
+ (streamId) => {
+ if (!streamId) {
+ sendRecordingError("User cancelled stream selection", true);
+ } else {
+ startStream(data, streamId, permissions, permissions2);
+ }
+ },
+ );
+ }
} else {
startStream(data, tabID.current, permissions, permissions2);
}
@@ -4861,9 +5257,25 @@ const CloudRecorder = () => {
const getStreamID = async (id) => {
try {
- const streamId = await chrome.tabCapture.getMediaStreamId({
- targetTabId: id,
- });
+ let streamId;
+ if (IS_OFFSCREEN_HOST) {
+ // chrome.tabCapture is not callable from offscreen - delegate to SW.
+ const response = await chrome.runtime
+ .sendMessage({
+ type: "offscreen-request-stream",
+ mode: "tab",
+ targetTabId: id,
+ })
+ .catch((err) => ({ ok: false, error: String(err) }));
+ if (!response?.ok || !response.streamId) {
+ throw new Error(response?.error || "offscreen tab stream failed");
+ }
+ streamId = response.streamId;
+ } else {
+ streamId = await chrome.tabCapture.getMediaStreamId({
+ targetTabId: id,
+ });
+ }
tabID.current = streamId;
} catch (err) {
sendRecordingError("Failed to get stream ID: " + err.message);
@@ -4925,12 +5337,12 @@ const CloudRecorder = () => {
setInitProject(false);
backupRef.current = request.backup;
if (IS_IFRAME_CONTEXT) {
- // Only trigger if it's actually a region recording
- if (request.region) {
+ // Skip payloads targeted at offscreen - otherwise both contexts race to acquire the stream.
+ if (request.region && request._targetHost !== "offscreen") {
isInit.current = true;
chrome.runtime.sendMessage({ type: "get-streaming-data" });
}
- } else if (!request.region) {
+ } else if (!request.region || (IS_OFFSCREEN_HOST && request.isTab)) {
// If the background included tabPreferred in the message, apply it
// synchronously before we use it — this eliminates a race where
// chrome.storage.local.get(["tabPreferred"]) hasn't completed yet when
@@ -4946,7 +5358,11 @@ const CloudRecorder = () => {
if (!tabPreferred.current) {
isTab.current = request.isTab;
recordingTabId.current = request.tabID || null;
- if (request.isTab) getStreamID(request.tabID);
+ if (IS_OFFSCREEN_HOST && request.isTab && request.tabStreamId) {
+ tabID.current = request.tabStreamId;
+ } else if (request.isTab && !IS_OFFSCREEN_HOST) {
+ getStreamID(request.tabID);
+ }
} else {
isTab.current = false;
}
@@ -4959,7 +5375,7 @@ const CloudRecorder = () => {
if (regionRef.current) {
startStreaming(JSON.parse(request.data));
}
- } else if (!regionRef.current) {
+ } else if (!regionRef.current || (IS_OFFSCREEN_HOST && isTab.current)) {
startStreaming(JSON.parse(request.data));
}
} else if (request.type === "start-recording-tab") {
@@ -4982,7 +5398,7 @@ const CloudRecorder = () => {
pendingStartAttempts.current = 0;
maybeStartRecording("start-message");
}
- } else if (!regionRef.current) {
+ } else if (!regionRef.current || (IS_OFFSCREEN_HOST && isTab.current)) {
pendingStartRef.current = true;
pendingStartAttempts.current = 0;
maybeStartRecording("start-message");
@@ -5012,6 +5428,36 @@ const CloudRecorder = () => {
stopRecording(true, request.reason || "message-stop");
sendResponse?.({ ok: true });
return true;
+ } else if (request.type === "offscreen-shutdown") {
+ const timeoutMs = Number(request.timeoutMs) || 20000;
+ (async () => {
+ try {
+ if (isInit.current) {
+ await stopRecording(
+ request.shouldFinalize !== false,
+ request.reason || "offscreen-shutdown"
+ );
+ }
+ const drainPromise = Promise.all([
+ screenUploader.current?.waitForPendingUploads?.() ??
+ Promise.resolve(),
+ cameraUploader.current?.waitForPendingUploads?.() ??
+ Promise.resolve(),
+ ]);
+ await Promise.race([
+ drainPromise,
+ new Promise((resolve) => setTimeout(resolve, timeoutMs)),
+ ]);
+ } catch (err) {
+ console.warn("[CloudRecorder] offscreen-shutdown error", err);
+ } finally {
+ chrome.runtime
+ .sendMessage({ type: "offscreen-shutdown-complete" })
+ .catch(() => {});
+ }
+ })();
+ sendResponse?.({ ok: true, accepted: true });
+ return true;
} else if (request.type === "set-mic-active-tab") {
if (!isInit.current) return;
setMic(request);
diff --git a/src/pages/CloudRecorder/bunnyTusUploader.js b/src/pages/CloudRecorder/bunnyTusUploader.js
index a9e8764..b6344ad 100644
--- a/src/pages/CloudRecorder/bunnyTusUploader.js
+++ b/src/pages/CloudRecorder/bunnyTusUploader.js
@@ -911,9 +911,14 @@ export default class BunnyTusUploader {
for (let attempt = 0; attempt <= this.MAX_RETRIES; attempt++) {
try {
+ // AuthorizationSignature has ~20min TTL; refresh before every PATCH.
+ await this.checkAuthExpiration();
+
const currentOffset = this.offset;
const controller = new AbortController();
+ // Exposed so the heartbeat can abort a stalled PATCH.
+ this.currentPatchAbort = controller;
const timeout = setTimeout(
() => controller.abort("upload-timeout"),
this.UPLOAD_TIMEOUT_MS,
@@ -934,6 +939,7 @@ export default class BunnyTusUploader {
signal: controller.signal,
});
clearTimeout(timeout);
+ this.currentPatchAbort = null;
if (res.ok || res.status === 204) {
// Server is the source of truth
@@ -1008,27 +1014,45 @@ export default class BunnyTusUploader {
throw new Error(`Upload failed (${res.status}): ${errorText}`);
}
} catch (err) {
+ this.currentPatchAbort = null;
+ // Transient errors (network, timeout, stall-abort, 5xx, 408, 429) retry forever with capped backoff.
+ const isExplicitAbort =
+ this.status === "aborted" || this.isPaused === true;
+ if (isExplicitAbort) {
+ throw err;
+ }
+ const msg = String(err?.message || "");
+ const isTransient =
+ err?.name === "AbortError" || // timeout / stall-recovery
+ err?.name === "TypeError" || // fetch network failure
+ /Upload failed \((?:5\d\d|408|429)\b/.test(msg) ||
+ /network|Failed to fetch|timeout/i.test(msg);
if (err?.name === "AbortError") {
- console.warn("⚠️ Upload chunk timed out");
+ console.warn("⚠️ Upload chunk aborted (timeout or stall-recovery)");
}
- if (attempt === this.MAX_RETRIES) {
+ if (!isTransient && attempt === this.MAX_RETRIES) {
console.error(
- `❌ Failed to upload chunk after ${this.MAX_RETRIES} retries:`,
+ `❌ Non-transient failure after ${this.MAX_RETRIES} retries:`,
err,
);
this.setUploaderError("chunk-upload-retries-exhausted", err);
throw err;
}
- console.warn(
- `⚠️ Upload attempt ${attempt + 1}/${
- this.MAX_RETRIES + 1
- } failed, retrying...`,
- err.message,
- );
+ const attemptLabel = isTransient
+ ? `transient retry #${attempt + 1}`
+ : `attempt ${attempt + 1}/${this.MAX_RETRIES + 1}`;
+ console.warn(`⚠️ Upload ${attemptLabel} failed, retrying...`, err.message);
const jitter = Math.random() * 300;
- await new Promise((r) =>
- setTimeout(r, this.RETRY_DELAY * Math.pow(2, attempt) + jitter),
+ // Cap backoff at 60s so offline→online reconnects retry within a minute.
+ const baseDelay = Math.min(
+ this.RETRY_DELAY * Math.pow(2, Math.min(attempt, 7)),
+ 60_000,
);
+ await new Promise((r) => setTimeout(r, baseDelay + jitter));
+ // Never trip the permanent-failure branch for transient errors.
+ if (isTransient && attempt >= this.MAX_RETRIES) {
+ attempt = this.MAX_RETRIES - 1;
+ }
}
}
}
@@ -1305,6 +1329,7 @@ export default class BunnyTusUploader {
this.stopHeartbeat();
this.lastProgressAt = Date.now();
this.stalled = false;
+ this.stallRecoveryInFlight = false;
this.heartbeatTimer = setInterval(() => {
const now = Date.now();
const diff = now - this.lastProgressAt;
@@ -1322,10 +1347,57 @@ export default class BunnyTusUploader {
diff,
});
}
+ this.attemptStallRecovery(diff).catch((err) => {
+ console.warn("[bunnyTusUploader] stall recovery failed:", err);
+ });
}
}, this.HEARTBEAT_INTERVAL_MS);
}
+ async attemptStallRecovery(stallMs) {
+ if (this.stallRecoveryInFlight) return;
+ this.stallRecoveryInFlight = true;
+ try {
+ if (this.currentPatchAbort) {
+ try {
+ this.currentPatchAbort.abort("stall-recovery");
+ } catch {}
+ this.currentPatchAbort = null;
+ }
+ // Resync offset from server via HEAD so a partially-applied PATCH doesn't cause duplicate bytes.
+ try {
+ const res = await fetch(this.uploadUrl, {
+ method: "HEAD",
+ headers: {
+ "Tus-Resumable": "1.0.0",
+ AuthorizationSignature: this.signature,
+ AuthorizationExpire: String(this.expires),
+ LibraryId: String(this.libraryId),
+ VideoId: this.videoId,
+ },
+ });
+ if (res.ok || res.status === 204) {
+ const serverOffsetHeader = res.headers.get("Upload-Offset");
+ if (serverOffsetHeader != null) {
+ const serverOffset = parseInt(serverOffsetHeader, 10);
+ if (Number.isFinite(serverOffset)) {
+ this.offset = serverOffset;
+ this.lastServerOffset = serverOffset;
+ this.emitTelemetry("upload_stall_recovered", {
+ stallMs,
+ serverOffset,
+ });
+ }
+ }
+ }
+ } catch (err) {
+ console.warn("[bunnyTusUploader] HEAD offset resync failed:", err);
+ }
+ } finally {
+ this.stallRecoveryInFlight = false;
+ }
+ }
+
stopHeartbeat() {
if (this.heartbeatTimer) clearInterval(this.heartbeatTimer);
this.heartbeatTimer = null;
diff --git a/src/pages/Content/Wrapper.jsx b/src/pages/Content/Wrapper.jsx
index 4e735a2..09e1906 100644
--- a/src/pages/Content/Wrapper.jsx
+++ b/src/pages/Content/Wrapper.jsx
@@ -200,6 +200,7 @@ const Wrapper = () => {
<div ref={parentRef}>
{contentState.showExtension && (
<iframe
+ className="screenity-iframe"
style={{
// all: "unset",
display: "none",
@@ -212,6 +213,7 @@ const Wrapper = () => {
)}
{contentState.hasOpenedBefore && (
<iframe
+ className="screenity-iframe"
style={{
// all: "unset",
display: "none",
diff --git a/src/pages/Content/camera-only/layout/CameraWrap.jsx b/src/pages/Content/camera-only/layout/CameraWrap.jsx
index 425743f..bed7fc9 100644
--- a/src/pages/Content/camera-only/layout/CameraWrap.jsx
+++ b/src/pages/Content/camera-only/layout/CameraWrap.jsx
@@ -21,7 +21,9 @@ const CameraWrap = (props) => {
bottom: 0,
margin: "auto",
}}
- className={contentState.cameraFlipped ? "camera-flipped" : ""}
+ className={`screenity-iframe${
+ contentState.cameraFlipped ? " camera-flipped" : ""
+ }`}
src={chrome.runtime.getURL("camera.html")}
allow="camera; microphone"
></iframe>
diff --git a/src/pages/Content/camera/layout/CameraWrap.jsx b/src/pages/Content/camera/layout/CameraWrap.jsx
index 0d78a54..829bc74 100644
--- a/src/pages/Content/camera/layout/CameraWrap.jsx
+++ b/src/pages/Content/camera/layout/CameraWrap.jsx
@@ -200,7 +200,9 @@ const CameraWrap = (props) => {
border: "none",
pointerEvents: "none",
}}
- className={contentState.cameraFlipped ? "camera-flipped" : ""}
+ className={`screenity-iframe${
+ contentState.cameraFlipped ? " camera-flipped" : ""
+ }`}
src={chrome.runtime.getURL("camera.html")}
allow="camera; microphone"
></iframe>
diff --git a/src/pages/Content/context/ContentState.jsx b/src/pages/Content/context/ContentState.jsx
index e20fc91..42c45f9 100644
--- a/src/pages/Content/context/ContentState.jsx
+++ b/src/pages/Content/context/ContentState.jsx
@@ -103,15 +103,13 @@ const ContentState = (props) => {
}));
if (result.authenticated) {
- // Offscreen recording and client-side zoom are not available
+ // Client-side zoom is not available for authenticated users.
setContentState((prev) => ({
...prev,
- offscreenRecording: false,
zoomEnabled: false,
}));
chrome.storage.local.set({
- offscreenRecording: false,
zoomEnabled: false,
wasLoggedIn: false,
});
diff --git a/src/pages/Content/context/messaging/handlers.js b/src/pages/Content/context/messaging/handlers.js
index ed21df5..efe4c1f 100644
--- a/src/pages/Content/context/messaging/handlers.js
+++ b/src/pages/Content/context/messaging/handlers.js
@@ -991,17 +991,15 @@ export const setupHandlers = () => {
}));
if (result.authenticated) {
- // Offscreen recording and client-side zoom are not available
+ // Client-side zoom is not available for authenticated users.
setContentState((prev) => ({
...prev,
- offscreenRecording: false,
onboarding: false,
showProSplash: false,
zoomEnabled: false,
}));
chrome.storage.local.set({
- offscreenRecording: false,
zoomEnabled: false,
wasLoggedIn: false,
});
diff --git a/src/pages/Content/popup/layout/RecordingType.jsx b/src/pages/Content/popup/layout/RecordingType.jsx
index 4c08906..4c495eb 100644
--- a/src/pages/Content/popup/layout/RecordingType.jsx
+++ b/src/pages/Content/popup/layout/RecordingType.jsx
@@ -250,6 +250,7 @@ const RecordingType = (props) => {
(contentState.microphonePermission && contentState.pushToTalk)) && (
<div>
<iframe
+ className="screenity-iframe"
style={{
width: "100%",
height: "30px",
diff --git a/src/pages/Content/popup/layout/Settings.jsx b/src/pages/Content/popup/layout/Settings.jsx
index fed4ce5..ba13cc8 100644
--- a/src/pages/Content/popup/layout/Settings.jsx
+++ b/src/pages/Content/popup/layout/Settings.jsx
@@ -70,16 +70,6 @@ const Settings = () => {
name="askMicrophone"
value="askMicrophone"
/>
- {contentState.recordingType != "region" &&
- contentState.recordingType != "camera" &&
- !contentState.isSubscribed &&
- (chromeVersion === null || chromeVersion >= 109) && (
- <Switch
- label={chrome.i18n.getMessage("stayInPagePopup")}
- name="offscreenRecording"
- value="offscreenRecording"
- />
- )}
{contentState.recordingType != "camera" &&
!contentState.isSubscribed && (
<Switch
diff --git a/src/pages/Content/region/layout/CameraWrap.jsx b/src/pages/Content/region/layout/CameraWrap.jsx
index 74e2851..024a1c3 100644
--- a/src/pages/Content/region/layout/CameraWrap.jsx
+++ b/src/pages/Content/region/layout/CameraWrap.jsx
@@ -133,7 +133,9 @@ const CameraWrap = (props) => {
border: "none",
pointerEvents: "none",
}}
- className={contentState.cameraFlipped ? "camera-flipped" : ""}
+ className={`screenity-iframe${
+ contentState.cameraFlipped ? " camera-flipped" : ""
+ }`}
src={chrome.runtime.getURL("camera.html")}
allow="camera; microphone"
></iframe>
diff --git a/src/pages/Content/styles/app.css b/src/pages/Content/styles/app.css
index 08da88b..8f63d42 100644
--- a/src/pages/Content/styles/app.css
+++ b/src/pages/Content/styles/app.css
@@ -1,3 +1,4 @@
+@charset "UTF-8";
@font-face {
font-family: "Satoshi-Light";
src: url("chrome-extension://__MSG_@@extension_id__/assets/fonts/Satoshi-Light.ttf") format("truetype");
@@ -42,7 +43,7 @@ button {
all: unset;
}
-iframe {
+iframe.screenity-iframe {
width: 100%;
height: 100%;
position: fixed;
@@ -220,9 +221,7 @@ iframe {
display: inline-block;
position: relative;
padding: 4px;
- width: -moz-fit-content;
width: fit-content;
- height: -moz-fit-content;
height: fit-content;
}
@@ -231,7 +230,6 @@ iframe {
align-items: center;
padding-left: 10px;
transition: opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), transform 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- min-width: -moz-max-content;
min-width: max-content;
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
@@ -506,7 +504,6 @@ iframe {
.OnboardingArrow {
position: absolute;
z-index: 99999999999;
- width: -moz-max-content;
width: max-content;
display: flex;
flex-direction: column;
@@ -518,6 +515,10 @@ iframe {
pointer-events: none !important;
}
+body.driver-active .OnboardingArrow {
+ display: none !important;
+}
+
.OnboardingText {
font-size: 32px;
color: #9797a4;
@@ -698,10 +699,6 @@ iframe {
color: #6e7684 !important;
}
-body {
- background-color: white !important;
-}
-
.DrawingToolbar.show-toolbar {
opacity: 1 !important;
pointer-events: all !important;
@@ -717,7 +714,6 @@ body {
pointer-events: none;
align-items: center;
display: flex;
- min-width: -moz-max-content;
min-width: max-content;
padding-left: 10px;
padding-right: 10px;
@@ -839,9 +835,7 @@ body {
z-index: 99999999 !important;
color: #fff;
box-shadow: hsla(206, 22%, 7%, 0.35) 0px 10px 38px -10px, hsla(206, 22%, 7%, 0.2) 0px 10px 20px -15px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
transition: opacity 0.3 ease-in-out !important;
will-change: transform, opacity;
animation-duration: 400ms;
@@ -1447,7 +1441,6 @@ body {
padding: var(--viewport-padding);
gap: 14px;
max-width: 100vw;
- width: -moz-fit-content;
width: fit-content;
list-style: none;
z-index: 2147483647;
@@ -1805,7 +1798,6 @@ body {
align-items: center;
justify-content: center;
gap: 6px;
- width: -moz-fit-content;
width: fit-content;
}
.HelpSection .HelpIcon {
@@ -1898,7 +1890,6 @@ body {
flex-direction: column;
align-items: center;
justify-content: center;
- height: -moz-fit-content;
height: fit-content;
width: 70%;
padding: 20px 16px;
@@ -2252,9 +2243,7 @@ body {
position: relative;
padding-left: 22px;
padding-right: 22px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
outline: none;
}
.DropdownMenuItem:hover,
@@ -2481,9 +2470,7 @@ button {
padding-right: 16px;
color: #29292f;
position: relative;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
}
.SelectItem[data-disabled] {
@@ -2575,7 +2562,6 @@ input {
margin: auto;
flex-shrink: 0;
display: flex;
- width: -moz-fit-content;
width: fit-content;
align-items: center;
}
@@ -2583,9 +2569,7 @@ input {
.hiddenTabs {
display: none !important;
pointer-events: none !important;
- -webkit-user-select: none !important;
- -moz-user-select: none !important;
- user-select: none !important;
+ user-select: none !important;
opacity: 0 !important;
height: 0 !important;
overflow: hidden !important;
@@ -2596,9 +2580,7 @@ input {
padding-left: 14px;
padding-right: 14px;
color: #6e7684;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
cursor: pointer;
}
@@ -2921,9 +2903,7 @@ input {
font-size: 15px;
line-height: 1.3;
max-width: 80%;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
cursor: default;
gap: 16px;
top: 41px;
@@ -3195,7 +3175,6 @@ button {
align-items: center;
justify-content: right;
gap: 8px;
- min-width: -moz-max-content;
min-width: max-content;
opacity: 0;
}
@@ -3495,9 +3474,7 @@ button {
position: absolute;
right: 18px;
bottom: 12px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
}
.time-set-parent {
@@ -3536,9 +3513,7 @@ button {
position: absolute;
right: 18px;
bottom: 12px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
}
.TooltipContent {
@@ -3551,9 +3526,7 @@ button {
z-index: 99999999 !important;
color: #fff;
box-shadow: hsla(206, 22%, 7%, 0.35) 0px 10px 38px -10px, hsla(206, 22%, 7%, 0.2) 0px 10px 20px -15px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
transition: opacity 0.3 ease-in-out !important;
will-change: transform, opacity;
animation-duration: 400ms;
@@ -3693,7 +3666,6 @@ button {
padding-left: 4px;
padding-right: 4px;
transition: opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- min-width: -moz-max-content;
min-width: max-content;
background-color: rgba(30, 30, 30, 0.8);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
@@ -3958,7 +3930,6 @@ button {
text-transform: none;
color: #fff;
z-index: 99999999999;
- width: -moz-fit-content;
width: fit-content;
}
@@ -4194,6 +4165,10 @@ button {
pointer-events: none !important;
}
+.region-recording .resize-handle {
+ visibility: hidden !important;
+}
+
.WarningViewport {
--viewport-padding: 25px;
position: fixed;
@@ -4206,7 +4181,6 @@ button {
padding: var(--viewport-padding);
gap: 14px;
max-width: 100vw;
- width: -moz-fit-content;
width: fit-content;
list-style: none;
z-index: 2147483647;
@@ -4418,9 +4392,7 @@ button {
position: relative;
padding-left: 22px;
padding-right: 22px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
+ user-select: none;
outline: none;
}
@@ -4614,4 +4586,4 @@ button {
.driver-popover,
.driver-popover.ScreenityOnboardingPopover {
z-index: 2147483647 !important;
-}/*# sourceMappingURL=app.css.map */
\ No newline at end of file
+}
diff --git a/src/pages/Content/styles/dist/app.css b/src/pages/Content/styles/dist/app.css
deleted file mode 100644
index 9dec35a..0000000
--- a/src/pages/Content/styles/dist/app.css
+++ /dev/null
@@ -1,2998 +0,0 @@
-/* Colors */
-/* Font */
-/* Spacing */
-/*
-$spacing-01: 0.125rem;
-$spacing-02: 0.25rem;
-$spacing-03: 0.5rem;
-$spacing-04: 0.75rem;
-$spacing-05: 1rem;
-*/
-/* Container */
-/* Gradients */
-/* Events */
-/* Z-index */
-/* reset */
-a,
-button {
- all: unset;
-}
-
-iframe {
- width: 100%;
- height: 100%;
- position: fixed;
- overflow: scroll;
- z-index: -9999;
- top: 0px;
- left: 0px;
- border: 0px;
- pointer-events: all !important;
-}
-
-.container {
- pointer-events: none !important;
-}
-
-.ToolbarBounds {
- position: fixed;
- top: 0px;
- left: 0px;
- box-sizing: border-box;
- width: 100%;
- height: 100%;
- border: 10px solid #3080F8;
- pointer-events: none;
- transform: scale(1.2);
- opacity: 0;
- transition: transform 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s ease-in-out;
-}
-
-.ToolbarBounds.ToolbarShake {
- transform: scale(1);
- opacity: 0.4;
-}
-
-.react-draggable {
- pointer-events: all;
-}
-
-.ToolbarShake .react-draggable {
- width: 100%;
- height: 100%;
-}
-
-.ToolbarElastic {
- transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
-}
-
-.ToolbarShake .ToolbarRoot {
- animation: subtleshake 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- animation-iteration-count: infinite !important;
- background-color: white !important;
-}
-
-.ToolbarDragging .ToolbarRoot {
- transform: scale(1.02);
-}
-.ToolbarDragging .ToolbarRoot::after {
- filter: drop-shadow(0px 20px 50px rgba(0, 0, 0, 0.5));
-}
-
-@keyframes shake {
- 0% {
- transform: translate(1px, 1px) rotate(0deg);
- }
- 20% {
- transform: translate(-3px, 0px) rotate(1deg);
- }
- 30% {
- transform: translate(3px, 2px) rotate(0deg);
- }
- 40% {
- transform: translate(1px, -1px) rotate(1deg);
- }
- 50% {
- transform: translate(-1px, 2px) rotate(-1deg);
- }
- 60% {
- transform: translate(-3px, 1px) rotate(0deg);
- }
- 70% {
- transform: translate(3px, 1px) rotate(-1deg);
- }
- 80% {
- transform: translate(-1px, -1px) rotate(1deg);
- }
- 90% {
- transform: translate(1px, 2px) rotate(0deg);
- }
- 100% {
- transform: translate(1px, -2px) rotate(-1deg);
- }
-}
-@keyframes subtleshake {
- 0% {
- transform: translate(0px, 0px) rotate(0deg);
- }
- 10% {
- transform: translate(-1px, 1px) rotate(1deg);
- }
- 20% {
- transform: translate(-1px, -1px) rotate(-1deg);
- }
- 30% {
- transform: translate(1px, 0px) rotate(0deg);
- }
- 40% {
- transform: translate(-1px, 1px) rotate(-1deg);
- }
- 50% {
- transform: translate(1px, -1px) rotate(1deg);
- }
- 60% {
- transform: translate(-1px, 1px) rotate(-1deg);
- }
- 70% {
- transform: translate(-1px, -1px) rotate(1deg);
- }
- 80% {
- transform: translate(1px, 1px) rotate(0deg);
- }
- 90% {
- transform: translate(0px, -1px) rotate(-1deg);
- }
- 100% {
- transform: translate(-1px, 1px) rotate(1deg);
- }
-}
-.ToolbarRoot {
- display: flex;
- align-items: center;
- padding-left: 10px;
- transition: opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), transform 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- min-width: -moz-max-content;
- min-width: max-content;
- background-color: white;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
- padding-right: 10px;
- height: 48px;
- position: absolute;
- bottom: 20px;
- left: 20px;
- border-radius: 30px;
-}
-.ToolbarRoot::after {
- content: "";
- display: block;
- width: 100%;
- height: 100%;
- background: #FFF;
- z-index: -9999999;
- position: absolute;
- left: 0px;
- top: 0px;
- border-radius: 30px;
- filter: drop-shadow(0px 4px 50px rgba(0, 0, 0, 0.3));
- transition: filter 0.2s ease-in-out;
-}
-
-.ToolbarRecordingControls {
- display: flex;
- justify-content: center;
- align-items: center;
- background: #F6F7FB;
- border-radius: 30px;
- font-family: "Satoshi-Medium", sans-serif;
- height: calc(100% - 12px);
- padding-left: 2px;
- padding-right: 2px;
-}
-
-.ToolbarRecordingTime {
- margin-right: 4px;
- width: 42px;
- color: #29292F;
- font-size: 13px;
-}
-
-.ToolbarToggleGroup {
- display: flex;
- align-items: center;
-}
-
-.ToolbarToggleWrap {
- flex: 1 1 auto;
- align-items: center;
- justify-content: flex-start;
- position: relative;
- flex: 0 0 auto;
- width: 32px;
- height: 32px;
- display: inline-flex;
- line-height: 1;
- align-items: center;
- justify-content: center;
-}
-
-.ToolbarToggleItem,
-.ToolbarModeItem,
-.ToolbarModeItemSingle,
-.ToolbarLink,
-.ToolbarButton {
- display: flex;
- justify-content: center;
- align-items: center;
- color: #000;
- height: 32px;
- width: 32px;
- text-align: center;
- font-size: 13px;
- line-height: 1;
- border-radius: 50%;
- transition: background-color 0.25s ease-in-out;
- background-color: rgba(124, 139, 165, 0);
-}
-.ToolbarToggleItem svg,
-.ToolbarModeItem svg,
-.ToolbarModeItemSingle svg,
-.ToolbarLink svg,
-.ToolbarButton svg {
- color: #9797A4;
-}
-.ToolbarToggleItem:disabled,
-.ToolbarModeItem:disabled,
-.ToolbarModeItemSingle:disabled,
-.ToolbarLink:disabled,
-.ToolbarButton:disabled {
- opacity: 0.5;
- cursor: not-allowed !important;
- background: none !important;
-}
-
-.ToolbarToggleItem:hover,
-.ToolbarModeItem:hover,
-.ToolbarModeItemSingle:hover,
-.ToolbarLink:hover,
-.ToolbarButton:hover {
- cursor: pointer;
- background-color: rgba(124, 139, 165, 0.1) !important;
-}
-
-.ToolbarToggleItem:focus-visible,
-.ToolbarModeItemSingle:focus-visible,
-.ToolbarModeItem:focus-visible,
-.ToolbarLink:focus-visible,
-.ToolbarButton:focus-visible {
- position: relative;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.ToolbarModeItemSingle {
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 99999;
- position: relative;
-}
-.ToolbarModeItemSingle:first-child {
- margin-left: 0;
-}
-.ToolbarModeItemSingle[data-state=on] {
- background: rgba(120, 192, 114, 0.1);
-}
-.ToolbarModeItemSingle[data-state=on] svg {
- color: #78C072;
-}
-.ToolbarModeItemSingle[data-state=on]::before {
- transform: translateY(0px) scale(1) !important;
- opacity: 1 !important;
-}
-
-.ToolbarModeItem {
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 99999;
- position: relative;
-}
-.ToolbarModeItem:first-child {
- margin-left: 0;
-}
-.ToolbarModeItem::before {
- content: "";
- display: block;
- width: 100%;
- height: 50%;
- border-radius: 5rem 5rem 0% 0%;
- box-sizing: border-box;
- position: absolute;
- top: -16px;
- left: 0;
- z-index: -999999;
- transition: transform 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s ease-in-out;
- transform: translateY(5px) scale(0) !important;
- border-right: 3px solid white;
- border-top: 9px solid white;
- border-left: 3px solid white;
- background-color: transparent;
- opacity: 0;
-}
-.ToolbarModeItem[data-state=on] {
- background: rgba(56, 126, 247, 0.1);
-}
-.ToolbarModeItem[data-state=on] svg {
- color: #3080F8;
-}
-.ToolbarModeItem[data-state=on]::before {
- transform: translateY(0px) scale(1) !important;
- opacity: 1 !important;
-}
-
-.ToolbarBottom .ToolbarModeItem::before {
- transform: translateY(-5px) scale(0.5) !important;
- bottom: -16px;
- top: unset !important;
- border-bottom: 9px solid white !important;
- border-radius: 0% 0% 5rem 5rem !important;
- border-top: none !important;
-}
-.ToolbarBottom .ToolbarModeItem[data-state=on]::before {
- transform: translateY(0px) scale(1) !important;
-}
-
-.ToolbarToggleItem {
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 99999;
- position: relative;
-}
-.ToolbarToggleItem:first-child {
- margin-left: 0;
-}
-.ToolbarToggleItem[data-state=on] {
- background: radial-gradient(117.41% 117.78% at 35.44% 0%, #2BAEF8 23.13%, #3582F6 46.35%, #486DEF 74.48%, #7B9AEA 100%);
- color: #FFF;
-}
-.ToolbarToggleItem[data-state=on] svg {
- color: #FFF;
-}
-
-.ToolbarSeparator {
- width: 1px;
- height: 19px;
- background-color: #E8E8E8;
- margin: 0 8px;
-}
-
-.ToolbarLink {
- background-color: transparent;
- color: var(--mauve11);
- display: inline-flex;
- justify-content: center;
- align-items: center;
-}
-
-.ToolbarLink:hover {
- background-color: transparent;
- cursor: pointer;
-}
-
-body {
- background-color: white !important;
-}
-
-.DrawingToolbar.show-toolbar {
- opacity: 1 !important;
- pointer-events: all !important;
- transform: scale(1) translate(calc(-50% + 16px), 0px) !important;
-}
-
-.ToolbarBottom .DrawingToolbar {
- transform-origin: 0 -100% !important;
-}
-
-.DrawingToolbar {
- opacity: 0;
- pointer-events: none;
- align-items: center;
- display: flex;
- min-width: -moz-max-content;
- min-width: max-content;
- padding-left: 10px;
- padding-right: 10px;
- border-radius: 6px;
- box-shadow: 0 2px 10px var(--blackA7);
- position: absolute;
- height: 44px;
- left: 0px;
- transform: translate(calc(-50% + 16px));
- transform-origin: 0 100%;
- border-radius: 15px;
- z-index: 99999999;
- transition: transform 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- transform: scale(0.5) translate(calc(-50% + 16px), 10px);
-}
-.DrawingToolbar::after {
- content: "";
- display: block;
- width: 100%;
- height: 100%;
- filter: blur(10px);
- opacity: 0.15;
- background-color: #000;
- position: absolute;
- left: 0px;
- top: 0px;
- z-index: -999999999999999 !important;
-}
-.DrawingToolbar::before {
- content: "";
- display: block;
- width: 100%;
- height: 100%;
- background: rgba(242, 241, 242, 0.85);
- -webkit-backdrop-filter: blur(5px);
- backdrop-filter: blur(5px);
- background-clip: content-box;
- -webkit-mask-image: radial-gradient(circle at 50% 59px, transparent 20px, #000 20px);
- mask-image: radial-gradient(circle at 50% 59px, transparent 20px, #000 20px);
- background-position: center bottom 50px;
- border-radius: 15px;
- position: absolute;
- top: 0px;
- left: 0px;
- z-index: -2;
-}
-.DrawingToolbar .ToolbarSeparator {
- background-color: #dddcdc;
-}
-
-.ToolbarTop .DrawingToolbar {
- bottom: 49px !important;
-}
-
-.ToolbarBottom .DrawingToolbar {
- top: 48px !important;
-}
-.ToolbarBottom .DrawingToolbar::before {
- -webkit-mask-image: radial-gradient(circle at 50% -14px, transparent 20px, #000 20px) !important;
- mask-image: radial-gradient(circle at 50% -14px, transparent 20px, #000 20px);
- background-position: center bottom 50px !important;
-}
-
-.ColorPicker {
- width: 14px;
- height: 14px;
- background: #ED6C3A;
- border: 1.5px solid rgba(0, 0, 0, 0.2);
- border-radius: 50%;
-}
-
-.shapeToolbar {
- position: absolute;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 2px 10px var(--blackA7);
- left: 165px;
- padding: 4px;
- opacity: 0;
- bottom: 45px;
- transform: translateY(calc(-50% + 16px));
- transform-origin: 0 100%;
- border-radius: 15px;
- z-index: 99999999;
- transition: transform 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- transform: scale(0.5) translatY(calc(-50% + 16px), 10px);
-}
-.shapeToolbar::after {
- content: "";
- display: block;
- width: 100%;
- height: 100%;
- background: #FFF;
- z-index: -9999999;
- position: absolute;
- left: 0px;
- top: 0px;
- border-radius: 15px;
- filter: drop-shadow(0px 4px 50px rgba(0, 0, 0, 0.3));
- transition: filter 0.2s ease-in-out;
-}
-
-.shapeToolbar.show-toolbar {
- opacity: 1 !important;
- pointer-events: all !important;
- transform: scale(1) translateY(calc(-50% + 16px), 0px) !important;
-}
-
-.TooltipContent {
- border-radius: 30px;
- background-color: #29292F;
- padding: 10px 15px;
- font-size: 12px;
- margin-bottom: 10px;
- bottom: 100px;
- line-height: 1;
- font-family: "Satoshi-Medium", sans-serif;
- z-index: 99999999 !important;
- color: #FFF;
- box-shadow: hsla(206, 22%, 7%, 0.35) 0px 10px 38px -10px, hsla(206, 22%, 7%, 0.2) 0px 10px 20px -15px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- transition: opacity 0.3 ease-in-out;
- will-change: transform, opacity;
- animation-duration: 400ms;
- animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
- will-change: transform, opacity;
-}
-
-.hide-tooltip {
- display: none !important;
-}
-
-.tooltip-tall {
- margin-bottom: 20px;
-}
-
-.tooltip-small {
- margin-bottom: 5px;
-}
-
-.TooltipContent[data-state=delayed-open][data-side=top] {
- animation-name: slideDownAndFade;
-}
-
-.TooltipContent[data-state=delayed-open][data-side=right] {
- animation-name: slideLeftAndFade;
-}
-
-.TooltipContent[data-state=delayed-open][data-side=bottom] {
- animation-name: slideUpAndFade;
-}
-
-.TooltipContent[data-state=delayed-open][data-side=left] {
- animation-name: slideRightAndFade;
-}
-
-@keyframes slideUpAndFade {
- from {
- opacity: 0;
- transform: translateY(2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-@keyframes slideRightAndFade {
- from {
- opacity: 0;
- transform: translateX(-2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
-}
-@keyframes slideDownAndFade {
- from {
- opacity: 0;
- transform: translateY(-2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-@keyframes slideLeftAndFade {
- from {
- opacity: 0;
- transform: translateX(2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
-}
-#screenity-ui [data-radix-popper-content-wrapper] {
- z-index: 99999999999 !important;
-}
-
-.radial-menu {
- position: absolute;
- z-index: 9999999999999;
- width: 100px;
- height: 100px;
- top: -66px;
- left: -49px;
- pointer-events: none;
- opacity: 1;
- transform: scale(1);
- transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.25s ease-in-out;
-}
-.radial-menu::after {
- content: "";
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: -1;
- border: 28px solid #FFF;
- box-sizing: border-box;
- border-radius: 50%;
- -webkit-backdrop-filter: blur(40px);
- backdrop-filter: blur(40px);
- opacity: 0;
- filter: drop-shadow(0px 4px 50px rgba(0, 0, 0, 0.3));
- transform: scale(0);
- transition: transform 0.25s cubic-bezier(0.18, -0.55, 0.265, 1.45), opacity 0.2s ease-in-out;
- transition-delay: 0.05s;
-}
-.radial-menu[data-state=open] {
- transform: scale(1);
- opacity: 1;
- pointer-events: all !important;
-}
-.radial-menu[data-state=open]::after {
- transform: scale(1);
- border: 28px solid #FFF;
- opacity: 1;
-}
-
-.color-wheel::after {
- opacity: 0 !important;
-}
-
-.eyedropper {
- position: absolute;
- left: 0px;
- top: 0px;
- right: 0px;
- bottom: 0px;
- margin: auto;
- width: 16px;
- height: 16px;
- padding: 8px;
- z-index: 999999999;
- background-color: #FFF;
- border-radius: 50%;
- opacity: 0;
- text-align: center;
- transition: transform 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease-in-out, background-color 0.25s ease-in-out !important;
- transform: scale(0);
- overflow: hidden;
- transform-style: preserve-3d;
-}
-.eyedropper svg {
- color: #9797A4;
-}
-.eyedropper:focus-visible {
- outline: none;
- background-color: #E6E7EA !important;
-}
-.eyedropper:hover {
- cursor: pointer;
- background-color: #E6E7EA;
-}
-
-.eye-active {
- background-color: #3080F8 !important;
-}
-.eye-active svg {
- color: #FFF !important;
- fill: #FFF !important;
-}
-
-.color-wheel .eyedropper {
- opacity: 0 !important;
- pointer-events: none !important;
- transform: scale(0) !important;
-}
-
-.radial-menu[data-state=open] .eyedropper {
- transform: scale(1) !important;
- opacity: 1;
-}
-
-.radial-menu-items {
- transform: rotate(10deg);
- z-index: 99999999;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
-}
-
-.radial-menu-item {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- width: 18px;
- height: 18px;
- z-index: 999;
- border-radius: 50%;
- text-align: center;
- box-sizing: border-box;
- line-height: 50px;
- color: white;
- border: 1px solid rgba(0, 0, 0, 0.2);
- transition: transform 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- opacity: 0;
-}
-.radial-menu-item:hover {
- cursor: pointer;
-}
-
-.color-wheel .radial-menu-item {
- opacity: 0 !important;
-}
-
-.radial-menu-item-child {
- width: 100%;
- height: 100%;
- position: absolute;
- box-sizing: border-box;
- border: 0px;
- box-shadow: none;
- top: 0px;
- pointer-events: none;
- z-index: 9999999;
- left: 0px;
- border-radius: 50%;
- background-size: cover;
-}
-.radial-menu-item-child:focus-visible {
- outline: none;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.radial-menu[data-state=open] .radial-menu-item-child {
- pointer-events: all !important;
-}
-
-.radial-menu-item:nth-child(1), .wheel-trigger {
- transform: rotate(0deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(1), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0s);
- transform: rotate(0deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(2), .wheel-trigger {
- transform: rotate(40deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(2), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.02s);
- transform: rotate(40deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(3), .wheel-trigger {
- transform: rotate(80deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(3), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.04s);
- transform: rotate(80deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(4), .wheel-trigger {
- transform: rotate(120deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(4), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.06s);
- transform: rotate(120deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(5), .wheel-trigger {
- transform: rotate(160deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(5), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.08s);
- transform: rotate(160deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(6), .wheel-trigger {
- transform: rotate(200deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(6), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.1s);
- transform: rotate(200deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(7), .wheel-trigger {
- transform: rotate(240deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(7), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.12s);
- transform: rotate(240deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(8), .wheel-trigger {
- transform: rotate(280deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(8), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.14s);
- transform: rotate(280deg) translate(36px);
- opacity: 1;
-}
-
-.radial-menu-item:nth-child(9), .wheel-trigger {
- transform: rotate(320deg) translate(0px);
-}
-
-.radial-menu[data-state=open] .radial-menu-item:nth-child(9), .radial-menu[data-state=open] .wheel-trigger {
- transition-delay: calc(.25s - 0.16s);
- transform: rotate(320deg) translate(36px);
- opacity: 1;
-}
-
-.color-active {
- border: 1px solid #FFFFFF;
- box-shadow: 0px 0px 0px 2px #0D99FF;
-}
-
-.color-wheel .color-active {
- border: none !important;
- box-shadow: none !important;
-}
-
-.wheel-trigger {
- transition: transform 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96), width 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96), height 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96), opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- opacity: 0;
- margin: auto;
- width: 18px;
- box-sizing: border-box;
- height: 18px;
- z-index: 9999;
- box-sizing: border-box;
- background-blend-mode: screen;
- border-radius: 50%;
-}
-.wheel-trigger:hover {
- cursor: pointer;
-}
-
-.wheel-trigger .radial-menu-item-child {
- transform: rotate(30deg);
-}
-.wheel-trigger .radial-menu-item-child:after {
- content: "";
- position: absolute;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- z-index: 9999999;
- border-radius: 50%;
- box-sizing: border-box;
- border: 1px solid rgba(0, 0, 0, 0.2);
-}
-
-.color-wheel .wheel-trigger {
- width: 100px !important;
- height: 100px !important;
- transform: rotate(320deg) translate(0px) !important;
- z-index: 999999999999 !important;
- filter: drop-shadow(0px 4px 50px rgba(0, 0, 0, 0.3));
-}
-
-.color-wheel-handle {
- width: 12px !important;
- height: 12px !important;
- border-radius: 50%;
- left: 20px;
- top: 20px;
- opacity: 0;
- background-color: #F17FD7;
- border: 2px solid white;
- z-index: 999999999999;
- display: none;
- transition: width 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), height 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), margin-left 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96), margin-top 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
-}
-.color-wheel-handle:hover {
- width: 18px !important;
- height: 18px !important;
- margin-left: -2px;
- margin-top: -2px;
-}
-
-.color-wheel .color-wheel-handle {
- opacity: 0;
- display: block;
- animation: fadeIn 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96) forwards;
- animation-delay: 0.5s;
-}
-
-.w-color-wheel {
- pointer-events: none;
- position: absolute !important;
- width: 100% !important;
- height: 100% !important;
- z-index: 99999999 !important;
-}
-.w-color-wheel::after {
- content: "";
- box-sizing: border-box;
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- z-index: 9999999;
- border: 1px solid rgba(0, 0, 0, 0.2);
- box-sizing: border-box;
- border-radius: 50%;
-}
-
-.color-wheel .w-color-wheel {
- pointer-events: all !important;
-}
-
-.w-color-wheel-fill {
- box-shadow: none !important;
- border: 2px solid white !important;
- width: 14px !important;
- height: 14px !important;
- transition: width 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96), height 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96), margin 0.2s cubic-bezier(0.61, 0.11, 0.08, 0.96) !important;
- box-sizing: border-box !important;
- margin-left: -2px !important;
- margin-top: -2px !important;
- z-index: 9999999999 !important;
-}
-
-.w-color-wheel-pointer {
- z-index: 99999999999 !important;
- opacity: 0;
- animation: none !important;
-}
-
-.color-wheel .w-color-wheel-pointer {
- animation: fadeInScale 0.25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards !important;
- animation-delay: 0.28s !important;
-}
-
-.w-color-wheel-fill:hover {
- width: 18px !important;
- height: 18px !important;
- margin-left: -4px !important;
- margin-top: -4px !important;
-}
-
-/* Fade in keyframes */
-@keyframes fadeInScale {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
-}
-.color-wheel, .color-wheel .wheel-trigger, .color-wheel .wheel-trigger .radial-menu-item-child, .color-wheel-handle {
- cursor: pointer !important;
-}
-
-.color-wheel-input {
- background: #000;
- border-radius: 30px;
- height: 29px;
- color: #FFF;
- text-align: center;
- line-height: 29px;
- padding-left: 8px;
- padding-right: 8px;
- position: absolute;
- margin-top: -35px;
- font-family: "Satoshi-Medium", sans-serif;
- left: 50%;
- transform: translate(-50%, 0);
- opacity: 0;
-}
-
-.color-wheel .color-wheel-input {
- animation: fadeIn 0.3s cubic-bezier(0.61, 0.11, 0.08, 0.96) forwards;
- animation-delay: 0.2s;
- pointer-events: all !important;
-}
-
-.color-wheel-input {
- pointer-events: none;
-}
-
-@keyframes fadeIn {
- 0% {
- opacity: 0;
- margin-top: -35px;
- }
- 100% {
- opacity: 1;
- margin-top: -40px;
- }
-}
-.color-active .color-preview {
- opacity: 1;
-}
-
-.radial-menu[data-state=closed] .color-preview {
- opacity: 0 !important;
-}
-
-.color-preview {
- width: 90%;
- height: 90%;
- box-sizing: border-box;
- border-radius: 50%;
- position: absolute;
- left: 50%;
- top: 50%;
- z-index: 9999999999;
- transform: translate(-50%, -50%);
- opacity: 0;
- animation: none;
- pointer-events: none;
- border: 1px solid #FFF;
- box-sizing: border-box;
-}
-
-.color-wheel .color-preview {
- opacity: 0 !important;
-}
-
-.wheel-trigger .color-active {
- box-shadow: none !important;
-}
-
-.color-active .w-color-wheel {
- transform: scale(1.15) !important;
-}
-.color-active .w-color-wheel::after {
- border: none !important;
-}
-
-.color-wheel .w-color-wheel {
- transform: scale(1) !important;
-}
-.color-wheel .w-color-wheel::after {
- border: 1px solid rgba(0, 0, 0, 0.2) !important;
-}
-
-.radial-menu[data-state=closed] .w-color-wheel {
- transform: scale(1) !important;
-}
-
-.stroke-width-item span {
- width: 18px;
- height: 18px;
- display: block;
-}
-.stroke-width-item div[data-state=on] {
- background: #3080F8 !important;
-}
-.stroke-width-item div[data-state=on] svg {
- color: #FFF !important;
- fill: #FFF !important;
-}
-.stroke-width-item div[data-state=off] svg {
- fill: #201F1D;
-}
-
-.stroke-icon svg {
- text-align: center;
- margin: auto;
- display: block;
- width: 100%;
- height: 100%;
-}
-
-.ToastViewport {
- --viewport-padding: 25px;
- position: fixed;
- bottom: 0;
- right: 0;
- left: 0;
- margin: auto !important;
- display: flex;
- flex-direction: column;
- padding: var(--viewport-padding);
- gap: 14px;
- max-width: 100vw;
- width: -moz-fit-content;
- width: fit-content;
- list-style: none;
- z-index: 2147483647;
- outline: none;
- pointer-events: all !important;
-}
-
-.ToastRoot {
- background-color: #29292F;
- color: #FFF;
- border-radius: 30px;
- box-shadow: hsla(206, 22%, 7%, 0.35) 0px 10px 38px -10px, hsla(206, 22%, 7%, 0.2) 0px 10px 20px -15px;
- padding: 10px 14px;
- display: flex;
- flex-direction: row;
- gap: 8px;
- font-size: 15px;
- line-height: 1.5;
- max-width: 100%;
- overflow: hidden;
- justify-content: center;
- align-items: center;
-}
-
-.ToastRoot[data-state=open] {
- animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
-}
-
-.ToastRoot[data-state=closed] {
- animation: hide 100ms ease-in;
-}
-
-.ToastRoot[data-swipe=move] {
- transform: translateY(var(--radix-toast-swipe-move-y));
-}
-
-.ToastRoot[data-swipe=cancel] {
- transform: translateY(0);
- transition: transform 200ms ease-out;
-}
-
-.ToastRoot[data-swipe=end] {
- animation: swipeOut 100ms ease-out;
-}
-
-@keyframes hide {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-@keyframes slideIn {
- from {
- transform: translateY(calc(100% + var(--viewport-padding)));
- }
- to {
- transform: translateY(0);
- }
-}
-@keyframes swipeOut {
- from {
- transform: translateY(var(--radix-toast-swipe-end-y));
- }
- to {
- transform: translateY(calc(100% + var(--viewport-padding)));
- }
-}
-.ToastTitle {
- color: #FFF;
- font-family: "Satoshi-Medium", sans-serif;
-}
-
-.ToastDescription {
- color: var(--slate-11);
- font-family: "Satoshi-Medium", sans-serif;
-}
-
-.ToastAction {
- color: #FFF;
- font-family: "Satoshi-Medium", sans-serif;
- text-align: right;
- background-color: #51515F;
- padding: 0px 12px !important;
- height: 24px !important;
- cursor: pointer;
-}
-
-.toolbar-page {
- width: 100%;
- height: 100%;
- pointer-events: none !important;
-}
-
-.tempimg {
- height: 100%;
- opacity: 1;
- position: fixed;
- right: 0px;
- top: 20px;
-}
-
-.container {
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0px;
- left: 0px;
- z-index: 999999999;
- font-family: "Satoshi-Medium", sans-serif;
- font-size: 14px;
-}
-
-/* Recording popup parent */
-.popup-container {
- width: 356px;
- position: fixed;
- top: 32px;
- right: 28px;
- z-index: 99999999999;
- filter: drop-shadow(0px 4px 100px rgba(0, 0, 0, 0.35));
- pointer-events: all;
-}
-
-.popup-container::before {
- content: "";
- display: block;
- width: 100%;
- height: 100%;
- transition: 2s;
- background: #FFF;
- background-clip: content-box;
- -webkit-mask-image: radial-gradient(circle at center top, transparent 31px, #000 31px);
- mask-image: radial-gradient(circle at center top, transparent 31px, #000 31px);
- background-position: center bottom 50px;
- border-radius: 30px;
- position: absolute;
- top: 0px;
- left: 0px;
-}
-
-/*
-.popup-shape {
- width: 100%;
- height: 100%;
- background: $color-background;
- background-clip: content-box;
- -webkit-mask-image: radial-gradient(circle at center top, transparent 31px, #000 31px);
- mask-image: radial-gradient(circle at center top, transparent 31px, #000 31px);
- background-position: center bottom 50px;
- border-radius: $container-border-radius;
- position: relative;
-}
-*/
-.popup-cutout {
- width: 44px;
- height: 44px;
- border-radius: 50%;
- text-align: center;
- position: absolute;
- display: flex;
- justify-content: center;
- align-items: center;
- top: -22px;
- left: 0px;
- right: 0px;
- margin: auto;
-}
-
-.popup-cutout img {
- text-align: center;
- margin: auto;
- display: inline-block;
- width: 100%;
- border-radius: 50%;
-}
-
-/* Recording nav area */
-.popup-nav {
- width: 100%;
- position: relative;
-}
-
-/* Recording content area */
-.popup-content {
- position: relative;
- width: 100%;
- height: 100%;
- border-radius: 30px;
- overflow: hidden;
-}
-
-.waveform {
- width: 100%;
- margin-top: 12px;
- margin-bottom: 12px;
-}
-
-.popup-content-divider {
- width: 100%;
- height: 1px;
- background: #E8E8E8;
- margin-top: 12px;
- margin-bottom: 12px;
-}
-
-.popup-warning {
- display: flex;
- width: calc(100% + 2rem);
- height: 80px;
- justify-content: space-between;
- align-items: center;
- position: relative;
- overflow: hidden;
- background-color: rgba(56, 126, 247, 0.1);
- margin-left: -1rem;
- margin-top: -1rem;
- margin-bottom: 0.5rem;
-}
-.popup-warning .popup-warning-right {
- color: #3080F8;
- font-family: "Satoshi-Medium", sans-serif;
- width: 90px;
-}
-
-.popup-warning-left, .popup-warning-right {
- width: 50px;
- display: flex;
- align-items: center;
- text-align: center;
- height: 100%;
- justify-content: center;
-}
-.popup-warning-left svg, .popup-warning-right svg {
- color: #3080F8;
-}
-
-.popup-warning-right {
- cursor: pointer;
-}
-
-.popup-warning-middle {
- flex: 1;
-}
-.popup-warning-middle .popup-warning-title {
- font-family: "Satoshi-Bold", sans-serif;
- color: #29292F;
-}
-.popup-warning-middle .popup-warning-description {
- font-family: "Satoshi-Medium", sans-serif;
- color: #6E7684;
- margin-top: 4px;
-}
-
-.permission-button {
- background: rgba(48, 128, 248, 0.1);
- border-radius: 30px;
- color: #3080F8;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 44px;
- gap: 8px;
- margin-top: 8px;
- margin-bottom: 8px;
-}
-.permission-button:first-child {
- margin-top: 4px !important;
-}
-.permission-button:last-child {
- margin-bottom: 4px !important;
-}
-.permission-button:hover {
- background: rgba(48, 128, 248, 0.15);
- cursor: pointer;
-}
-.permission-button svg {
- color: #3080F8;
-}
-
-.CollapsibleTrigger {
- margin-top: 12px;
- font-weight: "Satoshi-Bold", sans-serif;
- padding-top: 4px;
- padding-bottom: 4px;
- padding-left: 12px;
- padding-right: 12px;
- margin-left: auto;
- margin-right: auto;
- text-align: center;
- display: block;
- border-radius: 30px;
-}
-
-.CollapsibleTrigger:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.CollapsibleLabel {
- color: #6E7684;
- font-weight: "Satoshi-Bold", sans-serif;
- text-align: center;
- display: inline-block;
-}
-
-.CollapsibleLabel img {
- margin-left: 4px;
-}
-
-.CollapsibleTrigger:hover {
- cursor: pointer;
- background: #FFF;
-}
-
-.CollapsibleRoot[data-state=open] > .CollapsibleTrigger > .CollapsibleLabel img {
- transform: scaleY(-1);
- margin-bottom: 2px;
-}
-
-.video-ui {
- position: relative;
- /* Blur the background */
-}
-/* .video-ui:before {
- content: "";
- position: absolute;
- -webkit-backdrop-filter: blur(5px);
- backdrop-filter: blur(5px);
- top: 0px;
- left: 0px;
- width: 100%;
- height: 100%;
- background: rgba(255, 255, 255, 0.5);
- z-index: 999;
-} */
-
-.videos-list {
- padding-bottom: 10px !important;
- max-height: calc(96vh - 260px);
- overflow-y: overlay;
- padding: 16px;
-}
-
-.bottom-section {
- width: 100%;
- bottom: 0px;
- left: 0px;
- box-sizing: border-box;
- padding-top: 8px !important;
- padding-bottom: 12px !important;
- padding: 16px;
-}
-
-.ModalSoon {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: -moz-fit-content;
- height: fit-content;
- width: 70%;
- padding: 30px 16px;
- position: absolute;
- left: 0px;
- right: 0px;
- top: 0px;
- bottom: 0px;
- margin: auto;
- border-radius: 30px;
- background: white;
- box-shadow: 0px 4px 100px 0px rgba(0, 0, 0, 0.15);
- z-index: 9999999;
-}
-
-.ModalSoonEmoji {
- font-size: 20px;
- margin-bottom: 8px;
-}
-
-.ModalSoonTitle {
- font-weight: 700;
- color: #29292F;
- margin-bottom: 8px;
- text-align: center;
-}
-
-.ModalSoonDescription {
- text-align: center;
- color: #6E7684;
- text-align: center;
- margin-bottom: 8px;
-}
-
-.ModalSoonButton {
- margin-top: 8px;
- color: #FFF;
- text-align: center;
- border-radius: 30px;
- background: radial-gradient(117.41% 117.78% at 35.44% 0%, #2BAEF8 23.13%, #3582F6 46.35%, #486DEF 74.48%, #7B9AEA 100%);
- padding: 8px 16px;
-}
-.ModalSoonButton:hover {
- cursor: pointer;
-}
-
-/* reset */
-button {
- all: unset;
-}
-
-.SelectTrigger {
- display: inline-flex;
- align-items: center;
- justify-content: space-between;
- border-radius: 30px;
- line-height: 1;
- height: 44px;
- gap: 5px;
- background-color: #FFF;
- color: #29292F;
- width: 100%;
- box-sizing: border-box;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-.SelectTrigger:hover {
- box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
- cursor: pointer;
-}
-
-.SelectTrigger:focus {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5) !important;
-}
-
-.SelectTrigger[data-placeholder] {
- color: var(--violet9);
-}
-
-.SelectTrigger[data-state=open] {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.SelectValue {
- flex: 1;
- display: block;
- width: 100%;
- height: 100%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- box-sizing: border-box;
-}
-.SelectValue span {
- overflow: hidden;
- text-overflow: ellipsis;
- height: 100%;
- line-height: 44px;
-}
-
-.SelectIconDrop, .SelectIconType {
- text-align: center;
-}
-
-.SelectIconType {
- padding-left: 0.4rem;
- padding-right: 0px;
-}
-
-.SelectIconDrop {
- padding-right: 16px;
-}
-
-.SelectTrigger[data-state=open] .SelectIconDrop img {
- transform: rotate(180deg);
-}
-
-.SelectContent {
- overflow: hidden;
- z-index: 99999999999;
- width: var(--radix-select-trigger-width);
- max-height: var(--radix-select-content-available-height);
- font-family: "Satoshi-Medium", sans-serif;
- background-color: white;
- border-radius: 15px;
- margin-top: 4px;
- box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
-}
-
-.SelectItem {
- font-size: 14px;
- line-height: 1;
- color: var(--violet11);
- display: flex;
- align-items: center;
- height: 44px;
- padding-left: 16px;
- padding-right: 16px;
- color: #29292F;
- position: relative;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.SelectItem[data-disabled] {
- color: #6E7684;
- pointer-events: none;
-}
-
-.SelectItem[data-highlighted] {
- background: #F6F7FB;
- outline: none !important;
-}
-
-.SelectItem:hover {
- background: #F6F7FB;
- cursor: pointer;
-}
-
-.SelectSeparator {
- height: 1px;
- background-color: #E8E8E8;
- width: calc(100% - 24px);
- margin: auto;
- border-radius: 30px;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-.SelectItemIndicator {
- position: absolute;
- right: 12px;
- width: 24px;
- height: 24px;
- background: #3080F8;
- border-radius: 50%;
- display: inline-flex;
- align-items: center;
- justify-content: center;
-}
-
-.SelectScrollButton {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 25px;
- background-color: white;
- color: var(--violet11);
- cursor: default;
-}
-
-.SelectOff {
- background: #FAF0F4;
- color: #D2234D;
- padding-left: 12px;
- padding-right: 12px;
- padding-top: 8px;
- padding-bottom: 8px;
- margin-right: 4px;
- border-radius: 30px;
- font-size: 12px;
- font-weight: 700;
-}
-
-.SelectIconButton {
- border-radius: 30px;
- position: relative;
- padding: 8px;
-}
-.SelectIconButton:hover {
- background-color: #F6F7FB;
-}
-
-/* Radix tabs navigation */
-/* reset */
-button,
-fieldset,
-input {
- all: unset;
-}
-
-.TabsRoot {
- width: 100%;
- margin: auto;
- flex: 1 1 auto;
- display: flex;
- flex-direction: column;
-}
-
-.TabsList {
- margin: auto;
- flex-shrink: 0;
- display: flex;
- width: -moz-fit-content;
- width: fit-content;
-}
-
-.TabsTrigger {
- padding-left: 12px;
- padding-right: 12px;
- color: #6E7684;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- cursor: pointer;
-}
-
-.TabsTrigger[data-state=active] {
- color: #29292F;
-}
-
-.TabsTrigger:focus-visible {
- position: relative;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5) !important;
-}
-
-/* Content of the Radix tabs */
-.TabsContent {
- width: 100%;
- display: block;
- height: 100%;
- box-sizing: border-box;
- flex: 1 1 auto;
-}
-
-.TabsContent:focus {
- outline: none;
-}
-
-.TabsContent:focus-visible {
- box-shadow: inset 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.TabsContent[data-state=inactive] {
- display: none;
-}
-
-/* Pill animation */
-.pill-anim {
- position: absolute;
- height: 32px;
- top: 0px;
- bottom: 0px;
- margin-top: auto;
- margin-bottom: auto;
- border-radius: 30px;
- background: #FFF;
- box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
- transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
-}
-
-.TabsList[data-value=record] .pill-anim {
- left: 8px;
- width: 102px;
-}
-
-.TabsList[data-value=dashboard] .pill-anim {
- left: 109px;
- width: 132px;
-}
-
-/* Specific to the top level tabs */
-.TabsRoot.tl {
- height: calc(100% - 40px);
- margin-top: 40px;
-}
-
-.TabsList.tl {
- border-radius: 30px;
- background: #F6F7FB;
- padding: 6px;
- font-family: "Satoshi-Bold", sans-serif;
- position: relative;
-}
-
-.TabsTrigger.tl {
- border-radius: 30px;
- background: transparent;
- height: 32px;
- display: flex;
- align-items: center;
- padding-left: 16px;
- padding-right: 17px;
- z-index: 2;
- position: relative;
-}
-
-.TabsTrigger.tl[data-state=inactive]:hover :before {
- content: "";
- position: absolute;
- display: block;
- box-sizing: border-box;
- height: 100%;
- width: calc(100% - 10px);
- margin-left: 5px;
- background: #EDEEF3;
- z-index: -2;
- left: 0px;
- border-radius: 30px;
-}
-
-.TabsTriggerIcon {
- width: 20px;
- height: 20px;
- text-align: center;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border-radius: 30px;
- margin-right: 4px;
-}
-
-/* Specific to recording tab context */
-.recording-ui {
- width: 100%;
- flex: 1 1 auto;
- display: flex;
- flex-direction: column;
- height: 100%;
-}
-.recording-ui .TabsRoot {
- margin-top: 8px;
-}
-.recording-ui .TabsList {
- width: 100%;
- border-bottom: 1px solid #E8E8E8;
- margin: auto;
- justify-content: center;
-}
-.recording-ui .TabsTrigger {
- padding-top: 8px;
- padding-bottom: 12px;
- box-sizing: border-box;
- position: relative;
- display: block;
- padding-left: 16px;
- padding-right: 16px;
-}
-.recording-ui .TabsTrigger:hover {
- background: #F6F7FB;
- border-top-right-radius: 15px;
- border-top-left-radius: 15px;
-}
-.recording-ui .TabsTrigger:focus-visible {
- border-radius: 10px 10px 0px 0px !important;
-}
-.recording-ui .TabsTrigger[data-state=active]::after {
- content: "";
- display: block;
- position: absolute;
- width: 80%;
- left: 0px;
- right: 0px;
- bottom: 0px;
- margin: auto;
- height: 2px;
- border-radius: 30px;
- background: #3080F8;
-}
-.recording-ui .TabsTrigger[data-state=active] > .TabsTriggerLabel {
- color: #29292F !important;
-}
-.recording-ui .TabsTriggerLabel {
- text-align: center;
-}
-.recording-ui .TabsTriggerIcon {
- width: 20px;
- height: 20px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- text-align: center;
- margin: auto;
- margin-bottom: 8px;
- border-radius: 30px;
-}
-.recording-ui .TabsContent {
- background: #F6F7FB;
- padding: 16px;
- border-bottom-left-radius: 30px;
- border-bottom-right-radius: 30px;
- max-height: calc(95vh - 200px);
- overflow-y: overlay;
-}
-.recording-ui span {
- display: block;
-}
-
-.video-ui {
- width: 100%;
- flex: 1 1 auto;
- display: flex;
- flex-direction: column;
- height: 100%;
-}
-.video-ui .TabsRoot {
- margin-top: 8px;
-}
-.video-ui .TabsList {
- width: 100%;
- border-bottom: 1px solid #E8E8E8;
- margin: auto;
- justify-content: space-between;
- padding-left: 12px;
- padding-right: 12px;
- box-sizing: border-box;
-}
-.video-ui .TabsTriggerWrap {
- display: flex !important;
- align-items: center;
- flex-direction: row;
- justify-content: left;
- position: relative;
- display: block;
- box-sizing: border-box;
-}
-.video-ui .TabsTrigger {
- padding-top: 8px;
- padding-bottom: 12px;
- box-sizing: border-box;
- position: relative;
- display: block;
- padding-left: 20px;
- padding-right: 20px;
-}
-.video-ui .TabsTrigger:hover {
- background: #F6F7FB;
- border-top-right-radius: 15px;
- border-top-left-radius: 15px;
-}
-.video-ui .TabsTrigger:focus-visible {
- border-radius: 10px 10px 0px 0px !important;
-}
-.video-ui .TabsTrigger[data-state=active]::after {
- content: "";
- display: block;
- position: absolute;
- width: 80%;
- left: 0px;
- right: 0px;
- bottom: 0px;
- margin: auto;
- height: 2px;
- border-radius: 30px;
- background: #3080F8;
-}
-.video-ui .TabsTrigger[data-state=active] > .TabsTriggerLabel {
- color: #29292F !important;
-}
-.video-ui .TabsTriggerLabel {
- text-align: center;
-}
-.video-ui .TabsContent {
- background: #F6F7FB;
- border-bottom-left-radius: 30px;
- border-bottom-right-radius: 30px;
-}
-.video-ui span {
- display: block;
-}
-.video-ui .TabsSort {
- margin-right: 12px;
- border-radius: 30px;
- padding-left: 8px;
- padding-right: 8px;
- padding-top: 8px;
- padding-bottom: 8px;
- margin-bottom: 5px;
-}
-.video-ui .TabsSort:hover {
- cursor: pointer;
- background: #F6F7FB;
-}
-.video-ui .TabsSortLabel {
- display: flex;
- flex-direction: row;
- justify-content: right;
- align-items: center;
- color: #6E7684;
-}
-.video-ui .TabsSortLabel img {
- margin-left: 8px;
-}
-.video-ui .TabsSort:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
- outline: none !important;
-}
-
-/* reset */
-button {
- all: unset;
-}
-
-.SwitchRow {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 40px;
-}
-
-.SwitchRoot {
- width: 34px;
- height: 22px;
- background-color: #E8E8E8;
- border-radius: 9999px;
- position: relative;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-
-.SwitchRoot:focus {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.SwitchRoot[data-state=checked] {
- background-color: #3080F8;
-}
-
-.SwitchRoot:hover {
- cursor: pointer;
-}
-
-.SwitchThumb {
- display: block;
- width: 14px;
- height: 14px;
- background-color: white;
- border-radius: 9999px;
- box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.1);
- transition: transform 100ms;
- transform: translateX(2px);
- will-change: transform;
-}
-
-.SwitchThumb[data-state=checked] {
- transform: translateX(18px);
-}
-
-.Label {
- color: #6E7684;
- display: flex;
-}
-
-.ExperimentalLabel {
- color: #FFF;
- font-size: 12px;
- background-color: #3080F8;
- border-radius: 15px;
- padding: 2px 8px;
- display: inline-block;
- margin-left: 8px;
-}
-
-.video-item-root {
- width: calc(100% - 2 * 8px);
- border-radius: 15px;
- padding: 8px;
- display: block;
-}
-.video-item-root .video-item {
- width: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
-}
-.video-item-root .video-item-left {
- display: flex;
- flex-grow: 1;
- flex-direction: row;
- align-items: center;
- min-width: 0;
- justify-content: left;
-}
-.video-item-root .video-item-thumbnail {
- min-width: 48px;
- width: 48px;
- height: 38px;
- background: grey;
- border-radius: 5px;
- margin-right: 12px;
-}
-.video-item-root .video-item-info {
- display: block;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding-right: 4px;
-}
-.video-item-root .video-item-info-title {
- color: #29292F;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-.video-item-root .video-item-info-date {
- margin-top: 4px;
- color: #6E7684;
- font-size: 12px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-.video-item-root:hover {
- cursor: pointer;
- background: #E9EAEE;
-}
-
-.video-item-root:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
- outline: none !important;
-}
-
-/* Actions */
-.video-item-right {
- display: flex;
- align-items: center;
- justify-content: right;
- gap: 8px;
- min-width: -moz-max-content;
- min-width: max-content;
- opacity: 0;
-}
-.video-item-right .copy-link {
- background: #FFF;
- height: 32px;
- padding-left: 8px;
- padding-right: 8px;
- border-radius: 10px;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
-}
-.video-item-right .copy-link img {
- margin-right: 4px;
-}
-.video-item-right .copy-link:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
- outline: none !important;
-}
-.video-item-right .more-actions {
- height: 32px;
- width: 32px;
- background: #FFF;
- text-align: center;
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.video-item-right .more-actions:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
- outline: none !important;
-}
-
-.video-item-root:hover .video-item-right, .video-item-root:focus-visible .video-item-right {
- opacity: 1;
-}
-
-.video-item-right:focus-within {
- opacity: 1;
-}
-
-.main-button {
- width: 100%;
- height: 45px;
- border-radius: 30px;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- position: relative;
- box-sizing: border-box;
-}
-.main-button .main-button-label {
- color: #FFF;
- text-align: center;
- vertical-align: middle;
- align-items: center;
-}
-.main-button .main-button-shortcut {
- position: absolute;
- font-size: 12px;
- right: 16px;
- color: #FFF;
- opacity: 0.7;
-}
-.main-button:hover {
- cursor: pointer;
-}
-.main-button:disabled {
- cursor: not-allowed;
- opacity: 0.5;
-}
-
-.main-button:focus {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5) !important;
-}
-
-@property --x {
- syntax: "<percentage>";
- inherits: false;
- initial-value: 35.44%;
-}
-@property --y {
- syntax: "<percentage>";
- inherits: false;
- initial-value: 0%;
-}
-.recording-button {
- --x: 35.44%;
- --y: 0%;
- margin-top: 8px;
- filter: drop-shadow(0px 4px 20px rgba(86, 123, 218, 0.5));
- background: radial-gradient(127.41% 127.78% at var(--x) var(--y), #2BAEF8 23.13%, #3582F6 46.35%, #486DEF 74.48%, #7B9AEA 100%);
- transition: --x 0.2s ease-in-out, --y 0.2s ease-in-out;
- animation: 0;
- animation: gradient-animation 15s linear infinite;
- animation-play-state: paused;
- position: relative;
- z-index: 2;
-}
-
-.recording-button:hover {
- animation-play-state: running;
-}
-
-.recording-button:before {
- content: "";
- position: absolute;
- display: block;
- top: 0px;
- left: 0px;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- border-radius: 30px;
- transition: all 0.25s ease-in-out;
-}
-
-.recording-button:hover:before {
- box-shadow: 0px 0px 0px 4px rgba(52, 138, 247, 0.25);
-}
-
-@keyframes pulse-animation {
- 0% {
- box-shadow: 0px 0px 0px 2px rgba(52, 138, 247, 0.25);
- }
- 25% {
- box-shadow: 0px 0px 0px 6px rgba(52, 138, 247, 0.25);
- }
- 50% {
- box-shadow: 0px 0px 0px 2px rgba(52, 138, 247, 0.25);
- }
- 100% {
- box-shadow: 0px 0px 0px 2px rgba(52, 138, 247, 0.25);
- }
-}
-@keyframes gradient-animation {
- 0% {
- --x: 35.44%;
- --y: 0%;
- }
- 25% {
- --x: 100%;
- --y: 30%;
- }
- 50% {
- --x: 70%;
- --y: 100%;
- }
- 75% {
- --x: 30%;
- --y: 90%;
- }
- 100% {
- --x: 35.44%;
- --y: 0%;
- }
-}
-.dashboard-button {
- background: #29292F;
- box-shadow: 0px 0px 0px 0px rgba(41, 41, 47, 0.25);
- transition: all 0.25s ease-in-out;
-}
-
-.dashboard-button:hover {
- box-shadow: 0px 0px 0px 4px rgba(41, 41, 47, 0.25);
-}
-
-.alarm-time-button {
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 15px;
- padding: 4px 8px;
- position: absolute;
- color: #FFF;
- opacity: 0.7;
- font-family: "Satoshi-Medium", sans-serif;
- font-size: 0.75rem;
- left: 6px;
-}
-.alarm-time-button svg {
- margin-top: 4px;
- margin-right: 4px;
- width: 14px;
-}
-
-.background-effects-toggle-group {
- display: flex;
- height: 40px;
- width: 100%;
- gap: 8px;
- margin-bottom: 8px;
- margin-top: 8px;
-}
-
-.background-effect {
- display: flex;
- width: 40px;
- height: 40px;
- align-items: center;
- justify-content: center;
- border-radius: 30px;
- position: relative;
- color: #FFF;
-}
-.background-effect span {
- position: absolute;
- top: 0px;
- left: 0px;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 12px;
- font-weight: 600;
- z-index: 99999;
- font-weight: 500;
-}
-.background-effect[data-state=on]::after {
- content: "";
- border-radius: 50%;
- display: block;
- width: 46px;
- height: 46px;
- position: absolute;
- border: 2px solid #3080F8;
- box-sizing: border-box;
-}
-.background-effect img {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- position: absolute;
- top: 0px;
- left: 0px;
-}
-.background-effect:hover:not([data-state=on]) {
- cursor: pointer;
-}
-.background-effect:hover:not([data-state=on])::after {
- content: "";
- border-radius: 50%;
- display: block;
- width: 46px;
- height: 46px;
- position: absolute;
- border: 2px solid #3080F8;
- opacity: 0.5;
- box-sizing: border-box;
-}
-.background-effect:focus-visible {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.region-dimensions {
- width: 100%;
- display: flex;
- gap: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-.region-input {
- flex: 1;
- position: relative;
-}
-.region-input input {
- color: #29292F !important;
- border-radius: 30px;
- height: 40px;
- box-sizing: border-box;
- position: relative;
- width: 100%;
- padding-left: 18px;
- padding-right: 40px;
- font-family: "Satoshi-Medium", sans-serif;
- background-color: #FFF;
-}
-.region-input input:focus-visible {
- outline: none;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-.region-input span {
- color: #6E7684;
- font-family: "Satoshi-Medium", sans-serif;
- position: absolute;
- right: 18px;
- bottom: 12px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.time-set-parent {
- width: 100%;
- display: flex;
- gap: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-.time-set-input {
- flex: 1;
- position: relative;
-}
-.time-set-input input {
- border-radius: 30px;
- height: 40px;
- box-sizing: border-box;
- position: relative;
- width: 100%;
- padding-left: 18px;
- padding-right: 40px;
- font-family: "Satoshi-Medium", sans-serif;
- background-color: #FFF;
- -webkit-appearance: textfield;
- -moz-appearance: textfield;
- appearance: textfield;
-}
-.time-set-input input:focus-visible {
- outline: none;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-.time-set-input span {
- color: #6E7684;
- font-family: "Satoshi-Medium", sans-serif;
- position: absolute;
- right: 18px;
- bottom: 12px;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.CanvasContainer {
- width: 100%;
- height: 100%;
- position: absolute;
- pointer-events: all !important;
- top: 0px !important;
- left: 0px !important;
- z-index: 99999999999 !important;
-}
-
-.canvas {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0px !important;
- left: 0px !important;
- z-index: 99999999999 !important;
-}
-
-.canvas-container {
- width: 100vw !important;
- height: 100vh !important;
- top: 0px !important;
- left: 0px !important;
- z-index: 99999999999;
- position: absolute !important;
-}
-
-.camera-draggable {
- width: 100%;
- height: 100%;
- transform-origin: left top;
- border-radius: 50%;
-}
-
-.camera-grab {
- width: 100%;
- height: 100%;
- position: absolute;
- border-radius: 50%;
- z-index: 99999999 !important;
- cursor: grab;
-}
-
-.camera-flipped {
- transform: scaleX(-1);
-}
-
-.camera-toolbar {
- display: flex;
- align-items: center;
- padding-left: 4px;
- padding-right: 4px;
- transition: opacity 0.25s cubic-bezier(0.61, 0.11, 0.08, 0.96);
- min-width: -moz-max-content;
- min-width: max-content;
- background-color: rgba(30, 30, 30, 0.8);
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
- height: 28px;
- position: absolute;
- left: 10px;
- top: 10px;
- border-radius: 30px;
- -webkit-backdrop-filter: blur(10px);
- backdrop-filter: blur(10px);
- z-index: 99999999999;
- opacity: 0;
- border: 3px solid rgba(255, 255, 255, 0.2);
-}
-
-.camera-draggable:hover .camera-toolbar, .camera-draggable:hover .camera-resize {
- opacity: 1 !important;
-}
-
-.camera-toolbar:hover, .camera-resize:hover {
- opacity: 1 !important;
-}
-
-.CameraToolbarSeparator {
- width: 1px;
- height: 18px;
- background-color: rgba(255, 255, 255, 0.3);
- margin: 0 4px;
-}
-
-.CameraToggleItem, .CameraToolbarButton {
- display: flex;
- justify-content: center;
- align-items: center;
- color: #000;
- height: 22px;
- width: 22px;
- text-align: center;
- font-size: 13px;
- line-height: 1;
- border-radius: 50%;
- transition: background-color 0.25s ease-in-out;
- background-color: rgba(124, 139, 165, 0);
-}
-.CameraToggleItem svg, .CameraToolbarButton svg {
- color: #9797A4;
-}
-.CameraToggleItem:hover, .CameraToolbarButton:hover {
- background-color: rgba(124, 139, 165, 0.2) !important;
- cursor: pointer;
-}
-.CameraToggleItem:disabled, .CameraToolbarButton:disabled {
- opacity: 0.5;
- pointer-events: none;
-}
-.CameraToggleItem[data-state=on], .CameraToolbarButton[data-state=on] {
- color: #FFF;
-}
-.CameraToggleItem[data-state=on] svg, .CameraToolbarButton[data-state=on] svg {
- color: #FFF;
-}
-
-.CameraToggleItem:hover, .CameraToggleButton:hover {
- cursor: pointer;
-}
-
-.CameraToggleItem:focus-visible, .CameraToggleButton:focus-visible {
- position: relative;
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.CameraToggleGroup {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.CameraToggleGroup, .CameraToolbarSeparator {
- display: none;
-}
-
-.camera-resize {
- position: absolute;
- bottom: 20px;
- right: 20px;
- z-index: 99999999999;
- height: 28px;
- width: 28px;
- border-radius: 50%;
- background-color: rgba(30, 30, 30, 0.8);
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
- border: 3px solid rgba(255, 255, 255, 0.2);
- -webkit-backdrop-filter: blur(10px);
- backdrop-filter: blur(10px);
- align-items: center;
- box-sizing: border-box;
- display: flex;
- justify-content: center;
- align-items: center;
- opacity: 0;
-}
-.camera-resize svg {
- color: #9797A4;
- text-align: center;
- margin: auto;
- display: block;
-}
-
-.countdown {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0px;
- left: 0px;
- z-index: 99999999999;
-}
-
-.countdown-circle {
- width: 200px;
- height: 200px;
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 999;
- text-align: center;
-}
-
-.countdown-overlay {
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.5);
- position: absolute;
- top: 0px;
- left: 0px;
- z-index: 99;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.countdown-number {
- position: absolute;
- width: 20px;
- height: 60px;
- z-index: 9999999;
- left: 0px;
- right: 0px;
- top: 0px;
- bottom: 0px;
- margin: auto;
- font-weight: 300;
- font-family: "Satoshi-Light", sans-serif;
- font-size: 3rem;
- color: #FFF;
- text-align: center;
- display: block;
- transition: all 0.6s ease-in-out;
-}
-
-.background {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0px;
- top: 0px;
- filter: url("#goo");
- transform: rotate(0deg);
- transition: all 3s ease-in-out;
-}
-
-.circle {
- z-index: 9;
- position: absolute;
- transform: scale(0.8);
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- margin: auto;
- border-radius: 50%;
- background: radial-gradient(118.3% 119.01% at 35.44% 0%, #2BAEF8 23.13%, #3582F6 46.35%, #486DEF 74.48%, #7B9AEA 100%);
- width: 200px;
- height: 200px;
- transition: all 1.5s ease-in-out;
-}
-
-.c {
- width: 50px;
- height: 50px;
- z-index: 999;
- border-radius: 50%;
- position: absolute;
- top: 0px;
- right: 0px;
- left: 0px;
- bottom: 0px;
- margin: auto;
- transition: cubic-bezier(0.82, 0.1, 0.24, 0.99) 1.5s;
- opacity: 1;
-}
-
-.c2 {
- background: radial-gradient(118.3% 119.01% at 35.44% 0%, #2B96F8 23.13%, #356BF6 64.58%);
- transform: translate(20px, 20px);
-}
-
-.c3 {
- background: radial-gradient(118.3% 119.01% at 35.44% 0%, #4884CA 15.3%, #2B89F8 78.83%);
- transform: translate(-30px, -40px);
-}
-
-.c3:after {
- content: "";
- position: absolute;
- width: 150px;
- height: 150px;
- filter: blur(50px);
- border-radius: 50%;
- top: 0px;
- right: 0px;
- left: 0px;
- bottom: 0px;
- margin: auto;
- transition: cubic-bezier(0.82, 0.1, 0.24, 0.99) 1.5s;
- background: #CBE8F7;
- z-index: -1;
-}
-
-.recording-countdown .c2 {
- transform: translate(-15px, 15px);
-}
-
-.recording-countdown .c3 {
- transform: translate(-10px, -5px);
-}
-
-.countdown-info {
- position: absolute;
- left: 0px;
- right: 0px;
- margin: auto;
- bottom: 20px;
- border-radius: 30px;
- border: 2px solid rgba(255, 255, 255, 0.3);
- text-align: center;
- display: block;
- padding: 10px 20px;
- font-family: "Satoshi-Medium", sans-serif;
- color: #FFF;
- z-index: 99999999999;
- width: -moz-fit-content;
- width: fit-content;
-}
-
-/* reset */
-button {
- all: unset;
-}
-
-.AlertDialogOverlay {
- background-color: rgba(0, 0, 0, 0.5);
- position: fixed;
- inset: 0;
- animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
- z-index: 99999999999;
-}
-
-.AlertDialogContent {
- background-color: white;
- border-radius: 30px;
- box-shadow: hsla(206, 22%, 7%, 0.35) 0px 10px 38px -10px, hsla(206, 22%, 7%, 0.2) 0px 10px 20px -15px;
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 90vw;
- max-width: 500px;
- max-height: 85vh;
- padding: 35px 25px;
- animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
- z-index: 99999999999;
-}
-
-.AlertDialogContent:focus {
- outline: none;
-}
-
-.AlertDialogTitle {
- margin: 0;
- color: #29292F;
- font-size: 14px;
- font-family: "Satoshi-Medium", sans-serif;
- font-weight: 700;
-}
-
-.AlertDialogDescription {
- margin-bottom: 20px;
- color: #6E7684;
- font-size: 14px;
- line-height: 1.5;
-}
-
-.Button {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border-radius: 30px;
- padding: 0 15px;
- font-size: 15px;
- line-height: 1;
- font-weight: 500;
- height: 35px;
-}
-
-.Button.red {
- background-color: rgba(247, 56, 90, 0.1);
- color: rgb(247, 56, 90);
-}
-
-.Button.red:hover {
- background-color: rgba(247, 56, 90, 0.15);
- cursor: pointer;
-}
-
-.Button.red:focus {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-.Button.grey {
- background: rgba(110, 118, 132, 0.1);
- color: #6E7684;
-}
-
-.Button.grey:hover {
- background: rgba(110, 118, 132, 0.15);
- cursor: pointer;
-}
-
-.Button.grey:focus {
- box-shadow: 0px 0px 0px 2px rgba(48, 128, 248, 0.5);
-}
-
-@keyframes overlayShow {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
-}
-@keyframes contentShow {
- from {
- opacity: 0;
- transform: translate(-50%, -48%) scale(0.96);
- }
- to {
- opacity: 1;
- transform: translate(-50%, -50%) scale(1);
- }
-}
-.box-hole {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 9999999999;
-}
-
-.resize-handle {
- position: absolute;
- width: 10px;
- height: 10px;
- border-radius: 50%;
- background-color: white;
- border: 2px solid rgba(0, 0, 0, 0.5);
- box-sizing: border-box;
-}
-
-.resize-handle.top-left {
- bottom: 0;
- left: 0;
- top: 0;
- right: 0;
- margin: auto;
- cursor: nwse-resize;
-}
-
-.resize-handle.top {
- top: 0;
- left: 50%;
- transform: translateX(-50%);
- cursor: ns-resize;
-}
-
-.resize-handle.top-right {
- bottom: 0;
- left: 0;
- top: 0;
- right: 0;
- margin: auto;
- cursor: nesw-resize;
-}
-
-.resize-handle.right {
- top: 50%;
- right: 0;
- transform: translateY(-50%);
- cursor: ew-resize;
-}
-
-.resize-handle.bottom-right {
- bottom: 0;
- left: 0;
- top: 0;
- right: 0;
- margin: auto;
- cursor: nwse-resize;
-}
-
-.resize-handle.bottom {
- bottom: 0;
- left: 50%;
- transform: translateX(-50%);
- cursor: ns-resize;
-}
-
-.resize-handle.bottom-left {
- bottom: 0;
- left: 0;
- top: 0;
- right: 0;
- margin: auto;
- cursor: nesw-resize;
-}
-
-.resize-handle.left {
- top: 50%;
- left: 0;
- transform: translateY(-50%);
- cursor: ew-resize;
-}
-
-.region-recording * {
- pointer-events: none !important;
-}
-
-html {
- font-size: 16px;
-}
\ No newline at end of file
diff --git a/src/pages/Content/toolbar/styles/layout/_DrawingToolbar.scss b/src/pages/Content/toolbar/styles/layout/_DrawingToolbar.scss
index a01433f..5c1b6d7 100644
--- a/src/pages/Content/toolbar/styles/layout/_DrawingToolbar.scss
+++ b/src/pages/Content/toolbar/styles/layout/_DrawingToolbar.scss
@@ -1,8 +1,5 @@
@use '../../../styles/_variables' as *;
-body {
- background-color: white!important;
-}
.DrawingToolbar.show-toolbar {
opacity: 1!important;
pointer-events: all!important;
diff --git a/src/pages/Content/toolbar/styles/layout/_Toolbar.scss b/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
index 99e6ccf..ce5fc57 100644
--- a/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
+++ b/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
@@ -7,7 +7,7 @@ button {
all: unset;
}
-iframe {
+iframe.screenity-iframe {
width: 100%;
height: 100%;
position: fixed;
diff --git a/src/pages/OffscreenRecorder/OffscreenRecorder.jsx b/src/pages/OffscreenRecorder/OffscreenRecorder.jsx
new file mode 100644
index 0000000..ce572ee
--- /dev/null
+++ b/src/pages/OffscreenRecorder/OffscreenRecorder.jsx
@@ -0,0 +1,24 @@
+import React, { useEffect } from "react";
+import CloudRecorder from "../CloudRecorder/CloudRecorder";
+import Recorder from "../Recorder/Recorder";
+
+// ?cloud=1 → CloudRecorder (TUS), ?resume=1 → silent upload resume, default → local Recorder.
+const urlParams = new URLSearchParams(window.location.search);
+const IS_CLOUD = urlParams.get("cloud") === "1";
+const IS_RESUME = urlParams.get("resume") === "1";
+
+const OffscreenRecorder = () => {
+ useEffect(() => {
+ if (IS_RESUME) return;
+ chrome.runtime.sendMessage({ type: "offscreen-ready" }).catch((err) => {
+ console.warn("[OffscreenRecorder] offscreen-ready send failed", err);
+ });
+ }, []);
+
+ if (IS_RESUME) {
+ return null; // minimal shell, handler runs in index.jsx
+ }
+ return IS_CLOUD ? <CloudRecorder /> : <Recorder />;
+};
+
+export default OffscreenRecorder;
diff --git a/src/pages/OffscreenRecorder/chromeShim.js b/src/pages/OffscreenRecorder/chromeShim.js
new file mode 100644
index 0000000..1a099b5
--- /dev/null
+++ b/src/pages/OffscreenRecorder/chromeShim.js
@@ -0,0 +1,122 @@
+// chrome.storage / chrome.i18n / chrome.tabs shim for offscreen docs - proxies to SW.
+// Install before any code that uses chrome.storage runs.
+
+const DEBUG = false;
+
+const sendProxy = async (type, payload) => {
+ try {
+ const resp = await chrome.runtime.sendMessage({ type, ...payload });
+ if (DEBUG) console.log("[ChromeShim]", type, "->", resp);
+ return resp;
+ } catch (err) {
+ console.warn("[ChromeShim]", type, "error:", err);
+ return { ok: false, error: String(err) };
+ }
+};
+
+const makeStorageArea = (area) => ({
+ get(keys, callback) {
+ const normalised = keys === undefined ? null : keys;
+ const promise = sendProxy("proxy-storage-get", {
+ area,
+ keys: normalised,
+ }).then((resp) => (resp && resp.ok ? resp.result || {} : {}));
+ if (typeof callback === "function") {
+ promise.then(callback, () => callback({}));
+ return undefined;
+ }
+ return promise;
+ },
+ set(items, callback) {
+ const promise = sendProxy("proxy-storage-set", { area, items }).then(
+ () => undefined
+ );
+ if (typeof callback === "function") {
+ promise.then(callback, callback);
+ return undefined;
+ }
+ return promise;
+ },
+ remove(keys, callback) {
+ const promise = sendProxy("proxy-storage-remove", { area, keys }).then(
+ () => undefined
+ );
+ if (typeof callback === "function") {
+ promise.then(callback, callback);
+ return undefined;
+ }
+ return promise;
+ },
+ clear(callback) {
+ const promise = sendProxy("proxy-storage-clear", { area }).then(
+ () => undefined
+ );
+ if (typeof callback === "function") {
+ promise.then(callback, callback);
+ return undefined;
+ }
+ return promise;
+ },
+});
+
+const storageChangeListeners = new Set();
+
+const bindOnChangedRelay = () => {
+ chrome.runtime.onMessage.addListener((msg) => {
+ if (msg && msg.type === "proxy-storage-onchanged") {
+ storageChangeListeners.forEach((fn) => {
+ try {
+ fn(msg.changes, msg.area);
+ } catch (err) {
+ console.warn("[ChromeShim] storage.onChanged listener error:", err);
+ }
+ });
+ }
+ });
+};
+
+export function installChromeShims() {
+ if (typeof chrome === "undefined") {
+ console.error("[ChromeShim] chrome global missing - cannot shim");
+ return;
+ }
+
+ if (!chrome.storage) {
+ chrome.storage = {
+ local: makeStorageArea("local"),
+ session: makeStorageArea("session"),
+ sync: makeStorageArea("sync"),
+ managed: makeStorageArea("managed"),
+ onChanged: {
+ addListener: (fn) => storageChangeListeners.add(fn),
+ removeListener: (fn) => storageChangeListeners.delete(fn),
+ hasListener: (fn) => storageChangeListeners.has(fn),
+ },
+ };
+ bindOnChangedRelay();
+ console.log("[ChromeShim] chrome.storage installed");
+ }
+
+ if (!chrome.i18n || typeof chrome.i18n.getMessage !== "function") {
+ chrome.i18n = chrome.i18n || {};
+ chrome.i18n.getMessage = (key) => String(key || "");
+ console.log("[ChromeShim] chrome.i18n.getMessage shimmed");
+ }
+
+ if (!chrome.tabs) {
+ chrome.tabs = {
+ get(tabId, callback) {
+ const promise = sendProxy("proxy-tabs-get", { tabId }).then((resp) => {
+ if (resp && resp.ok) return resp.tab;
+ throw new Error(resp?.error || "Tab not found");
+ });
+ if (typeof callback === "function") {
+ promise.then(callback, () => callback(undefined));
+ return undefined;
+ }
+ return promise;
+ },
+ };
+ console.log("[ChromeShim] chrome.tabs installed");
+ }
+}
diff --git a/src/pages/RecorderOffscreen/index.html b/src/pages/OffscreenRecorder/index.html
similarity index 74%
rename from src/pages/RecorderOffscreen/index.html
rename to src/pages/OffscreenRecorder/index.html
index b7e52f8..70433c7 100644
--- a/src/pages/RecorderOffscreen/index.html
+++ b/src/pages/OffscreenRecorder/index.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
- <title></title>
+ <title>Screenity - Offscreen Recorder</title>
</head>
<body>
diff --git a/src/pages/OffscreenRecorder/index.jsx b/src/pages/OffscreenRecorder/index.jsx
new file mode 100644
index 0000000..5543231
--- /dev/null
+++ b/src/pages/OffscreenRecorder/index.jsx
@@ -0,0 +1,62 @@
+// Install chrome.* shims before any recorder module loads.
+import { installChromeShims } from "./chromeShim";
+installChromeShims();
+
+const relayErrorToSW = (source, payload) => {
+ chrome.runtime
+ .sendMessage({ type: "offscreen-diag", source, payload })
+ .catch(() => {});
+};
+
+window.addEventListener("error", (e) => {
+ relayErrorToSW("window.error", {
+ message: e.message,
+ filename: e.filename,
+ lineno: e.lineno,
+ colno: e.colno,
+ stack: e.error?.stack || null,
+ });
+});
+
+window.addEventListener("unhandledrejection", (e) => {
+ relayErrorToSW("unhandledrejection", {
+ reason: String(e.reason),
+ stack: e.reason?.stack || null,
+ });
+});
+
+chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
+ if (msg?.type === "resume-pending-uploads" && Array.isArray(msg.journals)) {
+ (async () => {
+ try {
+ const { resumeAllJournals } = await import("./resumeJournal");
+ const results = await resumeAllJournals(msg.journals);
+ sendResponse({ ok: true, results });
+ } catch (err) {
+ console.error("[OffscreenRecorder] resume failed:", err);
+ sendResponse({ ok: false, error: err?.message || String(err) });
+ }
+ })();
+ return true;
+ }
+ return false;
+});
+
+import React from "react";
+import { createRoot } from "react-dom/client";
+import OffscreenRecorder from "./OffscreenRecorder";
+
+const container = window.document.querySelector("#app-container");
+
+if (container) {
+ try {
+ const root = createRoot(container);
+ root.render(<OffscreenRecorder />);
+ } catch (err) {
+ console.error("[Screenity][OffscreenRecorder] render error:", err);
+ }
+}
+
+if (module.hot) {
+ module.hot.accept();
+}
diff --git a/src/pages/OffscreenRecorder/resumeJournal.js b/src/pages/OffscreenRecorder/resumeJournal.js
new file mode 100644
index 0000000..904cc29
--- /dev/null
+++ b/src/pages/OffscreenRecorder/resumeJournal.js
@@ -0,0 +1,180 @@
+import localforage from "localforage";
+import BunnyTusUploader from "../CloudRecorder/bunnyTusUploader";
+
+localforage.config({
+ driver: localforage.INDEXEDDB,
+ name: "screenity",
+ version: 1,
+});
+
+const JOURNAL_KEY_PREFIX = "uploadJournal-";
+
+const chunkStoreForTrack = (trackType) => {
+ if (trackType === "camera") {
+ return localforage.createInstance({ name: "cameraChunks" });
+ }
+ return localforage.createInstance({ name: "chunks" });
+};
+
+const loadChunksSorted = async (store) => {
+ const items = [];
+ await store.iterate((value, key) => {
+ if (!key || !key.startsWith("chunk_")) return;
+ if (!value || !value.chunk) return;
+ items.push({
+ index:
+ typeof value.index === "number"
+ ? value.index
+ : parseInt(key.replace("chunk_", ""), 10) || 0,
+ chunk: value.chunk,
+ timestamp: value.timestamp || 0,
+ });
+ });
+ items.sort((a, b) => a.index - b.index);
+ return items;
+};
+
+const bumpResumeAttempts = async (journal) => {
+ const key = `${JOURNAL_KEY_PREFIX}${journal.mediaId}`;
+ try {
+ const existing = await chrome.storage.local.get([key]);
+ const current = existing?.[key] || journal;
+ const updated = {
+ ...current,
+ resumeAttempts: (current.resumeAttempts || 0) + 1,
+ lastResumeAttemptAt: Date.now(),
+ };
+ await chrome.storage.local.set({ [key]: updated });
+ } catch {}
+};
+
+const emit = (type, payload) => {
+ try {
+ chrome.runtime
+ .sendMessage({
+ type: "offscreen-diag",
+ source: type,
+ payload,
+ })
+ .catch(() => {});
+ } catch {}
+};
+
+export const resumeOneJournal = async (journal) => {
+ const trackType = journal.trackType || journal.type || "screen";
+ const mediaId = journal.mediaId;
+ const projectId = journal.projectId;
+ const sceneId = journal.sceneId;
+
+ if (!mediaId || !projectId) {
+ return { ok: false, error: "journal-missing-ids" };
+ }
+
+ emit("upload_resume_started", {
+ mediaId,
+ projectId,
+ sceneId,
+ trackType,
+ offset: journal.offset,
+ totalBytes: journal.totalBytes,
+ resumeAttempts: journal.resumeAttempts || 0,
+ });
+
+ const store = chunkStoreForTrack(trackType);
+ const chunks = await loadChunksSorted(store);
+
+ if (!chunks.length) {
+ // Orphan journal - chunks cleared or never written. GC.
+ emit("upload_resume_chunks_missing", { mediaId, trackType });
+ try {
+ await chrome.storage.local.remove([
+ `${JOURNAL_KEY_PREFIX}${mediaId}`,
+ ]);
+ } catch {}
+ return { ok: false, error: "chunks-missing" };
+ }
+
+ // Sparse chunks (purge ran mid-recording) would corrupt the replay - abandon and let server state stand.
+ const isContiguous = chunks.every((c, i) => c.index === i);
+ if (!isContiguous) {
+ emit("upload_resume_sparse_chunks", {
+ mediaId,
+ trackType,
+ firstIndex: chunks[0]?.index,
+ lastIndex: chunks[chunks.length - 1]?.index,
+ count: chunks.length,
+ });
+ try {
+ await chrome.storage.local.remove([
+ `${JOURNAL_KEY_PREFIX}${mediaId}`,
+ ]);
+ } catch {}
+ return { ok: false, error: "sparse-chunks" };
+ }
+
+ const uploader = new BunnyTusUploader({ trackType });
+
+ try {
+ await uploader.initialize(projectId, {
+ title: journal.title || `Recording ${mediaId}`,
+ type: trackType,
+ width: journal.width || null,
+ height: journal.height || null,
+ sceneId: sceneId || null,
+ sessionId: journal.sessionId || null,
+ reuse: { videoId: journal.videoId, mediaId },
+ });
+ } catch (err) {
+ console.warn("[resumeJournal] initialize failed:", err);
+ await bumpResumeAttempts(journal);
+ emit("upload_resume_failed", {
+ mediaId,
+ phase: "initialize",
+ error: err?.message || String(err),
+ });
+ return { ok: false, error: `initialize: ${err?.message || err}` };
+ }
+
+ try {
+ for (const { chunk } of chunks) {
+ if (uploader.status === "aborted" || uploader.status === "error") break;
+ await uploader.write(chunk);
+ }
+ await uploader.finalize();
+ emit("upload_resume_completed", {
+ mediaId,
+ projectId,
+ sceneId,
+ trackType,
+ finalizedBytes: uploader.totalBytes,
+ });
+ return { ok: true };
+ } catch (err) {
+ console.warn("[resumeJournal] upload/finalize failed:", err);
+ await bumpResumeAttempts(journal);
+ emit("upload_resume_failed", {
+ mediaId,
+ phase: "upload",
+ error: err?.message || String(err),
+ resumeAttempts: (journal.resumeAttempts || 0) + 1,
+ });
+ return { ok: false, error: `upload: ${err?.message || err}` };
+ }
+};
+
+export const resumeAllJournals = async (journals) => {
+ const results = [];
+ for (const journal of journals) {
+ try {
+ const r = await resumeOneJournal(journal);
+ results.push({ mediaId: journal.mediaId, ...r });
+ } catch (err) {
+ results.push({
+ mediaId: journal.mediaId,
+ ok: false,
+ error: err?.message || String(err),
+ });
+ }
+ }
+ return results;
+};
diff --git a/src/pages/Recorder/Recorder.jsx b/src/pages/Recorder/Recorder.jsx
index 8faa6fb..a4e2246 100644
--- a/src/pages/Recorder/Recorder.jsx
+++ b/src/pages/Recorder/Recorder.jsx
@@ -6,6 +6,7 @@ import { sendRecordingError, sendStopRecording } from "./messaging";
import { getBitrates, getResolutionForQuality } from "./recorderConfig";
import { WebCodecsRecorder } from "./webcodecs/WebCodecsRecorder";
import { getUserMediaWithFallback } from "../utils/mediaDeviceFallback";
+import { IS_OFFSCREEN_HOST } from "../utils/recordingHost";
import {
debugRecordingEvent,
resetRecordingDebugSession,
@@ -218,6 +219,8 @@ const Recorder = () => {
// Start gate: defers startRecording() until the stream is ready.
const startRequested = useRef(false);
const startRequestedAt = useRef(null);
+ // Null on start-gate timeout → SW→tab handoff failed (distinct error code).
+ const streamingDataReceivedAt = useRef(null);
// Timeout if the stream never arrives
const startGateTimeout = useRef(null);
const START_GATE_TIMEOUT_MS = 8000; // max wait for stream after start request
@@ -266,6 +269,8 @@ const Recorder = () => {
// Keep-alive mechanism to prevent Chrome from freezing this background tab
const keepAliveAudioCtx = useRef(null);
const keepAliveOscillator = useRef(null);
+ const keepAliveLockAbort = useRef(null);
+ const keepAliveMediaSessionActive = useRef(false);
const recordingStartTime = useRef(null);
const sessionHeartbeat = useRef(null);
@@ -324,34 +329,67 @@ const Recorder = () => {
* which would stop our recording. Playing silent audio keeps the tab active.
*/
const startTabKeepAlive = () => {
- try {
- if (keepAliveAudioCtx.current) return; // Already running
-
- const ctx = new (window.AudioContext || window.webkitAudioContext)();
- keepAliveAudioCtx.current = ctx;
-
- // Create a silent oscillator (inaudible frequency at zero gain)
- const oscillator = ctx.createOscillator();
- const gainNode = ctx.createGain();
-
- oscillator.frequency.value = 0; // DC signal (no audible tone)
- gainNode.gain.value = 0; // Completely silent
-
- oscillator.connect(gainNode);
- gainNode.connect(ctx.destination);
- oscillator.start();
+ if (IS_OFFSCREEN_HOST) return;
- keepAliveOscillator.current = oscillator;
+ // Multi-layered keepalive - Chrome's freeze heuristic stacks several signals.
+ try {
+ if (!keepAliveAudioCtx.current) {
+ const ctx = new (window.AudioContext || window.webkitAudioContext)();
+ keepAliveAudioCtx.current = ctx;
+ const oscillator = ctx.createOscillator();
+ const gainNode = ctx.createGain();
+ oscillator.type = "sine";
+ oscillator.frequency.value = 20000;
+ gainNode.gain.value = 0.0001;
+ oscillator.connect(gainNode);
+ gainNode.connect(ctx.destination);
+ oscillator.start();
+ keepAliveOscillator.current = oscillator;
+ }
+ } catch (err) {
+ debugWarn("keepalive: audio layer failed:", err);
+ }
- // Request Chrome not to discard this tab
- chrome.runtime
- .sendMessage({ type: "set-tab-auto-discardable", discardable: false })
- .catch(() => {});
+ try {
+ if (typeof navigator.locks !== "undefined" && !keepAliveLockAbort.current) {
+ const ac = new AbortController();
+ keepAliveLockAbort.current = ac;
+ navigator.locks
+ .request(
+ "screenity-recorder-keepalive",
+ { mode: "exclusive", signal: ac.signal },
+ () => new Promise(() => {}),
+ )
+ .catch(() => {});
+ }
+ } catch (err) {
+ debugWarn("keepalive: lock layer failed:", err);
+ }
- debug("Tab keep-alive started");
+ try {
+ if (navigator.mediaSession && !keepAliveMediaSessionActive.current) {
+ navigator.mediaSession.metadata = new window.MediaMetadata({
+ title: "Screenity recording",
+ artist: "Screenity",
+ });
+ navigator.mediaSession.playbackState = "playing";
+ try {
+ navigator.mediaSession.setActionHandler("pause", () => {});
+ } catch {}
+ keepAliveMediaSessionActive.current = true;
+ }
} catch (err) {
- debugWarn("Failed to start tab keep-alive:", err);
+ debugWarn("keepalive: mediaSession layer failed:", err);
}
+
+ chrome.runtime
+ .sendMessage({ type: "set-tab-auto-discardable", discardable: false })
+ .catch(() => {});
+ chrome.runtime
+ .sendMessage({ type: "start-recorder-keepalive-alarm" })
+ .catch(() => {});
+
+ debug("Tab keep-alive started");
};
/**
@@ -360,14 +398,27 @@ const Recorder = () => {
const stopTabKeepAlive = () => {
try {
if (keepAliveOscillator.current) {
- keepAliveOscillator.current.stop();
- keepAliveOscillator.current.disconnect();
+ try { keepAliveOscillator.current.stop(); } catch {}
+ try { keepAliveOscillator.current.disconnect(); } catch {}
keepAliveOscillator.current = null;
}
if (keepAliveAudioCtx.current) {
- keepAliveAudioCtx.current.close();
+ try { keepAliveAudioCtx.current.close(); } catch {}
keepAliveAudioCtx.current = null;
}
+ if (keepAliveLockAbort.current) {
+ try { keepAliveLockAbort.current.abort(); } catch {}
+ keepAliveLockAbort.current = null;
+ }
+ if (keepAliveMediaSessionActive.current && navigator.mediaSession) {
+ try { navigator.mediaSession.playbackState = "none"; } catch {}
+ try { navigator.mediaSession.metadata = null; } catch {}
+ try { navigator.mediaSession.setActionHandler("pause", null); } catch {}
+ keepAliveMediaSessionActive.current = false;
+ }
+ chrome.runtime
+ .sendMessage({ type: "stop-recorder-keepalive-alarm" })
+ .catch(() => {});
// Allow Chrome to discard this tab again if needed
chrome.runtime
@@ -505,6 +556,9 @@ const Recorder = () => {
chunk: e.data,
timestamp: ts,
});
+ const heartbeatUpdate = { lastChunkAt: Date.now() };
+ if (i === 0) heartbeatUpdate.firstChunkAt = Date.now();
+ chrome.storage.local.set(heartbeatUpdate).catch(() => {});
if (DEBUG_RECORDER) {
debug("Saved chunk to IndexedDB", {
key: `chunk_${i}`,
@@ -667,15 +721,24 @@ const Recorder = () => {
tryStartIfReady();
return;
}
- const diagInfo = buildStreamDiagInfo("start-gate-timeout");
+ const diagInfo = {
+ ...buildStreamDiagInfo("start-gate-timeout"),
+ streamingDataReceivedAt: streamingDataReceivedAt.current,
+ };
console.warn("[Screenity:startRec] stream never became ready", diagInfo);
slLog("start-gate-timeout", diagInfo);
chrome.storage.local.set({ lastStreamCheckFail: diagInfo });
// Full reset so no gate state leaks into a future session.
resetGateState();
- sendRecordingError(
- "Recording not ready: screen stream is missing (tab may have been suspended)",
- );
+ if (streamingDataReceivedAt.current == null) {
+ sendRecordingError(
+ "Recording not ready: streaming-data never arrived from background (SW→tab handoff failed)",
+ );
+ } else {
+ sendRecordingError(
+ "Recording not ready: screen stream is missing (tab may have been suspended)",
+ );
+ }
}, START_GATE_TIMEOUT_MS);
}
@@ -690,6 +753,7 @@ const Recorder = () => {
function resetGateState() {
startRequested.current = false;
startRequestedAt.current = null;
+ streamingDataReceivedAt.current = null;
isStarting.current = false;
clearStartGateTimeout();
}
@@ -1694,6 +1758,16 @@ const Recorder = () => {
resetGateState();
uiClosing.current = true;
isRecording.current = false;
+ recordingGeneration.current += 1;
+
+ // Detach callbacks so a late ondataavailable can't re-arm lastChunkAt after watchdog reset.
+ if (recorder.current instanceof MediaRecorder) {
+ try {
+ recorder.current.ondataavailable = null;
+ recorder.current.onstop = null;
+ recorder.current.onerror = null;
+ } catch {}
+ }
// Clean up keep-alive and session tracking
stopTabKeepAlive();
@@ -2285,28 +2359,68 @@ const Recorder = () => {
debug("desktopCapture.chooseDesktopMedia", {
captureTypes,
tabPreferred: tabPreferred.current,
+ host: IS_OFFSCREEN_HOST ? "offscreen" : "tab",
});
slLog("chooseDesktopMedia-show");
- chrome.desktopCapture.chooseDesktopMedia(
- captureTypes,
- null,
- (streamId, options) => {
- slLog("chooseDesktopMedia-picked", { hasStreamId: !!streamId });
- debug("chooseDesktopMedia callback", { streamId, options });
- if (
- streamId === undefined ||
- streamId === null ||
- streamId === ""
- ) {
- debugWarn("User cancelled the desktop capture modal");
- resetGateState();
- sendRecordingError("User cancelled the modal", true);
- return;
- } else {
- startStream(data, streamId, options, permissions, permissions2);
- }
- },
- );
+ if (IS_OFFSCREEN_HOST) {
+ const response = await chrome.runtime
+ .sendMessage({
+ type: "offscreen-request-stream",
+ mode: "screen",
+ // "tab" excluded - offscreen can't consume tab-scoped streamIds as desktop sources.
+ sources: captureTypes.filter((t) => t !== "tab"),
+ })
+ .catch((err) => ({ ok: false, error: String(err) }));
+ slLog("chooseDesktopMedia-picked", {
+ hasStreamId: !!response?.streamId,
+ via: "sw",
+ });
+ if (!response?.ok || !response.streamId) {
+ const cancelled =
+ response?.source === "cancelled" || !response?.streamId;
+ debugWarn(
+ cancelled
+ ? "User cancelled the desktop capture modal"
+ : `Stream acquisition failed: ${response?.error || "unknown"}`
+ );
+ resetGateState();
+ sendRecordingError(
+ cancelled
+ ? "User cancelled the modal"
+ : response?.error || "Stream acquisition failed",
+ cancelled
+ );
+ return;
+ }
+ startStream(
+ data,
+ response.streamId,
+ { canRequestAudioTrack: response.canRequestAudioTrack },
+ permissions,
+ permissions2
+ );
+ } else {
+ chrome.desktopCapture.chooseDesktopMedia(
+ captureTypes,
+ null,
+ (streamId, options) => {
+ slLog("chooseDesktopMedia-picked", { hasStreamId: !!streamId });
+ debug("chooseDesktopMedia callback", { streamId, options });
+ if (
+ streamId === undefined ||
+ streamId === null ||
+ streamId === ""
+ ) {
+ debugWarn("User cancelled the desktop capture modal");
+ resetGateState();
+ sendRecordingError("User cancelled the modal", true);
+ return;
+ } else {
+ startStream(data, streamId, options, permissions, permissions2);
+ }
+ },
+ );
+ }
} else {
const tabStreamId = await waitForTabStreamId();
debug("Streaming with pre-resolved tabID", tabStreamId);
@@ -2333,9 +2447,26 @@ const Recorder = () => {
const getStreamID = async (id) => {
debug("getStreamID()", id);
- const streamId = await chrome.tabCapture.getMediaStreamId({
- targetTabId: id,
- });
+ let streamId;
+ if (IS_OFFSCREEN_HOST) {
+ // chrome.tabCapture is not callable from offscreen - delegate to SW.
+ const response = await chrome.runtime
+ .sendMessage({
+ type: "offscreen-request-stream",
+ mode: "tab",
+ targetTabId: id,
+ })
+ .catch((err) => ({ ok: false, error: String(err) }));
+ if (!response?.ok || !response.streamId) {
+ debug("Offscreen tab stream acquisition failed", response);
+ return;
+ }
+ streamId = response.streamId;
+ } else {
+ streamId = await chrome.tabCapture.getMediaStreamId({
+ targetTabId: id,
+ });
+ }
debug("Resolved tabCapture streamId", streamId);
tabID.current = streamId;
};
@@ -2380,6 +2511,8 @@ const Recorder = () => {
e.returnValue = "";
};
+ if (IS_OFFSCREEN_HOST) return undefined;
+
window.addEventListener("beforeunload", handleClose);
return () => {
debug("Removing beforeunload handler");
@@ -2408,6 +2541,7 @@ const Recorder = () => {
chrome.runtime.sendMessage({ type: "get-streaming-data" });
} else if (request.type === "streaming-data") {
slLog("msg-streaming-data");
+ streamingDataReceivedAt.current = Date.now();
startStreaming(JSON.parse(request.data));
} else if (request.type === "start-recording-tab") {
slLog("msg-start-recording-tab", {
@@ -2444,6 +2578,22 @@ const Recorder = () => {
stopRecording();
sendResponse?.({ ok: true });
return true;
+ } else if (request.type === "offscreen-shutdown") {
+ const timeoutMs = Number(request.timeoutMs) || 20000;
+ (async () => {
+ try {
+ if (isRecording.current) stopRecording();
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ } catch (err) {
+ console.warn("[Recorder] offscreen-shutdown error", err);
+ } finally {
+ chrome.runtime
+ .sendMessage({ type: "offscreen-shutdown-complete" })
+ .catch(() => {});
+ }
+ })();
+ sendResponse?.({ ok: true, accepted: true });
+ return true;
} else if (request.type === "set-mic-active-tab") {
setMic(request);
} else if (request.type === "set-audio-output-volume") {
diff --git a/src/pages/RecorderOffscreen/RecorderOffscreen.jsx b/src/pages/RecorderOffscreen/RecorderOffscreen.jsx
deleted file mode 100644
index 01f0c5c..0000000
--- a/src/pages/RecorderOffscreen/RecorderOffscreen.jsx
+++ /dev/null
@@ -1,993 +0,0 @@
-import React, { useEffect, useState, useRef, useCallback } from "react";
-import localforage from "localforage";
-import { getUserMediaWithFallback } from "../utils/mediaDeviceFallback";
-
-localforage.config({
- driver: localforage.INDEXEDDB,
- name: "screenity",
- version: 1,
-});
-
-// Get chunks store
-const chunksStore = localforage.createInstance({
- name: "chunks",
-});
-
-const RecorderOffscreen = () => {
- const isRestarting = useRef(false);
- const isFinishing = useRef(false);
- const sentLast = useRef(false);
- const lastSize = useRef(0);
- const index = useRef(0);
- const lastTimecode = useRef(0);
- const hasChunks = useRef(false);
- const pausedStateRef = useRef(false);
-
- const [started, setStarted] = useState(false);
-
- // Main stream (recording)
- const liveStream = useRef(null);
-
- // Helper streams
- const helperVideoStream = useRef(null);
- const helperAudioStream = useRef(null);
-
- // Audio controls, with refs to persist across renders
- const aCtx = useRef(null);
- const destination = useRef(null);
- const audioInputSource = useRef(null);
- const audioOutputSource = useRef(null);
- const audioInputGain = useRef(null);
- const audioOutputGain = useRef(null);
-
- const recorder = useRef(null);
-
- const isTab = useRef(false);
- const tabID = useRef(null);
- const quality = useRef("1080p");
- const fps = useRef(30);
- const backupRef = useRef(false);
-
- const pending = useRef([]);
- const draining = useRef(false);
- const lowStorageAbort = useRef(false);
- const savedCount = useRef(0);
-
- const lastEstimateAt = useRef(0);
- const ESTIMATE_INTERVAL_MS = 5000;
- const MIN_HEADROOM = 25 * 1024 * 1024;
- const MAX_PENDING_BYTES = 8 * 1024 * 1024;
- const pendingBytes = useRef(0);
-
- const setRecordingTimingState = async (nextState) => {
- try {
- await chrome.storage.local.set(nextState);
- } catch (err) {
- console.warn(
- "[RecorderOffscreen] Failed to persist recording timing state",
- err,
- );
- }
- };
-
- async function canFitChunk(byteLength) {
- const now = performance.now();
- if (now - lastEstimateAt.current < ESTIMATE_INTERVAL_MS) {
- return !lowStorageAbort.current;
- }
- lastEstimateAt.current = now;
-
- try {
- const { usage = 0, quota = 0 } = await navigator.storage.estimate();
- const remaining = quota - usage;
- return remaining > MIN_HEADROOM + (byteLength || 0);
- } catch {
- return !lowStorageAbort.current;
- }
- }
-
- async function saveChunk(e, i) {
- const ts = e.timecode ?? 0;
-
- if (
- savedCount.current > 0 &&
- ts === lastTimecode.current &&
- e.data.size === lastSize.current
- ) {
- return false;
- }
-
- if (!(await canFitChunk(e.data.size))) {
- if (!lowStorageAbort.current) {
- chrome.runtime.sendMessage({
- type: "show-toast",
- message: chrome.i18n.getMessage("toastStorageCritical"),
- timeout: 8000,
- });
- }
- lowStorageAbort.current = true;
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- memoryError: true,
- });
- chrome.runtime.sendMessage({ type: "stop-recording-tab" });
- return false;
- }
-
- try {
- await chunksStore.setItem(`chunk_${i}`, {
- index: i,
- chunk: e.data,
- timestamp: ts,
- });
- } catch (err) {
- if (!lowStorageAbort.current) {
- chrome.runtime.sendMessage({
- type: "show-toast",
- message: chrome.i18n.getMessage("toastStorageCritical"),
- timeout: 8000,
- });
- }
- lowStorageAbort.current = true;
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- memoryError: true,
- });
- chrome.runtime.sendMessage({ type: "stop-recording-tab" });
- return false;
- }
-
- lastTimecode.current = ts;
- lastSize.current = e.data.size;
- savedCount.current += 1;
-
- if (backupRef.current) {
- chrome.runtime.sendMessage({ type: "write-file", index: i });
- }
- return true;
- }
-
- async function drainQueue() {
- if (draining.current) return;
- draining.current = true;
-
- try {
- while (pending.current.length) {
- if (lowStorageAbort.current) {
- pending.current.length = 0;
- pendingBytes.current = 0;
- break;
- }
-
- const e = pending.current.shift();
- pendingBytes.current -= e.data.size;
-
- if (!(await canFitChunk(e.data.size))) {
- if (!lowStorageAbort.current) {
- chrome.runtime.sendMessage({
- type: "show-toast",
- message: chrome.i18n.getMessage("toastStorageCritical"),
- timeout: 8000,
- });
- }
- lowStorageAbort.current = true;
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- memoryError: true,
- });
- chrome.runtime.sendMessage({ type: "stop-recording-tab" });
- pending.current.length = 0;
- pendingBytes.current = 0;
- break;
- }
-
- const i = index.current;
- const saved = await saveChunk(e, i);
- if (saved) index.current = i + 1;
- }
- } finally {
- draining.current = false;
- }
- }
-
- async function waitForDrain() {
- while (draining.current || pending.current.length) {
- await new Promise((r) => setTimeout(r, 10));
- }
- }
- // End FLAG
-
- async function startRecording() {
- // Check that a recording is not already in progress
- if (recorder.current !== null) return;
- navigator.storage.persist();
- // Check if the stream actually has data in it
- if (helperVideoStream.current.getVideoTracks().length === 0) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: "No video tracks available",
- });
- return;
- }
-
- chunksStore.clear();
-
- lastTimecode.current = 0;
- lastSize.current = 0;
- hasChunks.current = false;
- savedCount.current = 0;
- pending.current = [];
- draining.current = false;
- lowStorageAbort.current = false;
- pendingBytes.current = 0;
-
- try {
- const qualityValue = quality.current;
-
- let audioBitsPerSecond = 128000;
- let videoBitsPerSecond = 5000000;
-
- if (qualityValue === "4k") {
- audioBitsPerSecond = 192000;
- videoBitsPerSecond = 40000000;
- } else if (qualityValue === "1080p") {
- audioBitsPerSecond = 192000;
- videoBitsPerSecond = 8000000;
- } else if (qualityValue === "720p") {
- audioBitsPerSecond = 128000;
- videoBitsPerSecond = 5000000;
- } else if (qualityValue === "480p") {
- audioBitsPerSecond = 96000;
- videoBitsPerSecond = 2500000;
- } else if (qualityValue === "360p") {
- audioBitsPerSecond = 96000;
- videoBitsPerSecond = 1000000;
- } else if (qualityValue === "240p") {
- audioBitsPerSecond = 64000;
- videoBitsPerSecond = 500000;
- }
-
- // List all mimeTypes
- const mimeTypes = [
- "video/webm;codecs=avc1",
- "video/webm;codecs=vp8,opus",
- "video/webm;codecs=vp9,opus",
- "video/webm;codecs=vp9",
- "video/webm;codecs=vp8",
- "video/webm;codecs=h264",
- "video/webm",
- ];
-
- // Check if the browser supports any of the mimeTypes, make sure to select the first one that is supported from the list
- let mimeType = mimeTypes.find((mimeType) =>
- MediaRecorder.isTypeSupported(mimeType),
- );
-
- // If no mimeType is supported, throw an error
- if (!mimeType) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: "No supported mimeTypes available",
- });
- return;
- }
-
- recorder.current = new MediaRecorder(liveStream.current, {
- mimeType: mimeType,
- audioBitsPerSecond: audioBitsPerSecond,
- videoBitsPerSecond: videoBitsPerSecond,
- });
- } catch (err) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: String(err),
- });
- return;
- }
-
- isRestarting.current = false;
- index.current = 0;
-
- try {
- recorder.current.start(1000);
- } catch (err) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: String(err),
- });
- return;
- }
-
- const recordingStartTime = Date.now();
- await setRecordingTimingState({
- recording: true,
- paused: false,
- recordingStartTime,
- pausedAt: null,
- totalPausedMs: 0,
- });
- pausedStateRef.current = false;
- chrome.storage.local.set({
- recording: true,
- restarting: false,
- });
-
- recorder.current.onerror = (ev) => {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "mediarecorder",
- why: String(ev?.error || "unknown"),
- });
- };
-
- recorder.current.onstop = async () => {
- if (isRestarting.current) return;
- await waitForDrain();
- if (!sentLast.current) {
- sentLast.current = true;
- isFinishing.current = false;
- chrome.runtime.sendMessage({ type: "video-ready" });
- }
- };
-
- recorder.current.ondataavailable = (e) => {
- if (!e || !e.data || !e.data.size) {
- if (recorder.current && recorder.current.state === "inactive") {
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- });
- chrome.runtime.sendMessage({ type: "stop-recording-tab" });
- }
- return;
- }
-
- if (lowStorageAbort.current) {
- return;
- }
-
- if (!hasChunks.current) {
- hasChunks.current = true;
- lastTimecode.current = e.timecode ?? 0;
- lastSize.current = e.data.size;
- }
-
- pending.current.push(e);
- pendingBytes.current += e.data.size;
- void drainQueue();
- };
-
- recorder.current.onpause = () => {
- lastTimecode.current = 0;
- lastSize.current = 0;
- };
-
- recorder.current.onresume = () => {
- lastTimecode.current = 0;
- lastSize.current = 0;
- };
-
- liveStream.current.getVideoTracks()[0].onended = () => {
- const track = liveStream.current?.getVideoTracks()[0];
- // Log detailed diagnostics for debugging
- const diagnosticInfo = {
- reason: "liveStream-video-track-ended-offscreen",
- savedChunks: savedCount.current,
- lastTimecode: lastTimecode.current,
- trackLabel: track?.label || null,
- trackReadyState: track?.readyState || null,
- };
- console.warn(
- "[RecorderOffscreen] liveStream video track ended",
- diagnosticInfo,
- );
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- lastTrackEndEvent: diagnosticInfo,
- });
- chrome.runtime.sendMessage({
- type: "stop-recording-tab",
- reason: "video-track-ended",
- });
- };
-
- helperVideoStream.current.getVideoTracks()[0].onended = () => {
- const track = helperVideoStream.current?.getVideoTracks()[0];
- // Log detailed diagnostics for debugging
- const diagnosticInfo = {
- reason: "helperVideoStream-video-track-ended-offscreen",
- savedChunks: savedCount.current,
- lastTimecode: lastTimecode.current,
- trackLabel: track?.label || null,
- trackReadyState: track?.readyState || null,
- };
- console.warn(
- "[RecorderOffscreen] helperVideoStream video track ended",
- diagnosticInfo,
- );
- chrome.storage.local.set({
- recording: false,
- restarting: false,
- tabRecordedID: null,
- lastTrackEndEvent: diagnosticInfo,
- });
- chrome.runtime.sendMessage({
- type: "stop-recording-tab",
- reason: "video-track-ended",
- });
- };
- }
-
- async function stopRecording() {
- isFinishing.current = true;
- await setRecordingTimingState({
- recording: false,
- paused: false,
- recordingStartTime: null,
- pausedAt: null,
- totalPausedMs: 0,
- });
- pausedStateRef.current = false;
- if (recorder.current) {
- try {
- recorder.current.requestData();
- } catch {}
- recorder.current.stop();
- await waitForDrain();
- recorder.current = null;
- }
-
- if (liveStream.current) {
- liveStream.current.getTracks().forEach((t) => t.stop());
- liveStream.current = null;
- }
-
- if (helperVideoStream.current) {
- helperVideoStream.current.getTracks().forEach((t) => t.stop());
- helperVideoStream.current = null;
- }
-
- if (helperAudioStream.current) {
- helperAudioStream.current.getTracks().forEach((t) => t.stop());
- helperAudioStream.current = null;
- }
- }
-
- const dismissRecording = async () => {
- await setRecordingTimingState({
- recording: false,
- paused: false,
- recordingStartTime: null,
- pausedAt: null,
- totalPausedMs: 0,
- });
- pausedStateRef.current = false;
- isRestarting.current = true;
- if (recorder.current !== null) {
- recorder.current.stop();
- recorder.current = null;
- }
- window.close();
- };
-
- const restartRecording = async () => {
- if (isRestarting.current) return false;
- isRestarting.current = true;
- pausedStateRef.current = false;
- if (recorder.current !== null && recorder.current.state !== "inactive") {
- await new Promise((resolve) => {
- let done = false;
- const finish = () => {
- if (done) return;
- done = true;
- clearTimeout(timeoutId);
- resolve();
- };
- const timeoutId = setTimeout(finish, 1600);
- try {
- recorder.current.addEventListener("stop", finish, { once: true });
- } catch {}
- try {
- recorder.current.stop();
- } catch {
- finish();
- }
- });
- }
- recorder.current = null;
- pending.current = [];
- pendingBytes.current = 0;
- await chunksStore.clear();
- await setRecordingTimingState({
- recording: false,
- paused: false,
- recordingStartTime: null,
- pausedAt: null,
- totalPausedMs: 0,
- });
- isRestarting.current = false;
- return true;
- };
-
- async function startAudioStream(id) {
- const useExact = id && id !== "none";
- const audioStreamOptions = {
- mimeType: "video/webm;codecs=vp8,opus",
- audio: useExact
- ? {
- deviceId: {
- exact: id,
- },
- }
- : true,
- };
-
- const { defaultAudioInputLabel, audioinput } =
- await chrome.storage.local.get(["defaultAudioInputLabel", "audioinput"]);
- const desiredLabel =
- defaultAudioInputLabel ||
- audioinput?.find((device) => device.deviceId === id)?.label ||
- "";
-
- const result = await getUserMediaWithFallback({
- constraints: audioStreamOptions,
- fallbacks:
- useExact && desiredLabel
- ? [
- {
- kind: "audioinput",
- desiredDeviceId: id,
- desiredLabel,
- onResolved: (resolvedId) => {
- chrome.storage.local.set({
- defaultAudioInput: resolvedId,
- defaultAudioInputLabel: desiredLabel,
- });
- },
- },
- ]
- : [],
- })
- .then((stream) => {
- return stream;
- })
- .catch((err) => {
- // Try again without the device ID
- const audioStreamOptions = {
- mimeType: "video/webm;codecs=vp8,opus",
- audio: true,
- };
-
- return navigator.mediaDevices
- .getUserMedia(audioStreamOptions)
- .then((stream) => {
- return stream;
- })
- .catch((err) => {
- return null;
- });
- });
-
- return result;
- }
- // Set audio input volume
- function setAudioInputVolume(volume) {
- audioInputGain.current.gain.value = volume;
- }
-
- // Set audio output volume
- function setAudioOutputVolume(volume) {
- audioOutputGain.current.gain.value = volume;
- }
-
- async function startStreaming(data) {
- // Get quality value
- const qualityValue = quality.current;
-
- let width = 1920;
- let height = 1080;
-
- if (qualityValue === "4k") {
- width = 4096;
- height = 2160;
- } else if (qualityValue === "1080p") {
- width = 1920;
- height = 1080;
- } else if (qualityValue === "720p") {
- width = 1280;
- height = 720;
- } else if (qualityValue === "480p") {
- width = 854;
- height = 480;
- } else if (qualityValue === "360p") {
- width = 640;
- height = 360;
- } else if (qualityValue === "240p") {
- width = 426;
- height = 240;
- }
-
- const fpsValue = fps.current;
- let fpsVal = parseInt(fpsValue);
-
- // Check if fps is a number
- if (isNaN(fpsVal)) {
- fpsVal = 30;
- }
- // Check user permissions for camera and microphone individually
- const permissions = await navigator.permissions.query({
- name: "camera",
- });
- const permissions2 = await navigator.permissions.query({
- name: "microphone",
- });
-
- try {
- let userConstraints = {
- audio: {
- deviceId: data.defaultAudioInput,
- },
- video: {
- deviceId: data.defaultVideoInput,
- width: {
- ideal: width,
- },
- height: {
- ideal: height,
- },
- frameRate: {
- ideal: fpsVal,
- },
- },
- };
- if (permissions.state === "denied") {
- userConstraints.video = false;
- }
- if (permissions2.state === "denied") {
- userConstraints.audio = false;
- }
-
- let userStream;
-
- if (
- permissions.state != "denied" &&
- permissions2.state != "denied" &&
- data.recordingType === "camera"
- ) {
- const {
- defaultAudioInputLabel,
- defaultVideoInputLabel,
- audioinput,
- videoinput,
- } = await chrome.storage.local.get([
- "defaultAudioInputLabel",
- "defaultVideoInputLabel",
- "audioinput",
- "videoinput",
- ]);
- const desiredAudioLabel =
- defaultAudioInputLabel ||
- audioinput?.find(
- (device) => device.deviceId === data.defaultAudioInput,
- )?.label ||
- "";
- const desiredVideoLabel =
- defaultVideoInputLabel ||
- videoinput?.find(
- (device) => device.deviceId === data.defaultVideoInput,
- )?.label ||
- "";
-
- const hasAudioDevice =
- data.defaultAudioInput && data.defaultAudioInput !== "none";
- const hasVideoDevice =
- data.defaultVideoInput && data.defaultVideoInput !== "none";
- const cameraConstraints = {
- ...userConstraints,
- audio:
- userConstraints.audio && hasAudioDevice
- ? {
- ...userConstraints.audio,
- deviceId: { exact: data.defaultAudioInput },
- }
- : userConstraints.audio,
- video:
- userConstraints.video && hasVideoDevice
- ? {
- ...userConstraints.video,
- deviceId: { exact: data.defaultVideoInput },
- }
- : userConstraints.video,
- };
-
- userStream = await getUserMediaWithFallback({
- constraints: cameraConstraints,
- fallbacks: [
- hasVideoDevice && desiredVideoLabel
- ? {
- kind: "videoinput",
- desiredDeviceId: data.defaultVideoInput,
- desiredLabel: desiredVideoLabel,
- onResolved: (resolvedId) => {
- chrome.storage.local.set({
- defaultVideoInput: resolvedId,
- defaultVideoInputLabel: desiredVideoLabel,
- });
- },
- }
- : null,
- hasAudioDevice && desiredAudioLabel
- ? {
- kind: "audioinput",
- desiredDeviceId: data.defaultAudioInput,
- desiredLabel: desiredAudioLabel,
- onResolved: (resolvedId) => {
- chrome.storage.local.set({
- defaultAudioInput: resolvedId,
- defaultAudioInputLabel: desiredAudioLabel,
- });
- },
- }
- : null,
- ].filter(Boolean),
- });
- }
-
- // Create an audio context, destination, and stream
- aCtx.current = new AudioContext();
- destination.current = aCtx.current.createMediaStreamDestination();
- liveStream.current = new MediaStream();
-
- const micstream = await startAudioStream(data.defaultAudioInput);
-
- // Save the helper streams
- if (data.recordingType === "camera") {
- helperVideoStream.current = userStream;
- } else {
- let stream;
- if (isTab.current === true) {
- stream = await navigator.mediaDevices.getUserMedia({
- audio: {
- mandatory: {
- chromeMediaSource: "tab",
- chromeMediaSourceId: tabID.current,
- },
- },
- video: {
- mandatory: {
- chromeMediaSource: "tab",
- chromeMediaSourceId: tabID.current,
- maxWidth: width,
- maxHeight: height,
- maxFrameRate: fpsVal,
- },
- },
- });
-
- // Check if the stream actually has data in it
- if (stream.getVideoTracks().length === 0) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: "No video tracks available",
- });
- return;
- }
- } else {
- stream = await navigator.mediaDevices.getDisplayMedia({
- audio: data.systemAudio,
- video: {
- frameRate: fpsVal,
- displaySurface: "monitor",
- },
- selfBrowserSurface: "exclude",
- systemAudio: "include",
- });
-
- // Check if the stream actually has data in it
- if (stream.getVideoTracks().length === 0) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "stream-error",
- why: "No video tracks available",
- });
- return;
- }
- }
- helperVideoStream.current = stream;
-
- const surface = stream.getVideoTracks()[0].getSettings().displaySurface;
- chrome.runtime.sendMessage({ type: "set-surface", surface: surface });
- }
- helperAudioStream.current = micstream;
-
- // Check if micstream has an audio track
- if (
- helperAudioStream.current != null &&
- helperAudioStream.current.getAudioTracks().length > 0
- ) {
- audioInputGain.current = aCtx.current.createGain();
- audioInputSource.current = aCtx.current.createMediaStreamSource(
- helperAudioStream.current,
- );
- audioInputSource.current
- .connect(audioInputGain.current)
- .connect(destination.current);
- } else {
- // No microphone available
- }
-
- if (helperAudioStream.current != null && !data.micActive) {
- setAudioInputVolume(0);
- }
-
- // Check if stream has an audio track
- if (helperVideoStream.current.getAudioTracks().length > 0) {
- audioOutputGain.current = aCtx.current.createGain();
- audioOutputSource.current = aCtx.current.createMediaStreamSource(
- helperVideoStream.current,
- );
- audioOutputSource.current
- .connect(audioOutputGain.current)
- .connect(destination.current);
- } else {
- // No system audio available
- }
-
- // Add the tracks to the stream
- liveStream.current.addTrack(
- helperVideoStream.current.getVideoTracks()[0],
- );
- if (
- (helperAudioStream.current != null &&
- helperAudioStream.current.getAudioTracks().length > 0) ||
- helperVideoStream.current.getAudioTracks().length > 0
- ) {
- liveStream.current.addTrack(
- destination.current.stream.getAudioTracks()[0],
- );
- }
-
- // Send message to go back to the previously active tab
- setStarted(true);
- chrome.runtime.sendMessage({ type: "reset-active-tab" });
- } catch (err) {
- chrome.runtime.sendMessage({
- type: "recording-error",
- error: "cancel-modal",
- why: String(err),
- });
- }
- }
-
- const setMic = async (result) => {
- if (helperAudioStream.current != null) {
- if (result.active) {
- setAudioInputVolume(1);
- } else {
- setAudioInputVolume(0);
- }
- } else {
- // No microphone available
- }
- };
-
- const onMessage = useCallback(
- (request, sender, sendResponse) => {
- if (request.type === "loaded") {
- backupRef.current = request.backup;
- isTab.current = request.isTab;
- quality.current = request.quality;
- fps.current = request.fps;
- if (request.isTab) {
- tabID.current = request.tabID;
- }
- chrome.runtime.sendMessage({ type: "get-streaming-data" });
- }
- if (request.type === "streaming-data") {
- startStreaming(JSON.parse(request.data));
- } else if (request.type === "start-recording-tab") {
- startRecording();
- } else if (request.type === "restart-recording-tab") {
- Promise.resolve(restartRecording())
- .then((restarted) => {
- if (!restarted) {
- sendResponse?.({ ok: false, error: "restart-teardown-failed" });
- return;
- }
- sendResponse?.({ ok: true, restarted: true });
- })
- .catch((error) => {
- sendResponse?.({
- ok: false,
- error: error?.message || String(error),
- });
- });
- return true;
- } else if (request.type === "stop-recording-tab") {
- stopRecording();
- sendResponse?.({ ok: true });
- return true;
- } else if (request.type === "set-mic-active-tab") {
- setMic(request);
- } else if (request.type === "set-audio-output-volume") {
- setAudioOutputVolume(request.volume);
- } else if (request.type === "pause-recording-tab") {
- if (!recorder.current) return;
- if (pausedStateRef.current) return;
- const now = Date.now();
- recorder.current.pause();
- pausedStateRef.current = true;
- void setRecordingTimingState({
- paused: true,
- pausedAt: now,
- });
- } else if (request.type === "resume-recording-tab") {
- if (!recorder.current) return;
- if (!pausedStateRef.current) return;
- recorder.current.resume();
- const now = Date.now();
- pausedStateRef.current = false;
- void (async () => {
- try {
- const { pausedAt, totalPausedMs } = await chrome.storage.local.get([
- "pausedAt",
- "totalPausedMs",
- ]);
- const additional = pausedAt ? Math.max(0, now - pausedAt) : 0;
- await setRecordingTimingState({
- paused: false,
- pausedAt: null,
- totalPausedMs: (totalPausedMs || 0) + additional,
- });
- } catch (err) {
- console.warn(
- "[RecorderOffscreen] Failed to update resume timing state",
- err,
- );
- }
- })();
- } else if (request.type === "play-beep-offscreen") {
- // Reuse this offscreen document for beep sounds so Chrome doesn't
- // need to create a second offscreen document (only one is allowed).
- try {
- const audioUrl = chrome.runtime.getURL("assets/sounds/beep.mp3");
- const audio = new Audio(audioUrl);
- audio.volume = 0.5;
- audio.play().catch(() => {});
- } catch {}
- sendResponse?.({ ok: true });
- return true;
- } else if (request.type === "dismiss-recording") {
- dismissRecording();
- }
- },
- [recorder.current],
- );
-
- useEffect(() => {
- // Event listener (extension messaging)
- chrome.runtime.onMessage.addListener(onMessage);
-
- return () => {
- chrome.runtime.onMessage.removeListener(onMessage);
- };
- }, []);
-
- return <div className="wrap"></div>;
-};
-
-export default RecorderOffscreen;
diff --git a/src/pages/RecorderOffscreen/index.jsx b/src/pages/RecorderOffscreen/index.jsx
deleted file mode 100644
index a00463c..0000000
--- a/src/pages/RecorderOffscreen/index.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from "react";
-import { createRoot } from "react-dom/client";
-import RecorderOffscreen from "./RecorderOffscreen";
-
-// Find the container to render into
-const container = window.document.querySelector("#app-container");
-
-if (container) {
- const root = createRoot(container);
- root.render(<RecorderOffscreen />);
-}
-
-// Hot Module Replacement
-if (module.hot) {
- module.hot.accept();
-}
diff --git a/src/pages/Sandbox/Sandbox.jsx b/src/pages/Sandbox/Sandbox.jsx
index ce3abab..79a5273 100644
--- a/src/pages/Sandbox/Sandbox.jsx
+++ b/src/pages/Sandbox/Sandbox.jsx
@@ -11,6 +11,7 @@ import HelpButton from "./components/player/HelpButton";
// Context
import { ContentStateContext } from "./context/ContentState"; // Import the ContentState context
+import { diagForward } from "../utils/diagForward";
const Sandbox = () => {
const [contentState, setContentState] = useContext(ContentStateContext); // Access the ContentState context
@@ -181,6 +182,13 @@ const Sandbox = () => {
<div
className="button-stop"
onClick={() => {
+ diagForward("sandbox-user-clicked-help", {
+ chunkCount: contentState?.chunkCount ?? 0,
+ chunkIndex: contentState?.chunkIndex ?? 0,
+ hasRawBlob: Boolean(contentState?.rawBlob),
+ hasBlob: Boolean(contentState?.blob),
+ ready: Boolean(contentState?.ready),
+ });
contentState.openModal(
chrome.i18n.getMessage("havingIssuesModalTitle"),
chrome.i18n.getMessage("havingIssuesModalDescription"),
diff --git a/src/pages/Sandbox/context/ContentState.jsx b/src/pages/Sandbox/context/ContentState.jsx
index b6335d5..6b93a68 100644
--- a/src/pages/Sandbox/context/ContentState.jsx
+++ b/src/pages/Sandbox/context/ContentState.jsx
@@ -21,6 +21,7 @@ import {
debugRecordingEventWithSession,
isRecordingDebugEnabled,
} from "../../utils/recordingDebug";
+import { diagForward } from "../../utils/diagForward";
localforage.config({
driver: localforage.INDEXEDDB,
@@ -73,6 +74,49 @@ const ContentState = (props) => {
} catch {}
}, []);
+ useEffect(() => {
+ diagMountAtRef.current = Date.now();
+ try {
+ chrome.tabs.getCurrent((tab) => {
+ diagForward("sandbox-open", {
+ tabId: tab?.id ?? null,
+ timestamp: diagMountAtRef.current,
+ });
+ });
+ } catch {
+ diagForward("sandbox-open", {
+ tabId: null,
+ timestamp: diagMountAtRef.current,
+ });
+ }
+
+ const MAX_HEARTBEATS = 6;
+ const HEARTBEAT_MS = 30000;
+ const interval = setInterval(() => {
+ const s = contentStateRef.current;
+ if (s?.ready) {
+ clearInterval(interval);
+ return;
+ }
+ if (diagHeartbeatCountRef.current >= MAX_HEARTBEATS) {
+ clearInterval(interval);
+ return;
+ }
+ diagHeartbeatCountRef.current += 1;
+ diagForward("sandbox-stuck-heartbeat", {
+ chunkCount: s?.chunkCount ?? 0,
+ chunkIndex: s?.chunkIndex ?? 0,
+ hasRawBlob: Boolean(s?.rawBlob),
+ hasBlob: Boolean(s?.blob),
+ secondsSinceMount: Math.round(
+ (Date.now() - (diagMountAtRef.current || Date.now())) / 1000,
+ ),
+ });
+ }, HEARTBEAT_MS);
+
+ return () => clearInterval(interval);
+ }, []);
+
useEffect(() => {
if (!DEBUG_RECORDER && !isRecordingDebugEnabled()) return;
window.__screenityExportRecordingDebug = async () => {
@@ -162,6 +206,9 @@ const ContentState = (props) => {
const pseudoProgressTimerRef = useRef(null);
const pseudoProgressStartRef = useRef(null);
const pseudoProgressStartAtRef = useRef(null);
+ const diagMountAtRef = useRef(null);
+ const diagMakeVideoAtRef = useRef(null);
+ const diagHeartbeatCountRef = useRef(0);
const setContentState = useCallback((updater) => {
_setContentState((prev) => {
@@ -585,9 +632,36 @@ const ContentState = (props) => {
}
}
- let blob = withBlob
- ? withBlob
- : new Blob(videoChunks.current, { type: inferredType });
+ const reconstructStartedAt = Date.now();
+ const totalBytesIn = withBlob
+ ? withBlob.size || 0
+ : videoChunks.current.reduce((s, c) => s + (c?.length || 0), 0);
+ diagForward("sandbox-reconstruct-start", {
+ chunkIndex: contentStateRef.current?.chunkIndex ?? 0,
+ chunkCount: contentStateRef.current?.chunkCount ?? 0,
+ totalBytes: totalBytesIn,
+ withBlob: Boolean(withBlob),
+ });
+
+ let blob;
+ try {
+ blob = withBlob
+ ? withBlob
+ : new Blob(videoChunks.current, { type: inferredType });
+ } catch (err) {
+ diagForward("sandbox-reconstruct-error", {
+ error: String(err?.message || err).slice(0, 200),
+ phase: "blob",
+ chunkIndex: contentStateRef.current?.chunkIndex ?? 0,
+ totalBytes: totalBytesIn,
+ });
+ throw err;
+ }
+ diagForward("sandbox-reconstruct-done", {
+ blobBytes: blob?.size ?? 0,
+ elapsedMs: Date.now() - reconstructStartedAt,
+ type: blob?.type || null,
+ });
if (blob.type === "video/mp4") {
if (DEBUG_RECORDER)
@@ -647,7 +721,24 @@ const ContentState = (props) => {
URL.revokeObjectURL(video.src);
};
- video.src = URL.createObjectURL(blob);
+ video.onerror = () => {
+ diagForward("sandbox-reconstruct-error", {
+ error: "video-element-error",
+ phase: "video-load",
+ chunkIndex: contentStateRef.current?.chunkIndex ?? 0,
+ totalBytes: blob?.size ?? 0,
+ });
+ };
+ try {
+ video.src = URL.createObjectURL(blob);
+ } catch (err) {
+ diagForward("sandbox-reconstruct-error", {
+ error: String(err?.message || err).slice(0, 200),
+ phase: "url",
+ chunkIndex: contentStateRef.current?.chunkIndex ?? 0,
+ totalBytes: blob?.size ?? 0,
+ });
+ }
chrome.runtime.sendMessage({ type: "recording-complete" });
chrome.runtime.sendMessage({ type: "diag-editor-ready", path: "mp4-fast" }).catch(() => {});
@@ -982,6 +1073,17 @@ const ContentState = (props) => {
webm: Boolean(s?.webm),
ready: s?.ready,
});
+ diagForward("sandbox-safety-fired", {
+ chunkCount: s?.chunkCount ?? 0,
+ chunkIndex: s?.chunkIndex ?? 0,
+ hasRawBlob: Boolean(s?.rawBlob),
+ hasBlob: Boolean(s?.blob),
+ hasWebm: Boolean(s?.webm),
+ ready: Boolean(s?.ready),
+ elapsedSinceMakeVideoMs: diagMakeVideoAtRef.current
+ ? Date.now() - diagMakeVideoAtRef.current
+ : null,
+ });
if (s?.ready) return; // Fix already completed, nothing to do
const complete = s?.chunkCount > 0 && s?.chunkIndex >= s?.chunkCount;
@@ -1062,6 +1164,9 @@ const ContentState = (props) => {
console.debug("[Screenity][Sandbox] received chunk-count", {
count: message.count,
});
+ diagForward("sandbox-chunk-count-received", {
+ count: message?.count ?? 0,
+ });
setContentState((prevState) => ({
...prevState,
chunkCount: message.count,
@@ -1078,6 +1183,8 @@ const ContentState = (props) => {
} else if (message.type === "make-video-tab") {
if (DEBUG_POSTSTOP)
console.debug("[Screenity][Sandbox] received make-video-tab");
+ diagMakeVideoAtRef.current = Date.now();
+ diagForward("sandbox-make-video-tab", null);
makeVideoTab(sendResponse, message);
return true;
diff --git a/src/pages/utils/diagForward.js b/src/pages/utils/diagForward.js
new file mode 100644
index 0000000..4a3117d
--- /dev/null
+++ b/src/pages/utils/diagForward.js
@@ -0,0 +1,14 @@
+/**
+ * Forward a diag event to the service worker from non-SW contexts
+ * (sandboxed editor pages, offscreen documents). Fire-and-forget; the
+ * SW handler filters out non-whitelisted event names.
+ */
+export const diagForward = (event, data) => {
+ try {
+ chrome.runtime
+ .sendMessage({ type: "diag-forward", event, data: data ?? null })
+ .catch(() => {});
+ } catch {
+ // sendMessage can throw synchronously if the runtime is gone
+ }
+};
diff --git a/src/pages/utils/errorCodes.js b/src/pages/utils/errorCodes.js
index 1d3be2d..998e31e 100644
--- a/src/pages/utils/errorCodes.js
+++ b/src/pages/utils/errorCodes.js
@@ -14,6 +14,7 @@ export const REC_START_TAB = "REC_START_TAB"; // tab capture or message routing
export const REC_START_TIMEOUT = "REC_START_TIMEOUT"; // start flow timed out
export const REC_START_CANCEL = "REC_START_CANCEL"; // user cancelled the capture picker
export const REC_START_NOT_READY = "REC_START_NOT_READY"; // recorder tab not ready (likely discarded)
+export const REC_START_NO_STREAM_MSG = "REC_START_NO_STREAM_MSG"; // start requested but streaming-data message never arrived from SW
// -- Recording Runtime --
export const REC_RUN_STREAM_END = "REC_RUN_STREAM_END"; // stream ended unexpectedly
@@ -135,6 +136,10 @@ export const classifyError = (errorStr = "", errorType = "") => {
return REC_START_PERM;
}
+ if (lower.includes("streaming-data never arrived")) {
+ return REC_START_NO_STREAM_MSG;
+ }
+
// Recorder not ready (stream ref missing, likely tab discarded during countdown)
if (lower.includes("recording not ready") || lower.includes("screen stream is missing")) {
return REC_START_NOT_READY;
diff --git a/src/pages/utils/recordingHost.js b/src/pages/utils/recordingHost.js
new file mode 100644
index 0000000..da50ee0
--- /dev/null
+++ b/src/pages/utils/recordingHost.js
@@ -0,0 +1,25 @@
+// Synchronous URL-based host detection for the recorder document ('tab' | 'iframe' | 'offscreen').
+
+const hasWindow = typeof window !== "undefined";
+
+const urlParams = new URLSearchParams(hasWindow ? window.location.search : "");
+const isInjectedIframe = urlParams.has("injected");
+
+const isOffscreenUrl =
+ hasWindow && window.location.pathname.endsWith("/offscreenrecorder.html");
+
+const isIframeUrl =
+ hasWindow &&
+ (isInjectedIframe ||
+ (window.top !== window.self &&
+ !document.referrer.startsWith("chrome-extension://")));
+
+export const RECORDING_HOST = isOffscreenUrl
+ ? "offscreen"
+ : isIframeUrl
+ ? "iframe"
+ : "tab";
+
+export const IS_OFFSCREEN_HOST = RECORDING_HOST === "offscreen";
+export const IS_IFRAME_HOST = RECORDING_HOST === "iframe";
+export const IS_TAB_HOST = RECORDING_HOST === "tab";
diff --git a/utils/build.js b/utils/build.js
index 56d3def..a522037 100755
--- a/utils/build.js
+++ b/utils/build.js
@@ -1,6 +1,6 @@
-// Do this as the first thing so that any code reading it knows the right env.
-process.env.BABEL_ENV = "production";
-process.env.NODE_ENV = "production";
+const nodeEnv = process.env.NODE_ENV || "production";
+process.env.BABEL_ENV = nodeEnv;
+process.env.NODE_ENV = nodeEnv;
process.env.ASSET_PATH = "/";
var webpack = require("webpack"),
@@ -9,7 +9,7 @@ var webpack = require("webpack"),
//delete config.chromeExtensionBoilerplate;
delete config.custom;
-config.mode = "production";
+config.mode = nodeEnv;
webpack(config, (err, stats) => {
if (err) {
diff --git a/webpack.config.js b/webpack.config.js
index cc56e8c..9b6b522 100755
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -10,7 +10,13 @@ const isDev = env.NODE_ENV === "development";
const ASSET_PATH = process.env.ASSET_PATH || "/";
-require("dotenv").config();
+if (process.env.SCREENITY_SKIP_ENV) {
+ // open-source release build, no dotenv
+} else if (isDev) {
+ require("dotenv").config({ path: ".env.local" });
+} else {
+ require("dotenv").config({ path: ".env.production" });
+}
// Entry points for the different pages
const entryPoints = {
@@ -24,11 +30,11 @@ const entryPoints = {
"CloudRecorder",
"index.jsx"
),
- recorderoffscreen: path.join(
+ offscreenrecorder: path.join(
__dirname,
"src",
"pages",
- "RecorderOffscreen",
+ "OffscreenRecorder",
"index.jsx"
),
audiooffscreen: path.join(
@@ -74,7 +80,7 @@ const htmlPlugins = Object.keys(entryPoints)
// Map entry names to folder names (for multi-word entries)
const folderNameMap = {
cloudrecorder: "CloudRecorder",
- recorderoffscreen: "RecorderOffscreen",
+ offscreenrecorder: "OffscreenRecorder",
audiooffscreen: "AudioOffscreen",
editorwebcodecs: "EditorWebCodecs",
editorviewer: "EditorViewer",
@@ -237,13 +243,22 @@ const config = {
to: path.join(__dirname, "build"),
force: true,
transform: (content) => {
- return Buffer.from(
- JSON.stringify({
- description: process.env.npm_package_description,
- version: process.env.npm_package_version,
- ...JSON.parse(content.toString()),
- })
- );
+ const manifest = {
+ description: process.env.npm_package_description,
+ version: process.env.npm_package_version,
+ ...JSON.parse(content.toString()),
+ };
+
+ // Strip dev-only origins from production builds.
+ if (!isDev && manifest.externally_connectable?.matches) {
+ manifest.externally_connectable.matches =
+ manifest.externally_connectable.matches.filter(
+ (m) =>
+ !m.includes("localhost") && !m.includes("127.0.0.1"),
+ );
+ }
+
+ return Buffer.from(JSON.stringify(manifest));
},
},
{