diff options
author | Minteck <contact@minteck.org> | 2023-02-13 20:09:08 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-13 20:09:08 +0100 |
commit | d99ce89ce4fb99292bd68b2df38af56d83e942d1 (patch) | |
tree | 9edba2882259d5e5819602b381c70054294c0faa /node_modules | |
parent | 82dd01f2a4f05853b5a71cc9d3d58ce341d09b01 (diff) | |
download | delta-kiosk-d99ce89ce4fb99292bd68b2df38af56d83e942d1.tar.gz delta-kiosk-d99ce89ce4fb99292bd68b2df38af56d83e942d1.tar.bz2 delta-kiosk-d99ce89ce4fb99292bd68b2df38af56d83e942d1.zip |
Updated 3 files and added 34 files (automated)
Diffstat (limited to 'node_modules')
29 files changed, 1850 insertions, 80 deletions
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index de47c95..8c3e845 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -28,7 +28,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.2.tgz", "integrity": "sha512-eFZVFoRXb3GFGd7Ak7W4+6jBl9wBtiZ4AaYOse97ej6mKj5tkyO0dUnUChs1IhJZtx1BENo4/p4WUTXpi6vT+g==", - "dev": true, "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", @@ -150,6 +149,14 @@ "node": ">= 10.0.0" } }, + "node_modules/@electron/remote": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@electron/remote/-/remote-2.0.9.tgz", + "integrity": "sha512-LR0W0ID6WAKHaSs0x5LX9aiG+5pFBNAJL6eQAJfGkCuZPUa6nZz+czZLdlTDETG45CgF/0raSvCtYOYUpr6c+A==", + "peerDependencies": { + "electron": ">= 13.0.0" + } + }, "node_modules/@electron/universal": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.3.4.tgz", @@ -230,7 +237,6 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, "engines": { "node": ">=10" }, @@ -242,7 +248,6 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dev": true, "dependencies": { "defer-to-connect": "^2.0.0" }, @@ -254,7 +259,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dev": true, "dependencies": { "@types/http-cache-semantics": "*", "@types/keyv": "^3.1.4", @@ -276,14 +280,12 @@ "node_modules/@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", - "dev": true + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, "node_modules/@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -298,14 +300,12 @@ "node_modules/@types/node": { "version": "16.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.12.tgz", - "integrity": "sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw==", - "dev": true + "integrity": "sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw==" }, "node_modules/@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -314,7 +314,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, "optional": true, "dependencies": { "@types/node": "*" @@ -374,7 +373,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", - "dev": true, "optional": true }, "node_modules/brace-expansion": { @@ -391,7 +389,6 @@ "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, "engines": { "node": "*" } @@ -412,7 +409,6 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true, "engines": { "node": ">=10.6.0" } @@ -421,7 +417,6 @@ "version": "7.0.2", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", - "dev": true, "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", @@ -445,7 +440,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, "dependencies": { "mimic-response": "^1.0.0" }, @@ -519,7 +513,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -536,7 +529,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, "dependencies": { "mimic-response": "^3.1.0" }, @@ -551,7 +543,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -563,7 +554,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, "engines": { "node": ">=10" } @@ -572,7 +562,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, "optional": true, "dependencies": { "has-property-descriptors": "^1.0.0", @@ -589,7 +578,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true, "optional": true }, "node_modules/dir-compare": { @@ -606,7 +594,6 @@ "version": "23.0.0", "resolved": "https://registry.npmjs.org/electron/-/electron-23.0.0.tgz", "integrity": "sha512-S6hVtTAjauMiiWP9sBVR5RpcUC464cNZ06I2EMUjeZBq+KooS6tLmNsfw0zLpAXDp1qosjlBP3v71NTZ3gd9iA==", - "dev": true, "hasInstallScript": true, "dependencies": { "@electron/get": "^2.0.0", @@ -710,7 +697,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "dependencies": { "once": "^1.4.0" } @@ -719,7 +705,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, "engines": { "node": ">=6" } @@ -737,14 +722,12 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true, "optional": true }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "optional": true, "engines": { "node": ">=10" @@ -757,7 +740,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -777,7 +759,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, "dependencies": { "pend": "~1.2.0" } @@ -851,7 +832,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -871,7 +851,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "devOptional": true }, "node_modules/galactus": { "version": "0.2.1", @@ -908,7 +888,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dev": true, "optional": true, "dependencies": { "function-bind": "^1.1.1", @@ -953,7 +932,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, "dependencies": { "pump": "^3.0.0" }, @@ -988,7 +966,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", - "dev": true, "optional": true, "dependencies": { "boolean": "^3.0.1", @@ -1006,7 +983,6 @@ "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, "optional": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1022,7 +998,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, "optional": true, "dependencies": { "define-properties": "^1.1.3" @@ -1038,7 +1013,6 @@ "version": "11.8.6", "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dev": true, "dependencies": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", @@ -1062,14 +1036,13 @@ "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, + "devOptional": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -1081,7 +1054,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, "optional": true, "dependencies": { "get-intrinsic": "^1.1.1" @@ -1094,7 +1066,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "optional": true, "engines": { "node": ">= 0.4" @@ -1112,14 +1083,12 @@ "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dev": true, "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.0.0" @@ -1210,21 +1179,18 @@ "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, "optional": true }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -1242,7 +1208,6 @@ "version": "4.5.2", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", - "dev": true, "dependencies": { "json-buffer": "3.0.1" } @@ -1285,7 +1250,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, "engines": { "node": ">=8" } @@ -1294,7 +1258,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "devOptional": true, "dependencies": { "yallist": "^4.0.0" }, @@ -1306,7 +1270,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, "optional": true, "dependencies": { "escape-string-regexp": "^4.0.0" @@ -1319,7 +1282,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, "engines": { "node": ">=4" } @@ -1348,8 +1310,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/normalize-package-data": { "version": "2.5.0", @@ -1376,7 +1337,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true, "engines": { "node": ">=10" }, @@ -1388,7 +1348,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "optional": true, "engines": { "node": ">= 0.4" @@ -1398,7 +1357,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -1407,7 +1365,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, "engines": { "node": ">=8" } @@ -1517,8 +1474,7 @@ "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" }, "node_modules/pify": { "version": "2.3.0", @@ -1546,7 +1502,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -1555,7 +1510,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -1565,7 +1519,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, "engines": { "node": ">=10" }, @@ -1632,14 +1585,12 @@ "node_modules/resolve-alpn": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dev": true, "dependencies": { "lowercase-keys": "^2.0.0" }, @@ -1651,7 +1602,6 @@ "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", - "dev": true, "optional": true, "dependencies": { "boolean": "^3.0.1", @@ -1669,7 +1619,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -1678,14 +1627,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, "optional": true }, "node_modules/serialize-error": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", - "dev": true, "optional": true, "dependencies": { "type-fest": "^0.13.1" @@ -1754,7 +1701,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true, "optional": true }, "node_modules/strip-bom": { @@ -1791,7 +1737,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, "dependencies": { "debug": "^4.1.0" }, @@ -1836,7 +1781,6 @@ "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, "optional": true, "engines": { "node": ">=10" @@ -1849,7 +1793,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -1882,8 +1825,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/xmlbuilder": { "version": "15.1.1", @@ -1898,7 +1840,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "devOptional": true }, "node_modules/yargs-parser": { "version": "21.1.1", @@ -1913,7 +1855,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" diff --git a/node_modules/@electron/remote/LICENSE b/node_modules/@electron/remote/LICENSE new file mode 100644 index 0000000..6e6d65e --- /dev/null +++ b/node_modules/@electron/remote/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2019-2022 Electron contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@electron/remote/README.md b/node_modules/@electron/remote/README.md new file mode 100644 index 0000000..0b9168b --- /dev/null +++ b/node_modules/@electron/remote/README.md @@ -0,0 +1,345 @@ +# @electron/remote + +`@electron/remote` is an [Electron](https://electronjs.org) module that bridges +JavaScript objects from the main process to the renderer process. This lets you +access main-process-only objects as if they were available in the renderer +process. + +> ⚠️ **Warning!** This module has [many subtle +> pitfalls][remote-considered-harmful]. There is almost always a better way to +> accomplish your task than using this module. For example, [`ipcRenderer.invoke`](https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args) can serve many common use cases. + +`@electron/remote` is a replacement for the built-in `remote` module in +Electron, which is deprecated and will eventually be removed. + +## Migrating from `remote` + +> **NOTE:** `@electron/remote` requires Electron 10 or higher. + +There are three things you need to do to migrate from the built-in `remote` +module to `@electron/remote`. + +First, you need to install it from NPM: + +```shell +$ npm install --save @electron/remote +``` + +Second, `@electron/remote/main` must be initialized in the main +process before it can be used from the renderer: + +```javascript +// in the main process: +require('@electron/remote/main').initialize() +``` + +Third, `require('electron').remote` in the renderer process must be +replaced with `require('@electron/remote')`. + +```javascript +// in the renderer process: + +// Before +const { BrowserWindow } = require('electron').remote + +// After +const { BrowserWindow } = require('@electron/remote') +``` + +**Note:** Since this is requiring a module through npm rather than a built-in +module, if you're using `remote` from a sandboxed process, you'll need to +configure your bundler appropriately to package the code of `@electron/remote` +in the preload script. Of course, [using `@electron/remote` makes the sandbox +much less effective][remote-considered-harmful]. + +**Note:** In `electron >= 14.0.0`, you must use the new `enable` API to enable the remote module for each desired `WebContents` separately: `require("@electron/remote/main").enable(webContents)`. + +In `electron < 14.0.0`, `@electron/remote` respects the `enableRemoteModule` WebPreferences +value. You must pass `{ webPreferences: { enableRemoteModule: true } }` to +the constructor of `BrowserWindow`s that should be granted permission to use +`@electron/remote`. + +# API Reference + +The `remote` module provides a simple way to do inter-process communication +(IPC) between the renderer process (web page) and the main process. + +In Electron, GUI-related modules (such as `dialog`, `menu` etc.) are only +available in the main process, not in the renderer process. In order to use them +from the renderer process, the `ipc` module is necessary to send inter-process +messages to the main process. With the `remote` module, you can invoke methods +of the main process object without explicitly sending inter-process messages, +similar to Java's [RMI][rmi]. An example of creating a browser window from a +renderer process: + +```javascript +const { BrowserWindow } = require('@electron/remote') +let win = new BrowserWindow({ width: 800, height: 600 }) +win.loadURL('https://github.com') +``` + +In order for this to work, you first need to initialize the main-process side +of the remote module: + +```javascript +// in the main process: +require('@electron/remote/main').initialize() +``` + +**Note:** In `electron >= 14.0.0` the remote module is disabled by default for any `WebContents` instance and is only enabled for specified `WebContents` after explicitly calling `require("@electron/remote/main").enable(webContents)`. + +In `electron < 14.0.0` the remote module can be disabled for security reasons in the following contexts: +- [`BrowserWindow`](browser-window.md) - by setting the `enableRemoteModule` option to `false`. +- [`<webview>`](webview-tag.md) - by setting the `enableremotemodule` attribute to `false`. + +## Remote Objects + +Each object (including functions) returned by the `remote` module represents an +object in the main process (we call it a remote object or remote function). +When you invoke methods of a remote object, call a remote function, or create +a new object with the remote constructor (function), you are actually sending +synchronous inter-process messages. + +In the example above, both `BrowserWindow` and `win` were remote objects and +`new BrowserWindow` didn't create a `BrowserWindow` object in the renderer +process. Instead, it created a `BrowserWindow` object in the main process and +returned the corresponding remote object in the renderer process, namely the +`win` object. + +**Note:** Only [enumerable properties][enumerable-properties] which are present +when the remote object is first referenced are accessible via remote. + +**Note:** Arrays and Buffers are copied over IPC when accessed via the `remote` +module. Modifying them in the renderer process does not modify them in the main +process and vice versa. + +## Lifetime of Remote Objects + +Electron makes sure that as long as the remote object in the renderer process +lives (in other words, has not been garbage collected), the corresponding object +in the main process will not be released. When the remote object has been +garbage collected, the corresponding object in the main process will be +dereferenced. + +If the remote object is leaked in the renderer process (e.g. stored in a map but +never freed), the corresponding object in the main process will also be leaked, +so you should be very careful not to leak remote objects. + +Primary value types like strings and numbers, however, are sent by copy. + +## Passing callbacks to the main process + +Code in the main process can accept callbacks from the renderer - for instance +the `remote` module - but you should be extremely careful when using this +feature. + +First, in order to avoid deadlocks, the callbacks passed to the main process +are called asynchronously. You should not expect the main process to +get the return value of the passed callbacks. + +For instance you can't use a function from the renderer process in an +`Array.map` called in the main process: + +```javascript +// main process mapNumbers.js +exports.withRendererCallback = (mapper) => { + return [1, 2, 3].map(mapper) +} + +exports.withLocalCallback = () => { + return [1, 2, 3].map(x => x + 1) +} +``` + +```javascript +// renderer process +const mapNumbers = require('@electron/remote').require('./mapNumbers') +const withRendererCb = mapNumbers.withRendererCallback(x => x + 1) +const withLocalCb = mapNumbers.withLocalCallback() + +console.log(withRendererCb, withLocalCb) +// [undefined, undefined, undefined], [2, 3, 4] +``` + +As you can see, the renderer callback's synchronous return value was not as +expected, and didn't match the return value of an identical callback that lives +in the main process. + +Second, the callbacks passed to the main process will persist until the +main process garbage-collects them. + +For example, the following code seems innocent at first glance. It installs a +callback for the `close` event on a remote object: + +```javascript +require('@electron/remote').getCurrentWindow().on('close', () => { + // window was closed... +}) +``` + +But remember the callback is referenced by the main process until you +explicitly uninstall it. If you do not, each time you reload your window the +callback will be installed again, leaking one callback for each restart. + +To make things worse, since the context of previously installed callbacks has +been released, exceptions will be raised in the main process when the `close` +event is emitted. + +To avoid this problem, ensure you clean up any references to renderer callbacks +passed to the main process. This involves cleaning up event handlers, or +ensuring the main process is explicitly told to dereference callbacks that came +from a renderer process that is exiting. + +## Accessing built-in modules in the main process + +The built-in modules in the main process are added as getters in the `remote` +module, so you can use them directly like the `electron` module. + +```javascript +const app = require('@electron/remote').app +console.log(app) +``` + +## Methods + +The `remote` module has the following methods: + +### `remote.require(module)` + +* `module` String + +Returns `any` - The object returned by `require(module)` in the main process. +Modules specified by their relative path will resolve relative to the entrypoint +of the main process. + +e.g. + +```sh +project/ +├── main +│ ├── foo.js +│ └── index.js +├── package.json +└── renderer + └── index.js +``` + +```js +// main process: main/index.js +const { app } = require('@electron/remote') +app.whenReady().then(() => { /* ... */ }) +``` + +```js +// some relative module: main/foo.js +module.exports = 'bar' +``` + +```js +// renderer process: renderer/index.js +const foo = require('@electron/remote').require('./foo') // bar +``` + +### `remote.getCurrentWindow()` + +Returns `BrowserWindow` - The window to which this web page belongs. + +**Note:** Do not use `removeAllListeners` on `BrowserWindow`. Use of this can +remove all [`blur`](https://developer.mozilla.org/en-US/docs/Web/Events/blur) +listeners, disable click events on touch bar buttons, and other unintended +consequences. + +### `remote.getCurrentWebContents()` + +Returns `WebContents` - The web contents of this web page. + +### `remote.getGlobal(name)` + +* `name` String + +Returns `any` - The global variable of `name` (e.g. `global[name]`) in the main +process. + +## Properties + +### `remote.process` _Readonly_ + +A `NodeJS.Process` object. The `process` object in the main process. This is the same as +`remote.getGlobal('process')` but is cached. + +# Overriding exposed objects + +Without filtering, `@electron/remote` will provide access to any JavaScript +object that any renderer requests. In order to control what can be accessed, +`@electron/remote` provides an opportunity to the app to return a custom result +for any of `getGlobal`, `require`, `getCurrentWindow`, `getCurrentWebContents`, +or any of the builtin module properties. + +The following events will be emitted first on the `app` Electron module, and +then on the specific `WebContents` which requested the object. When emitted on +the `app` module, the first parameter after the `Event` object will be the +`WebContents` which originated the request. If any handler calls +`preventDefault`, the request will be denied. If a `returnValue` parameter is +set on the result, then that value will be returned to the renderer instead of +the default. + +## Events + +### Event: 'remote-require' + +Returns: + +* `event` Event +* `moduleName` String + +Emitted when `remote.require()` is called in the renderer process of `webContents`. +Calling `event.preventDefault()` will prevent the module from being returned. +Custom value can be returned by setting `event.returnValue`. + +### Event: 'remote-get-global' + +Returns: + +* `event` Event +* `globalName` String + +Emitted when `remote.getGlobal()` is called in the renderer process of `webContents`. +Calling `event.preventDefault()` will prevent the global from being returned. +Custom value can be returned by setting `event.returnValue`. + +### Event: 'remote-get-builtin' + +Returns: + +* `event` Event +* `moduleName` String + +Emitted when `remote.getBuiltin()` is called in the renderer process of +`webContents`, including when a builtin module is accessed as a property (e.g. +`require("@electron/remote").BrowserWindow`). +Calling `event.preventDefault()` will prevent the module from being returned. +Custom value can be returned by setting `event.returnValue`. + +### Event: 'remote-get-current-window' + +Returns: + +* `event` Event + +Emitted when `remote.getCurrentWindow()` is called in the renderer process of `webContents`. +Calling `event.preventDefault()` will prevent the object from being returned. +Custom value can be returned by setting `event.returnValue`. + +### Event: 'remote-get-current-web-contents' + +Returns: + +* `event` Event + +Emitted when `remote.getCurrentWebContents()` is called in the renderer process of `webContents`. +Calling `event.preventDefault()` will prevent the object from being returned. +Custom value can be returned by setting `event.returnValue`. + +[rmi]: https://en.wikipedia.org/wiki/Java_remote_method_invocation +[enumerable-properties]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties +[remote-considered-harmful]: https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31
\ No newline at end of file diff --git a/node_modules/@electron/remote/dist/src/common/get-electron-binding.d.ts b/node_modules/@electron/remote/dist/src/common/get-electron-binding.d.ts new file mode 100644 index 0000000..b72cc7a --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/get-electron-binding.d.ts @@ -0,0 +1 @@ +export declare const getElectronBinding: typeof process.electronBinding; diff --git a/node_modules/@electron/remote/dist/src/common/get-electron-binding.js b/node_modules/@electron/remote/dist/src/common/get-electron-binding.js new file mode 100644 index 0000000..8c9ca47 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/get-electron-binding.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getElectronBinding = void 0; +const getElectronBinding = (name) => { + if (process._linkedBinding) { + return process._linkedBinding('electron_common_' + name); + } + else if (process.electronBinding) { + return process.electronBinding(name); + } + else { + return null; + } +}; +exports.getElectronBinding = getElectronBinding; diff --git a/node_modules/@electron/remote/dist/src/common/ipc-messages.d.ts b/node_modules/@electron/remote/dist/src/common/ipc-messages.d.ts new file mode 100644 index 0000000..6d8ec68 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/ipc-messages.d.ts @@ -0,0 +1,18 @@ +export declare const enum IPC_MESSAGES { + BROWSER_REQUIRE = "REMOTE_BROWSER_REQUIRE", + BROWSER_GET_BUILTIN = "REMOTE_BROWSER_GET_BUILTIN", + BROWSER_GET_GLOBAL = "REMOTE_BROWSER_GET_GLOBAL", + BROWSER_GET_CURRENT_WINDOW = "REMOTE_BROWSER_GET_CURRENT_WINDOW", + BROWSER_GET_CURRENT_WEB_CONTENTS = "REMOTE_BROWSER_GET_CURRENT_WEB_CONTENTS", + BROWSER_CONSTRUCTOR = "REMOTE_BROWSER_CONSTRUCTOR", + BROWSER_FUNCTION_CALL = "REMOTE_BROWSER_FUNCTION_CALL", + BROWSER_MEMBER_CONSTRUCTOR = "REMOTE_BROWSER_MEMBER_CONSTRUCTOR", + BROWSER_MEMBER_CALL = "REMOTE_BROWSER_MEMBER_CALL", + BROWSER_MEMBER_GET = "REMOTE_BROWSER_MEMBER_GET", + BROWSER_MEMBER_SET = "REMOTE_BROWSER_MEMBER_SET", + BROWSER_DEREFERENCE = "REMOTE_BROWSER_DEREFERENCE", + BROWSER_CONTEXT_RELEASE = "REMOTE_BROWSER_CONTEXT_RELEASE", + BROWSER_WRONG_CONTEXT_ERROR = "REMOTE_BROWSER_WRONG_CONTEXT_ERROR", + RENDERER_CALLBACK = "REMOTE_RENDERER_CALLBACK", + RENDERER_RELEASE_CALLBACK = "REMOTE_RENDERER_RELEASE_CALLBACK" +} diff --git a/node_modules/@electron/remote/dist/src/common/ipc-messages.js b/node_modules/@electron/remote/dist/src/common/ipc-messages.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/ipc-messages.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@electron/remote/dist/src/common/module-names.d.ts b/node_modules/@electron/remote/dist/src/common/module-names.d.ts new file mode 100644 index 0000000..d8a0d87 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/module-names.d.ts @@ -0,0 +1,2 @@ +export declare const commonModuleNames: string[]; +export declare const browserModuleNames: string[]; diff --git a/node_modules/@electron/remote/dist/src/common/module-names.js b/node_modules/@electron/remote/dist/src/common/module-names.js new file mode 100644 index 0000000..19b5abf --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/module-names.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.browserModuleNames = exports.commonModuleNames = void 0; +const get_electron_binding_1 = require("./get-electron-binding"); +exports.commonModuleNames = [ + 'clipboard', + 'nativeImage', + 'shell', +]; +exports.browserModuleNames = [ + 'app', + 'autoUpdater', + 'BaseWindow', + 'BrowserView', + 'BrowserWindow', + 'contentTracing', + 'crashReporter', + 'dialog', + 'globalShortcut', + 'ipcMain', + 'inAppPurchase', + 'Menu', + 'MenuItem', + 'nativeTheme', + 'net', + 'netLog', + 'MessageChannelMain', + 'Notification', + 'powerMonitor', + 'powerSaveBlocker', + 'protocol', + 'pushNotifications', + 'safeStorage', + 'screen', + 'session', + 'ShareMenu', + 'systemPreferences', + 'TopLevelWindow', + 'TouchBar', + 'Tray', + 'utilityProcess', + 'View', + 'webContents', + 'WebContentsView', + 'webFrameMain', +].concat(exports.commonModuleNames); +const features = get_electron_binding_1.getElectronBinding('features'); +if (!features || features.isDesktopCapturerEnabled()) { + exports.browserModuleNames.push('desktopCapturer'); +} +if (!features || features.isViewApiEnabled()) { + exports.browserModuleNames.push('ImageView'); +} diff --git a/node_modules/@electron/remote/dist/src/common/type-utils.d.ts b/node_modules/@electron/remote/dist/src/common/type-utils.d.ts new file mode 100644 index 0000000..9e67173 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/type-utils.d.ts @@ -0,0 +1,4 @@ +export declare function isPromise(val: any): any; +export declare function isSerializableObject(value: any): boolean; +export declare function serialize(value: any): any; +export declare function deserialize(value: any): any; diff --git a/node_modules/@electron/remote/dist/src/common/type-utils.js b/node_modules/@electron/remote/dist/src/common/type-utils.js new file mode 100644 index 0000000..9ab250d --- /dev/null +++ b/node_modules/@electron/remote/dist/src/common/type-utils.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserialize = exports.serialize = exports.isSerializableObject = exports.isPromise = void 0; +const electron_1 = require("electron"); +function isPromise(val) { + return (val && + val.then && + val.then instanceof Function && + val.constructor && + val.constructor.reject && + val.constructor.reject instanceof Function && + val.constructor.resolve && + val.constructor.resolve instanceof Function); +} +exports.isPromise = isPromise; +const serializableTypes = [ + Boolean, + Number, + String, + Date, + Error, + RegExp, + ArrayBuffer +]; +// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#Supported_types +function isSerializableObject(value) { + return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type); +} +exports.isSerializableObject = isSerializableObject; +const objectMap = function (source, mapper) { + const sourceEntries = Object.entries(source); + const targetEntries = sourceEntries.map(([key, val]) => [key, mapper(val)]); + return Object.fromEntries(targetEntries); +}; +function serializeNativeImage(image) { + const representations = []; + const scaleFactors = image.getScaleFactors(); + // Use Buffer when there's only one representation for better perf. + // This avoids compressing to/from PNG where it's not necessary to + // ensure uniqueness of dataURLs (since there's only one). + if (scaleFactors.length === 1) { + const scaleFactor = scaleFactors[0]; + const size = image.getSize(scaleFactor); + const buffer = image.toBitmap({ scaleFactor }); + representations.push({ scaleFactor, size, buffer }); + } + else { + // Construct from dataURLs to ensure that they are not lost in creation. + for (const scaleFactor of scaleFactors) { + const size = image.getSize(scaleFactor); + const dataURL = image.toDataURL({ scaleFactor }); + representations.push({ scaleFactor, size, dataURL }); + } + } + return { __ELECTRON_SERIALIZED_NativeImage__: true, representations }; +} +function deserializeNativeImage(value) { + const image = electron_1.nativeImage.createEmpty(); + // Use Buffer when there's only one representation for better perf. + // This avoids compressing to/from PNG where it's not necessary to + // ensure uniqueness of dataURLs (since there's only one). + if (value.representations.length === 1) { + const { buffer, size, scaleFactor } = value.representations[0]; + const { width, height } = size; + image.addRepresentation({ buffer, scaleFactor, width, height }); + } + else { + // Construct from dataURLs to ensure that they are not lost in creation. + for (const rep of value.representations) { + const { dataURL, size, scaleFactor } = rep; + const { width, height } = size; + image.addRepresentation({ dataURL, scaleFactor, width, height }); + } + } + return image; +} +function serialize(value) { + if (value && value.constructor && value.constructor.name === 'NativeImage') { + return serializeNativeImage(value); + } + if (Array.isArray(value)) { + return value.map(serialize); + } + else if (isSerializableObject(value)) { + return value; + } + else if (value instanceof Object) { + return objectMap(value, serialize); + } + else { + return value; + } +} +exports.serialize = serialize; +function deserialize(value) { + if (value && value.__ELECTRON_SERIALIZED_NativeImage__) { + return deserializeNativeImage(value); + } + else if (Array.isArray(value)) { + return value.map(deserialize); + } + else if (isSerializableObject(value)) { + return value; + } + else if (value instanceof Object) { + return objectMap(value, deserialize); + } + else { + return value; + } +} +exports.deserialize = deserialize; diff --git a/node_modules/@electron/remote/dist/src/main/index.d.ts b/node_modules/@electron/remote/dist/src/main/index.d.ts new file mode 100644 index 0000000..d06177a --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/index.d.ts @@ -0,0 +1 @@ +export { initialize, enable } from "./server"; diff --git a/node_modules/@electron/remote/dist/src/main/index.js b/node_modules/@electron/remote/dist/src/main/index.js new file mode 100644 index 0000000..d045311 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.enable = exports.initialize = void 0; +var server_1 = require("./server"); +Object.defineProperty(exports, "initialize", { enumerable: true, get: function () { return server_1.initialize; } }); +Object.defineProperty(exports, "enable", { enumerable: true, get: function () { return server_1.enable; } }); diff --git a/node_modules/@electron/remote/dist/src/main/objects-registry.d.ts b/node_modules/@electron/remote/dist/src/main/objects-registry.d.ts new file mode 100644 index 0000000..b4afabb --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/objects-registry.d.ts @@ -0,0 +1,16 @@ +import { WebContents } from 'electron'; +declare class ObjectsRegistry { + private nextId; + private storage; + private owners; + private electronIds; + add(webContents: WebContents, contextId: string, obj: any): number; + get(id: number): any; + remove(webContents: WebContents, contextId: string, id: number): void; + clear(webContents: WebContents, contextId: string): void; + private saveToStorage; + private dereference; + private registerDeleteListener; +} +declare const _default: ObjectsRegistry; +export default _default; diff --git a/node_modules/@electron/remote/dist/src/main/objects-registry.js b/node_modules/@electron/remote/dist/src/main/objects-registry.js new file mode 100644 index 0000000..3ff5bae --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/objects-registry.js @@ -0,0 +1,117 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const getOwnerKey = (webContents, contextId) => { + return `${webContents.id}-${contextId}`; +}; +class ObjectsRegistry { + constructor() { + this.nextId = 0; + // Stores all objects by ref-counting. + // (id) => {object, count} + this.storage = {}; + // Stores the IDs + refCounts of objects referenced by WebContents. + // (ownerKey) => { id: refCount } + this.owners = {}; + this.electronIds = new WeakMap(); + } + // Register a new object and return its assigned ID. If the object is already + // registered then the already assigned ID would be returned. + add(webContents, contextId, obj) { + // Get or assign an ID to the object. + const id = this.saveToStorage(obj); + // Add object to the set of referenced objects. + const ownerKey = getOwnerKey(webContents, contextId); + let owner = this.owners[ownerKey]; + if (!owner) { + owner = this.owners[ownerKey] = new Map(); + this.registerDeleteListener(webContents, contextId); + } + if (!owner.has(id)) { + owner.set(id, 0); + // Increase reference count if not referenced before. + this.storage[id].count++; + } + owner.set(id, owner.get(id) + 1); + return id; + } + // Get an object according to its ID. + get(id) { + const pointer = this.storage[id]; + if (pointer != null) + return pointer.object; + } + // Dereference an object according to its ID. + // Note that an object may be double-freed (cleared when page is reloaded, and + // then garbage collected in old page). + remove(webContents, contextId, id) { + const ownerKey = getOwnerKey(webContents, contextId); + const owner = this.owners[ownerKey]; + if (owner && owner.has(id)) { + const newRefCount = owner.get(id) - 1; + // Only completely remove if the number of references GCed in the + // renderer is the same as the number of references we sent them + if (newRefCount <= 0) { + // Remove the reference in owner. + owner.delete(id); + // Dereference from the storage. + this.dereference(id); + } + else { + owner.set(id, newRefCount); + } + } + } + // Clear all references to objects refrenced by the WebContents. + clear(webContents, contextId) { + const ownerKey = getOwnerKey(webContents, contextId); + const owner = this.owners[ownerKey]; + if (!owner) + return; + for (const id of owner.keys()) + this.dereference(id); + delete this.owners[ownerKey]; + } + // Saves the object into storage and assigns an ID for it. + saveToStorage(object) { + let id = this.electronIds.get(object); + if (!id) { + id = ++this.nextId; + this.storage[id] = { + count: 0, + object: object + }; + this.electronIds.set(object, id); + } + return id; + } + // Dereference the object from store. + dereference(id) { + const pointer = this.storage[id]; + if (pointer == null) { + return; + } + pointer.count -= 1; + if (pointer.count === 0) { + this.electronIds.delete(pointer.object); + delete this.storage[id]; + } + } + // Clear the storage when renderer process is destroyed. + registerDeleteListener(webContents, contextId) { + // contextId => ${processHostId}-${contextCount} + const processHostId = contextId.split('-')[0]; + const listener = (_, deletedProcessHostId) => { + if (deletedProcessHostId && + deletedProcessHostId.toString() === processHostId) { + webContents.removeListener('render-view-deleted', listener); + this.clear(webContents, contextId); + } + }; + // Note that the "render-view-deleted" event may not be emitted on time when + // the renderer process get destroyed because of navigation, we rely on the + // renderer process to send "ELECTRON_BROWSER_CONTEXT_RELEASE" message to + // guard this situation. + webContents.on('render-view-deleted', listener); + } +} +exports.default = new ObjectsRegistry(); diff --git a/node_modules/@electron/remote/dist/src/main/server.d.ts b/node_modules/@electron/remote/dist/src/main/server.d.ts new file mode 100644 index 0000000..30c9ab0 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/server.d.ts @@ -0,0 +1,4 @@ +import { WebContents } from 'electron'; +export declare const isRemoteModuleEnabled: (contents: WebContents) => boolean | undefined; +export declare function enable(contents: WebContents): void; +export declare function initialize(): void; diff --git a/node_modules/@electron/remote/dist/src/main/server.js b/node_modules/@electron/remote/dist/src/main/server.js new file mode 100644 index 0000000..d4c535a --- /dev/null +++ b/node_modules/@electron/remote/dist/src/main/server.js @@ -0,0 +1,498 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initialize = exports.enable = exports.isRemoteModuleEnabled = void 0; +const events_1 = require("events"); +const objects_registry_1 = __importDefault(require("./objects-registry")); +const type_utils_1 = require("../common/type-utils"); +const electron_1 = require("electron"); +const get_electron_binding_1 = require("../common/get-electron-binding"); +const { Promise } = global; +const v8Util = get_electron_binding_1.getElectronBinding('v8_util'); +const hasWebPrefsRemoteModuleAPI = (() => { + var _a, _b; + const electronVersion = Number((_b = (_a = process.versions.electron) === null || _a === void 0 ? void 0 : _a.split(".")) === null || _b === void 0 ? void 0 : _b[0]); + return Number.isNaN(electronVersion) || electronVersion < 14; +})(); +// The internal properties of Function. +const FUNCTION_PROPERTIES = [ + 'length', 'name', 'arguments', 'caller', 'prototype' +]; +// The remote functions in renderer processes. +const rendererFunctionCache = new Map(); +// eslint-disable-next-line no-undef +const finalizationRegistry = new FinalizationRegistry((fi) => { + const mapKey = fi.id[0] + '~' + fi.id[1]; + const ref = rendererFunctionCache.get(mapKey); + if (ref !== undefined && ref.deref() === undefined) { + rendererFunctionCache.delete(mapKey); + if (!fi.webContents.isDestroyed()) { + try { + fi.webContents.sendToFrame(fi.frameId, "REMOTE_RENDERER_RELEASE_CALLBACK" /* RENDERER_RELEASE_CALLBACK */, fi.id[0], fi.id[1]); + } + catch (error) { + console.warn(`sendToFrame() failed: ${error}`); + } + } + } +}); +function getCachedRendererFunction(id) { + const mapKey = id[0] + '~' + id[1]; + const ref = rendererFunctionCache.get(mapKey); + if (ref !== undefined) { + const deref = ref.deref(); + if (deref !== undefined) + return deref; + } +} +function setCachedRendererFunction(id, wc, frameId, value) { + // eslint-disable-next-line no-undef + const wr = new WeakRef(value); + const mapKey = id[0] + '~' + id[1]; + rendererFunctionCache.set(mapKey, wr); + finalizationRegistry.register(value, { + id, + webContents: wc, + frameId + }); + return value; +} +const locationInfo = new WeakMap(); +// Return the description of object's members: +const getObjectMembers = function (object) { + let names = Object.getOwnPropertyNames(object); + // For Function, we should not override following properties even though they + // are "own" properties. + if (typeof object === 'function') { + names = names.filter((name) => { + return !FUNCTION_PROPERTIES.includes(name); + }); + } + // Map properties to descriptors. + return names.map((name) => { + const descriptor = Object.getOwnPropertyDescriptor(object, name); + let type; + let writable = false; + if (descriptor.get === undefined && typeof object[name] === 'function') { + type = 'method'; + } + else { + if (descriptor.set || descriptor.writable) + writable = true; + type = 'get'; + } + return { name, enumerable: descriptor.enumerable, writable, type }; + }); +}; +// Return the description of object's prototype. +const getObjectPrototype = function (object) { + const proto = Object.getPrototypeOf(object); + if (proto === null || proto === Object.prototype) + return null; + return { + members: getObjectMembers(proto), + proto: getObjectPrototype(proto) + }; +}; +// Convert a real value into meta data. +const valueToMeta = function (sender, contextId, value, optimizeSimpleObject = false) { + // Determine the type of value. + let type; + switch (typeof value) { + case 'object': + // Recognize certain types of objects. + if (value instanceof Buffer) { + type = 'buffer'; + } + else if (value && value.constructor && value.constructor.name === 'NativeImage') { + type = 'nativeimage'; + } + else if (Array.isArray(value)) { + type = 'array'; + } + else if (value instanceof Error) { + type = 'error'; + } + else if (type_utils_1.isSerializableObject(value)) { + type = 'value'; + } + else if (type_utils_1.isPromise(value)) { + type = 'promise'; + } + else if (Object.prototype.hasOwnProperty.call(value, 'callee') && value.length != null) { + // Treat the arguments object as array. + type = 'array'; + } + else if (optimizeSimpleObject && v8Util.getHiddenValue(value, 'simple')) { + // Treat simple objects as value. + type = 'value'; + } + else { + type = 'object'; + } + break; + case 'function': + type = 'function'; + break; + default: + type = 'value'; + break; + } + // Fill the meta object according to value's type. + if (type === 'array') { + return { + type, + members: value.map((el) => valueToMeta(sender, contextId, el, optimizeSimpleObject)) + }; + } + else if (type === 'nativeimage') { + return { type, value: type_utils_1.serialize(value) }; + } + else if (type === 'object' || type === 'function') { + return { + type, + name: value.constructor ? value.constructor.name : '', + // Reference the original value if it's an object, because when it's + // passed to renderer we would assume the renderer keeps a reference of + // it. + id: objects_registry_1.default.add(sender, contextId, value), + members: getObjectMembers(value), + proto: getObjectPrototype(value) + }; + } + else if (type === 'buffer') { + return { type, value }; + } + else if (type === 'promise') { + // Add default handler to prevent unhandled rejections in main process + // Instead they should appear in the renderer process + value.then(function () { }, function () { }); + return { + type, + then: valueToMeta(sender, contextId, function (onFulfilled, onRejected) { + value.then(onFulfilled, onRejected); + }) + }; + } + else if (type === 'error') { + return { + type, + value, + members: Object.keys(value).map(name => ({ + name, + value: valueToMeta(sender, contextId, value[name]) + })) + }; + } + else { + return { + type: 'value', + value + }; + } +}; +const throwRPCError = function (message) { + const error = new Error(message); + error.code = 'EBADRPC'; + error.errno = -72; + throw error; +}; +const removeRemoteListenersAndLogWarning = (sender, callIntoRenderer) => { + const location = locationInfo.get(callIntoRenderer); + let message = 'Attempting to call a function in a renderer window that has been closed or released.' + + `\nFunction provided here: ${location}`; + if (sender instanceof events_1.EventEmitter) { + const remoteEvents = sender.eventNames().filter((eventName) => { + return sender.listeners(eventName).includes(callIntoRenderer); + }); + if (remoteEvents.length > 0) { + message += `\nRemote event names: ${remoteEvents.join(', ')}`; + remoteEvents.forEach((eventName) => { + sender.removeListener(eventName, callIntoRenderer); + }); + } + } + console.warn(message); +}; +const fakeConstructor = (constructor, name) => new Proxy(Object, { + get(target, prop, receiver) { + if (prop === 'name') { + return name; + } + else { + return Reflect.get(target, prop, receiver); + } + } +}); +// Convert array of meta data from renderer into array of real values. +const unwrapArgs = function (sender, frameId, contextId, args) { + const metaToValue = function (meta) { + switch (meta.type) { + case 'nativeimage': + return type_utils_1.deserialize(meta.value); + case 'value': + return meta.value; + case 'remote-object': + return objects_registry_1.default.get(meta.id); + case 'array': + return unwrapArgs(sender, frameId, contextId, meta.value); + case 'buffer': + return Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength); + case 'promise': + return Promise.resolve({ + then: metaToValue(meta.then) + }); + case 'object': { + const ret = meta.name !== 'Object' ? Object.create({ + constructor: fakeConstructor(Object, meta.name) + }) : {}; + for (const { name, value } of meta.members) { + ret[name] = metaToValue(value); + } + return ret; + } + case 'function-with-return-value': { + const returnValue = metaToValue(meta.value); + return function () { + return returnValue; + }; + } + case 'function': { + // Merge contextId and meta.id, since meta.id can be the same in + // different webContents. + const objectId = [contextId, meta.id]; + // Cache the callbacks in renderer. + const cachedFunction = getCachedRendererFunction(objectId); + if (cachedFunction !== undefined) { + return cachedFunction; + } + const callIntoRenderer = function (...args) { + let succeed = false; + if (!sender.isDestroyed()) { + try { + succeed = sender.sendToFrame(frameId, "REMOTE_RENDERER_CALLBACK" /* RENDERER_CALLBACK */, contextId, meta.id, valueToMeta(sender, contextId, args)) !== false; + } + catch (error) { + console.warn(`sendToFrame() failed: ${error}`); + } + } + if (!succeed) { + removeRemoteListenersAndLogWarning(this, callIntoRenderer); + } + }; + locationInfo.set(callIntoRenderer, meta.location); + Object.defineProperty(callIntoRenderer, 'length', { value: meta.length }); + setCachedRendererFunction(objectId, sender, frameId, callIntoRenderer); + return callIntoRenderer; + } + default: + throw new TypeError(`Unknown type: ${meta.type}`); + } + }; + return args.map(metaToValue); +}; +const isRemoteModuleEnabledImpl = function (contents) { + const webPreferences = contents.getLastWebPreferences() || {}; + return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : false; +}; +const isRemoteModuleEnabledCache = new WeakMap(); +const isRemoteModuleEnabled = function (contents) { + if (hasWebPrefsRemoteModuleAPI && !isRemoteModuleEnabledCache.has(contents)) { + isRemoteModuleEnabledCache.set(contents, isRemoteModuleEnabledImpl(contents)); + } + return isRemoteModuleEnabledCache.get(contents); +}; +exports.isRemoteModuleEnabled = isRemoteModuleEnabled; +function enable(contents) { + isRemoteModuleEnabledCache.set(contents, true); +} +exports.enable = enable; +const handleRemoteCommand = function (channel, handler) { + electron_1.ipcMain.on(channel, (event, contextId, ...args) => { + let returnValue; + if (!exports.isRemoteModuleEnabled(event.sender)) { + event.returnValue = { + type: 'exception', + value: valueToMeta(event.sender, contextId, new Error('@electron/remote is disabled for this WebContents. Call require("@electron/remote/main").enable(webContents) to enable it.')) + }; + return; + } + try { + returnValue = handler(event, contextId, ...args); + } + catch (error) { + returnValue = { + type: 'exception', + value: valueToMeta(event.sender, contextId, error), + }; + } + if (returnValue !== undefined) { + event.returnValue = returnValue; + } + }); +}; +const emitCustomEvent = function (contents, eventName, ...args) { + const event = { sender: contents, returnValue: undefined, defaultPrevented: false }; + electron_1.app.emit(eventName, event, contents, ...args); + contents.emit(eventName, event, ...args); + return event; +}; +const logStack = function (contents, code, stack) { + if (stack) { + console.warn(`WebContents (${contents.id}): ${code}`, stack); + } +}; +let initialized = false; +function initialize() { + if (initialized) + throw new Error('@electron/remote has already been initialized'); + initialized = true; + handleRemoteCommand("REMOTE_BROWSER_WRONG_CONTEXT_ERROR" /* BROWSER_WRONG_CONTEXT_ERROR */, function (event, contextId, passedContextId, id) { + const objectId = [passedContextId, id]; + const cachedFunction = getCachedRendererFunction(objectId); + if (cachedFunction === undefined) { + // Do nothing if the error has already been reported before. + return; + } + removeRemoteListenersAndLogWarning(event.sender, cachedFunction); + }); + handleRemoteCommand("REMOTE_BROWSER_REQUIRE" /* BROWSER_REQUIRE */, function (event, contextId, moduleName, stack) { + logStack(event.sender, `remote.require('${moduleName}')`, stack); + const customEvent = emitCustomEvent(event.sender, 'remote-require', moduleName); + if (customEvent.returnValue === undefined) { + if (customEvent.defaultPrevented) { + throw new Error(`Blocked remote.require('${moduleName}')`); + } + else { + customEvent.returnValue = process.mainModule.require(moduleName); + } + } + return valueToMeta(event.sender, contextId, customEvent.returnValue); + }); + handleRemoteCommand("REMOTE_BROWSER_GET_BUILTIN" /* BROWSER_GET_BUILTIN */, function (event, contextId, moduleName, stack) { + logStack(event.sender, `remote.getBuiltin('${moduleName}')`, stack); + const customEvent = emitCustomEvent(event.sender, 'remote-get-builtin', moduleName); + if (customEvent.returnValue === undefined) { + if (customEvent.defaultPrevented) { + throw new Error(`Blocked remote.getBuiltin('${moduleName}')`); + } + else { + customEvent.returnValue = require('electron')[moduleName]; + } + } + return valueToMeta(event.sender, contextId, customEvent.returnValue); + }); + handleRemoteCommand("REMOTE_BROWSER_GET_GLOBAL" /* BROWSER_GET_GLOBAL */, function (event, contextId, globalName, stack) { + logStack(event.sender, `remote.getGlobal('${globalName}')`, stack); + const customEvent = emitCustomEvent(event.sender, 'remote-get-global', globalName); + if (customEvent.returnValue === undefined) { + if (customEvent.defaultPrevented) { + throw new Error(`Blocked remote.getGlobal('${globalName}')`); + } + else { + customEvent.returnValue = global[globalName]; + } + } + return valueToMeta(event.sender, contextId, customEvent.returnValue); + }); + handleRemoteCommand("REMOTE_BROWSER_GET_CURRENT_WINDOW" /* BROWSER_GET_CURRENT_WINDOW */, function (event, contextId, stack) { + logStack(event.sender, 'remote.getCurrentWindow()', stack); + const customEvent = emitCustomEvent(event.sender, 'remote-get-current-window'); + if (customEvent.returnValue === undefined) { + if (customEvent.defaultPrevented) { + throw new Error('Blocked remote.getCurrentWindow()'); + } + else { + customEvent.returnValue = event.sender.getOwnerBrowserWindow(); + } + } + return valueToMeta(event.sender, contextId, customEvent.returnValue); + }); + handleRemoteCommand("REMOTE_BROWSER_GET_CURRENT_WEB_CONTENTS" /* BROWSER_GET_CURRENT_WEB_CONTENTS */, function (event, contextId, stack) { + logStack(event.sender, 'remote.getCurrentWebContents()', stack); + const customEvent = emitCustomEvent(event.sender, 'remote-get-current-web-contents'); + if (customEvent.returnValue === undefined) { + if (customEvent.defaultPrevented) { + throw new Error('Blocked remote.getCurrentWebContents()'); + } + else { + customEvent.returnValue = event.sender; + } + } + return valueToMeta(event.sender, contextId, customEvent.returnValue); + }); + handleRemoteCommand("REMOTE_BROWSER_CONSTRUCTOR" /* BROWSER_CONSTRUCTOR */, function (event, contextId, id, args) { + args = unwrapArgs(event.sender, event.frameId, contextId, args); + const constructor = objects_registry_1.default.get(id); + if (constructor == null) { + throwRPCError(`Cannot call constructor on missing remote object ${id}`); + } + return valueToMeta(event.sender, contextId, new constructor(...args)); + }); + handleRemoteCommand("REMOTE_BROWSER_FUNCTION_CALL" /* BROWSER_FUNCTION_CALL */, function (event, contextId, id, args) { + args = unwrapArgs(event.sender, event.frameId, contextId, args); + const func = objects_registry_1.default.get(id); + if (func == null) { + throwRPCError(`Cannot call function on missing remote object ${id}`); + } + try { + return valueToMeta(event.sender, contextId, func(...args), true); + } + catch (error) { + const err = new Error(`Could not call remote function '${func.name || "anonymous"}'. Check that the function signature is correct. Underlying error: ${error}\n` + + (error instanceof Error ? `Underlying stack: ${error.stack}\n` : "")); + err.cause = error; + throw err; + } + }); + handleRemoteCommand("REMOTE_BROWSER_MEMBER_CONSTRUCTOR" /* BROWSER_MEMBER_CONSTRUCTOR */, function (event, contextId, id, method, args) { + args = unwrapArgs(event.sender, event.frameId, contextId, args); + const object = objects_registry_1.default.get(id); + if (object == null) { + throwRPCError(`Cannot call constructor '${method}' on missing remote object ${id}`); + } + return valueToMeta(event.sender, contextId, new object[method](...args)); + }); + handleRemoteCommand("REMOTE_BROWSER_MEMBER_CALL" /* BROWSER_MEMBER_CALL */, function (event, contextId, id, method, args) { + args = unwrapArgs(event.sender, event.frameId, contextId, args); + const object = objects_registry_1.default.get(id); + if (object == null) { + throwRPCError(`Cannot call method '${method}' on missing remote object ${id}`); + } + try { + return valueToMeta(event.sender, contextId, object[method](...args), true); + } + catch (error) { + const err = new Error(`Could not call remote method '${method}'. Check that the method signature is correct. Underlying error: ${error}` + + (error instanceof Error ? `Underlying stack: ${error.stack}\n` : "")); + err.cause = error; + throw err; + } + }); + handleRemoteCommand("REMOTE_BROWSER_MEMBER_SET" /* BROWSER_MEMBER_SET */, function (event, contextId, id, name, args) { + args = unwrapArgs(event.sender, event.frameId, contextId, args); + const obj = objects_registry_1.default.get(id); + if (obj == null) { + throwRPCError(`Cannot set property '${name}' on missing remote object ${id}`); + } + obj[name] = args[0]; + return null; + }); + handleRemoteCommand("REMOTE_BROWSER_MEMBER_GET" /* BROWSER_MEMBER_GET */, function (event, contextId, id, name) { + const obj = objects_registry_1.default.get(id); + if (obj == null) { + throwRPCError(`Cannot get property '${name}' on missing remote object ${id}`); + } + return valueToMeta(event.sender, contextId, obj[name]); + }); + handleRemoteCommand("REMOTE_BROWSER_DEREFERENCE" /* BROWSER_DEREFERENCE */, function (event, contextId, id) { + objects_registry_1.default.remove(event.sender, contextId, id); + }); + handleRemoteCommand("REMOTE_BROWSER_CONTEXT_RELEASE" /* BROWSER_CONTEXT_RELEASE */, (event, contextId) => { + objects_registry_1.default.clear(event.sender, contextId); + return null; + }); +} +exports.initialize = initialize; diff --git a/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.d.ts b/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.d.ts new file mode 100644 index 0000000..f67bb12 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.d.ts @@ -0,0 +1,11 @@ +export declare class CallbacksRegistry { + private nextId; + private callbacks; + private callbackIds; + private locationInfo; + add(callback: Function): number; + get(id: number): Function; + getLocation(callback: Function): string | undefined; + apply(id: number, ...args: any[]): any; + remove(id: number): void; +} diff --git a/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js b/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js new file mode 100644 index 0000000..393a041 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallbacksRegistry = void 0; +class CallbacksRegistry { + constructor() { + this.nextId = 0; + this.callbacks = {}; + this.callbackIds = new WeakMap(); + this.locationInfo = new WeakMap(); + } + add(callback) { + // The callback is already added. + let id = this.callbackIds.get(callback); + if (id != null) + return id; + id = this.nextId += 1; + this.callbacks[id] = callback; + this.callbackIds.set(callback, id); + // Capture the location of the function and put it in the ID string, + // so that release errors can be tracked down easily. + const regexp = /at (.*)/gi; + const stackString = (new Error()).stack; + if (!stackString) + return id; + let filenameAndLine; + let match; + while ((match = regexp.exec(stackString)) !== null) { + const location = match[1]; + if (location.includes('(native)')) + continue; + if (location.includes('(<anonymous>)')) + continue; + if (location.includes('callbacks-registry.js')) + continue; + if (location.includes('remote.js')) + continue; + if (location.includes('@electron/remote/dist')) + continue; + const ref = /([^/^)]*)\)?$/gi.exec(location); + if (ref) + filenameAndLine = ref[1]; + break; + } + this.locationInfo.set(callback, filenameAndLine); + return id; + } + get(id) { + return this.callbacks[id] || function () { }; + } + getLocation(callback) { + return this.locationInfo.get(callback); + } + apply(id, ...args) { + return this.get(id).apply(global, ...args); + } + remove(id) { + const callback = this.callbacks[id]; + if (callback) { + this.callbackIds.delete(callback); + delete this.callbacks[id]; + } + } +} +exports.CallbacksRegistry = CallbacksRegistry; diff --git a/node_modules/@electron/remote/dist/src/renderer/index.d.ts b/node_modules/@electron/remote/dist/src/renderer/index.d.ts new file mode 100644 index 0000000..32d2db9 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/index.d.ts @@ -0,0 +1 @@ +export * from './remote'; diff --git a/node_modules/@electron/remote/dist/src/renderer/index.js b/node_modules/@electron/remote/dist/src/renderer/index.js new file mode 100644 index 0000000..786e6a6 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +if (process.type === 'browser') + throw new Error(`"@electron/remote" cannot be required in the browser process. Instead require("@electron/remote/main").`); +__exportStar(require("./remote"), exports); diff --git a/node_modules/@electron/remote/dist/src/renderer/remote.d.ts b/node_modules/@electron/remote/dist/src/renderer/remote.d.ts new file mode 100644 index 0000000..3bf0c03 --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/remote.d.ts @@ -0,0 +1,6 @@ +import { BrowserWindow, WebContents } from 'electron'; +export declare function getBuiltin(module: string): any; +export declare function getCurrentWindow(): BrowserWindow; +export declare function getCurrentWebContents(): WebContents; +export declare function getGlobal<T = any>(name: string): T; +export declare function createFunctionWithReturnValue<T>(returnValue: T): () => T; diff --git a/node_modules/@electron/remote/dist/src/renderer/remote.js b/node_modules/@electron/remote/dist/src/renderer/remote.js new file mode 100644 index 0000000..86219ce --- /dev/null +++ b/node_modules/@electron/remote/dist/src/renderer/remote.js @@ -0,0 +1,403 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFunctionWithReturnValue = exports.getGlobal = exports.getCurrentWebContents = exports.getCurrentWindow = exports.getBuiltin = void 0; +const callbacks_registry_1 = require("./callbacks-registry"); +const type_utils_1 = require("../common/type-utils"); +const electron_1 = require("electron"); +const module_names_1 = require("../common/module-names"); +const get_electron_binding_1 = require("../common/get-electron-binding"); +const { Promise } = global; +const callbacksRegistry = new callbacks_registry_1.CallbacksRegistry(); +const remoteObjectCache = new Map(); +const finalizationRegistry = new FinalizationRegistry((id) => { + const ref = remoteObjectCache.get(id); + if (ref !== undefined && ref.deref() === undefined) { + remoteObjectCache.delete(id); + electron_1.ipcRenderer.send("REMOTE_BROWSER_DEREFERENCE" /* BROWSER_DEREFERENCE */, contextId, id, 0); + } +}); +const electronIds = new WeakMap(); +const isReturnValue = new WeakSet(); +function getCachedRemoteObject(id) { + const ref = remoteObjectCache.get(id); + if (ref !== undefined) { + const deref = ref.deref(); + if (deref !== undefined) + return deref; + } +} +function setCachedRemoteObject(id, value) { + const wr = new WeakRef(value); + remoteObjectCache.set(id, wr); + finalizationRegistry.register(value, id); + return value; +} +function getContextId() { + const v8Util = get_electron_binding_1.getElectronBinding('v8_util'); + if (v8Util) { + return v8Util.getHiddenValue(global, 'contextId'); + } + else { + throw new Error('Electron >=v13.0.0-beta.6 required to support sandboxed renderers'); + } +} +// An unique ID that can represent current context. +const contextId = process.contextId || getContextId(); +// Notify the main process when current context is going to be released. +// Note that when the renderer process is destroyed, the message may not be +// sent, we also listen to the "render-view-deleted" event in the main process +// to guard that situation. +process.on('exit', () => { + const command = "REMOTE_BROWSER_CONTEXT_RELEASE" /* BROWSER_CONTEXT_RELEASE */; + electron_1.ipcRenderer.send(command, contextId); +}); +const IS_REMOTE_PROXY = Symbol('is-remote-proxy'); +// Convert the arguments object into an array of meta data. +function wrapArgs(args, visited = new Set()) { + const valueToMeta = (value) => { + // Check for circular reference. + if (visited.has(value)) { + return { + type: 'value', + value: null + }; + } + if (value && value.constructor && value.constructor.name === 'NativeImage') { + return { type: 'nativeimage', value: type_utils_1.serialize(value) }; + } + else if (Array.isArray(value)) { + visited.add(value); + const meta = { + type: 'array', + value: wrapArgs(value, visited) + }; + visited.delete(value); + return meta; + } + else if (value instanceof Buffer) { + return { + type: 'buffer', + value + }; + } + else if (type_utils_1.isSerializableObject(value)) { + return { + type: 'value', + value + }; + } + else if (typeof value === 'object') { + if (type_utils_1.isPromise(value)) { + return { + type: 'promise', + then: valueToMeta(function (onFulfilled, onRejected) { + value.then(onFulfilled, onRejected); + }) + }; + } + else if (electronIds.has(value)) { + return { + type: 'remote-object', + id: electronIds.get(value) + }; + } + const meta = { + type: 'object', + name: value.constructor ? value.constructor.name : '', + members: [] + }; + visited.add(value); + for (const prop in value) { // eslint-disable-line guard-for-in + meta.members.push({ + name: prop, + value: valueToMeta(value[prop]) + }); + } + visited.delete(value); + return meta; + } + else if (typeof value === 'function' && isReturnValue.has(value)) { + return { + type: 'function-with-return-value', + value: valueToMeta(value()) + }; + } + else if (typeof value === 'function') { + return { + type: 'function', + id: callbacksRegistry.add(value), + location: callbacksRegistry.getLocation(value), + length: value.length + }; + } + else { + return { + type: 'value', + value + }; + } + }; + return args.map(valueToMeta); +} +// Populate object's members from descriptors. +// The |ref| will be kept referenced by |members|. +// This matches |getObjectMemebers| in rpc-server. +function setObjectMembers(ref, object, metaId, members) { + if (!Array.isArray(members)) + return; + for (const member of members) { + if (Object.prototype.hasOwnProperty.call(object, member.name)) + continue; + const descriptor = { enumerable: member.enumerable }; + if (member.type === 'method') { + const remoteMemberFunction = function (...args) { + let command; + if (this && this.constructor === remoteMemberFunction) { + command = "REMOTE_BROWSER_MEMBER_CONSTRUCTOR" /* BROWSER_MEMBER_CONSTRUCTOR */; + } + else { + command = "REMOTE_BROWSER_MEMBER_CALL" /* BROWSER_MEMBER_CALL */; + } + const ret = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name, wrapArgs(args)); + return metaToValue(ret); + }; + let descriptorFunction = proxyFunctionProperties(remoteMemberFunction, metaId, member.name); + descriptor.get = () => { + descriptorFunction.ref = ref; // The member should reference its object. + return descriptorFunction; + }; + // Enable monkey-patch the method + descriptor.set = (value) => { + descriptorFunction = value; + return value; + }; + descriptor.configurable = true; + } + else if (member.type === 'get') { + descriptor.get = () => { + const command = "REMOTE_BROWSER_MEMBER_GET" /* BROWSER_MEMBER_GET */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name); + return metaToValue(meta); + }; + if (member.writable) { + descriptor.set = (value) => { + const args = wrapArgs([value]); + const command = "REMOTE_BROWSER_MEMBER_SET" /* BROWSER_MEMBER_SET */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name, args); + if (meta != null) + metaToValue(meta); + return value; + }; + } + } + Object.defineProperty(object, member.name, descriptor); + } +} +// Populate object's prototype from descriptor. +// This matches |getObjectPrototype| in rpc-server. +function setObjectPrototype(ref, object, metaId, descriptor) { + if (descriptor === null) + return; + const proto = {}; + setObjectMembers(ref, proto, metaId, descriptor.members); + setObjectPrototype(ref, proto, metaId, descriptor.proto); + Object.setPrototypeOf(object, proto); +} +// Wrap function in Proxy for accessing remote properties +function proxyFunctionProperties(remoteMemberFunction, metaId, name) { + let loaded = false; + // Lazily load function properties + const loadRemoteProperties = () => { + if (loaded) + return; + loaded = true; + const command = "REMOTE_BROWSER_MEMBER_GET" /* BROWSER_MEMBER_GET */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, name); + setObjectMembers(remoteMemberFunction, remoteMemberFunction, meta.id, meta.members); + }; + return new Proxy(remoteMemberFunction, { + set: (target, property, value) => { + if (property !== 'ref') + loadRemoteProperties(); + target[property] = value; + return true; + }, + get: (target, property) => { + if (property === IS_REMOTE_PROXY) + return true; + if (!Object.prototype.hasOwnProperty.call(target, property)) + loadRemoteProperties(); + const value = target[property]; + if (property === 'toString' && typeof value === 'function') { + return value.bind(target); + } + return value; + }, + ownKeys: (target) => { + loadRemoteProperties(); + return Object.getOwnPropertyNames(target); + }, + getOwnPropertyDescriptor: (target, property) => { + const descriptor = Object.getOwnPropertyDescriptor(target, property); + if (descriptor) + return descriptor; + loadRemoteProperties(); + return Object.getOwnPropertyDescriptor(target, property); + } + }); +} +// Convert meta data from browser into real value. +function metaToValue(meta) { + if (meta.type === 'value') { + return meta.value; + } + else if (meta.type === 'array') { + return meta.members.map((member) => metaToValue(member)); + } + else if (meta.type === 'nativeimage') { + return type_utils_1.deserialize(meta.value); + } + else if (meta.type === 'buffer') { + return Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength); + } + else if (meta.type === 'promise') { + return Promise.resolve({ then: metaToValue(meta.then) }); + } + else if (meta.type === 'error') { + return metaToError(meta); + } + else if (meta.type === 'exception') { + if (meta.value.type === 'error') { + throw metaToError(meta.value); + } + else { + throw new Error(`Unexpected value type in exception: ${meta.value.type}`); + } + } + else { + let ret; + if ('id' in meta) { + const cached = getCachedRemoteObject(meta.id); + if (cached !== undefined) { + return cached; + } + } + // A shadow class to represent the remote function object. + if (meta.type === 'function') { + const remoteFunction = function (...args) { + let command; + if (this && this.constructor === remoteFunction) { + command = "REMOTE_BROWSER_CONSTRUCTOR" /* BROWSER_CONSTRUCTOR */; + } + else { + command = "REMOTE_BROWSER_FUNCTION_CALL" /* BROWSER_FUNCTION_CALL */; + } + const obj = electron_1.ipcRenderer.sendSync(command, contextId, meta.id, wrapArgs(args)); + return metaToValue(obj); + }; + ret = remoteFunction; + } + else { + ret = {}; + } + setObjectMembers(ret, ret, meta.id, meta.members); + setObjectPrototype(ret, ret, meta.id, meta.proto); + if (ret.constructor && ret.constructor[IS_REMOTE_PROXY]) { + Object.defineProperty(ret.constructor, 'name', { value: meta.name }); + } + // Track delegate obj's lifetime & tell browser to clean up when object is GCed. + electronIds.set(ret, meta.id); + setCachedRemoteObject(meta.id, ret); + return ret; + } +} +function metaToError(meta) { + const obj = meta.value; + for (const { name, value } of meta.members) { + obj[name] = metaToValue(value); + } + return obj; +} +function handleMessage(channel, handler) { + electron_1.ipcRenderer.on(channel, (event, passedContextId, id, ...args) => { + if (event.senderId !== 0) { + console.error(`Message ${channel} sent by unexpected WebContents (${event.senderId})`); + return; + } + if (passedContextId === contextId) { + handler(id, ...args); + } + else { + // Message sent to an un-exist context, notify the error to main process. + electron_1.ipcRenderer.send("REMOTE_BROWSER_WRONG_CONTEXT_ERROR" /* BROWSER_WRONG_CONTEXT_ERROR */, contextId, passedContextId, id); + } + }); +} +const enableStacks = process.argv.includes('--enable-api-filtering-logging'); +function getCurrentStack() { + const target = { stack: undefined }; + if (enableStacks) { + Error.captureStackTrace(target, getCurrentStack); + } + return target.stack; +} +// Browser calls a callback in renderer. +handleMessage("REMOTE_RENDERER_CALLBACK" /* RENDERER_CALLBACK */, (id, args) => { + callbacksRegistry.apply(id, metaToValue(args)); +}); +// A callback in browser is released. +handleMessage("REMOTE_RENDERER_RELEASE_CALLBACK" /* RENDERER_RELEASE_CALLBACK */, (id) => { + callbacksRegistry.remove(id); +}); +exports.require = (module) => { + const command = "REMOTE_BROWSER_REQUIRE" /* BROWSER_REQUIRE */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, module, getCurrentStack()); + return metaToValue(meta); +}; +// Alias to remote.require('electron').xxx. +function getBuiltin(module) { + const command = "REMOTE_BROWSER_GET_BUILTIN" /* BROWSER_GET_BUILTIN */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, module, getCurrentStack()); + return metaToValue(meta); +} +exports.getBuiltin = getBuiltin; +function getCurrentWindow() { + const command = "REMOTE_BROWSER_GET_CURRENT_WINDOW" /* BROWSER_GET_CURRENT_WINDOW */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, getCurrentStack()); + return metaToValue(meta); +} +exports.getCurrentWindow = getCurrentWindow; +// Get current WebContents object. +function getCurrentWebContents() { + const command = "REMOTE_BROWSER_GET_CURRENT_WEB_CONTENTS" /* BROWSER_GET_CURRENT_WEB_CONTENTS */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, getCurrentStack()); + return metaToValue(meta); +} +exports.getCurrentWebContents = getCurrentWebContents; +// Get a global object in browser. +function getGlobal(name) { + const command = "REMOTE_BROWSER_GET_GLOBAL" /* BROWSER_GET_GLOBAL */; + const meta = electron_1.ipcRenderer.sendSync(command, contextId, name, getCurrentStack()); + return metaToValue(meta); +} +exports.getGlobal = getGlobal; +// Get the process object in browser. +Object.defineProperty(exports, 'process', { + enumerable: true, + get: () => exports.getGlobal('process') +}); +// Create a function that will return the specified value when called in browser. +function createFunctionWithReturnValue(returnValue) { + const func = () => returnValue; + isReturnValue.add(func); + return func; +} +exports.createFunctionWithReturnValue = createFunctionWithReturnValue; +const addBuiltinProperty = (name) => { + Object.defineProperty(exports, name, { + enumerable: true, + get: () => exports.getBuiltin(name) + }); +}; +module_names_1.browserModuleNames + .forEach(addBuiltinProperty); diff --git a/node_modules/@electron/remote/index.d.ts b/node_modules/@electron/remote/index.d.ts new file mode 100644 index 0000000..26836fb --- /dev/null +++ b/node_modules/@electron/remote/index.d.ts @@ -0,0 +1,65 @@ +import * as Electron from 'electron'; + +export { + ClientRequest, + CommandLine, + Cookies, + Debugger, + Dock, + DownloadItem, + IncomingMessage, + MessagePortMain, + ServiceWorkers, + TouchBarButton, + TouchBarColorPicker, + TouchBarGroup, + TouchBarLabel, + TouchBarOtherItemsProxy, + TouchBarPopover, + TouchBarScrubber, + TouchBarSegmentedControl, + TouchBarSlider, + TouchBarSpacer, + WebRequest, +} from 'electron/main'; + +// Taken from `RemoteMainInterface` +export var app: Electron.App; +export var autoUpdater: Electron.AutoUpdater; +export var BrowserView: typeof Electron.BrowserView; +export var BrowserWindow: typeof Electron.BrowserWindow; +export var clipboard: Electron.Clipboard; +export var contentTracing: Electron.ContentTracing; +export var crashReporter: Electron.CrashReporter; +export var desktopCapturer: Electron.DesktopCapturer; +export var dialog: Electron.Dialog; +export var globalShortcut: Electron.GlobalShortcut; +export var inAppPurchase: Electron.InAppPurchase; +export var ipcMain: Electron.IpcMain; +export var Menu: typeof Electron.Menu; +export var MenuItem: typeof Electron.MenuItem; +export var MessageChannelMain: typeof Electron.MessageChannelMain; +export var nativeImage: typeof Electron.nativeImage; +export var nativeTheme: Electron.NativeTheme; +export var net: Electron.Net; +export var netLog: Electron.NetLog; +export var Notification: typeof Electron.Notification; +export var powerMonitor: Electron.PowerMonitor; +export var powerSaveBlocker: Electron.PowerSaveBlocker; +export var protocol: Electron.Protocol; +export var screen: Electron.Screen; +export var session: typeof Electron.session; +export var ShareMenu: typeof Electron.ShareMenu; +export var shell: Electron.Shell; +export var systemPreferences: Electron.SystemPreferences; +export var TouchBar: typeof Electron.TouchBar; +export var Tray: typeof Electron.Tray; +export var webContents: typeof Electron.webContents; +export var webFrameMain: typeof Electron.webFrameMain; + +// Taken from `Remote` +export function getCurrentWebContents(): Electron.WebContents; +export function getCurrentWindow(): Electron.BrowserWindow; +export function getGlobal(name: string): any; +export var process: NodeJS.Process; +export var require: NodeJS.Require; diff --git a/node_modules/@electron/remote/main/index.d.ts b/node_modules/@electron/remote/main/index.d.ts new file mode 100644 index 0000000..ca7794d --- /dev/null +++ b/node_modules/@electron/remote/main/index.d.ts @@ -0,0 +1 @@ +export * from '../dist/src/main'; diff --git a/node_modules/@electron/remote/main/index.js b/node_modules/@electron/remote/main/index.js new file mode 100644 index 0000000..db95b8b --- /dev/null +++ b/node_modules/@electron/remote/main/index.js @@ -0,0 +1 @@ +module.exports = require('../dist/src/main') diff --git a/node_modules/@electron/remote/package.json b/node_modules/@electron/remote/package.json new file mode 100644 index 0000000..fb74572 --- /dev/null +++ b/node_modules/@electron/remote/package.json @@ -0,0 +1,46 @@ +{ + "name": "@electron/remote", + "version": "2.0.9", + "main": "renderer/index.js", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/electron/remote" + }, + "peerDependencies": { + "electron": ">= 13.0.0" + }, + "devDependencies": { + "@continuous-auth/semantic-release-npm": "^3.0.0", + "@types/chai": "^4.2.11", + "@types/chai-as-promised": "^7.1.2", + "@types/dirty-chai": "^2.0.2", + "@types/mocha": "^7.0.2", + "@types/node": "^14.17.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "dirty-chai": "^2.0.1", + "electron": "22.x", + "mocha": "^10.1.0", + "mocha-junit-reporter": "^1.23.3", + "mocha-multi-reporters": "^1.1.7", + "ts-node": "^8.10.2", + "typescript": "^4.1.3", + "walkdir": "^0.4.1", + "yargs": "^15.3.1" + }, + "scripts": { + "prepare": "tsc", + "test": "electron test --extension=ts --require=ts-node/register --exit --js-flags=--expose_gc", + "test:ci": "yarn test --reporter=mocha-multi-reporters --reporter-options=configFile=.circleci/mocha-reporter-config.json" + }, + "files": [ + "README.md", + "package.json", + "main", + "renderer", + "dist/src", + "index.d.ts" + ], + "types": "index.d.ts" +} diff --git a/node_modules/@electron/remote/renderer/index.d.ts b/node_modules/@electron/remote/renderer/index.d.ts new file mode 100644 index 0000000..5ef2eaf --- /dev/null +++ b/node_modules/@electron/remote/renderer/index.d.ts @@ -0,0 +1 @@ +export * from '../dist/src/renderer'; diff --git a/node_modules/@electron/remote/renderer/index.js b/node_modules/@electron/remote/renderer/index.js new file mode 100644 index 0000000..dea07f1 --- /dev/null +++ b/node_modules/@electron/remote/renderer/index.js @@ -0,0 +1 @@ +module.exports = require('../dist/src/renderer') |