mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-13 03:50:01 -04:00
run ESLint
Several bugs were found (and fixed): src/client/index.js:71 the following if() was equivalent to if (false in obj) src/client/dom/element.js:207 the following if() was equivalent to if (!element || false in element) src/client/rewrite/html.js:179 an undefined iterate() was referenced
This commit is contained in:
parent
f0611a980c
commit
561a1ee190
19 changed files with 161 additions and 220 deletions
1
.eslintignore
Normal file
1
.eslintignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
dist
|
12
.eslintrc
Normal file
12
.eslintrc
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"worker": true,
|
||||||
|
"serviceworker": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"globals": { "globalThis": true, "importScripts": true },
|
||||||
|
"parserOptions": { "sourceType": "module", "ecmaVersion": "latest" },
|
||||||
|
"extends": ["eslint:recommended"]
|
||||||
|
}
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
dist
|
213
package-lock.json
generated
213
package-lock.json
generated
|
@ -22,7 +22,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.28.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"terser-webpack-plugin": "^5.3.6",
|
"terser-webpack-plugin": "^5.3.6",
|
||||||
"webpack": "^5.74.0",
|
"webpack": "^5.74.0",
|
||||||
|
@ -39,9 +39,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/eslintrc": {
|
"node_modules/@eslint/eslintrc": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
|
||||||
"integrity": "sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==",
|
"integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
|
@ -62,29 +62,19 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/config-array": {
|
"node_modules/@humanwhocodes/config-array": {
|
||||||
"version": "0.10.4",
|
"version": "0.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz",
|
||||||
"integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==",
|
"integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@humanwhocodes/object-schema": "^1.2.1",
|
"@humanwhocodes/object-schema": "^1.2.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.10.0"
|
"node": ">=10.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/gitignore-to-minimatch": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==",
|
|
||||||
"dev": true,
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/nzakas"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@humanwhocodes/module-importer": {
|
"node_modules/@humanwhocodes/module-importer": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
||||||
|
@ -557,15 +547,6 @@
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/array-union": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
@ -987,15 +968,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.23.0",
|
"version": "8.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz",
|
||||||
"integrity": "sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==",
|
"integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/eslintrc": "^1.3.1",
|
"@eslint/eslintrc": "^1.3.3",
|
||||||
"@humanwhocodes/config-array": "^0.10.4",
|
"@humanwhocodes/config-array": "^0.11.6",
|
||||||
"@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
|
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
"ajv": "^6.10.0",
|
"ajv": "^6.10.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"cross-spawn": "^7.0.2",
|
"cross-spawn": "^7.0.2",
|
||||||
|
@ -1011,15 +992,15 @@
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"file-entry-cache": "^6.0.1",
|
"file-entry-cache": "^6.0.1",
|
||||||
"find-up": "^5.0.0",
|
"find-up": "^5.0.0",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"glob-parent": "^6.0.2",
|
||||||
"glob-parent": "^6.0.1",
|
|
||||||
"globals": "^13.15.0",
|
"globals": "^13.15.0",
|
||||||
"globby": "^11.1.0",
|
|
||||||
"grapheme-splitter": "^1.0.4",
|
"grapheme-splitter": "^1.0.4",
|
||||||
"ignore": "^5.2.0",
|
"ignore": "^5.2.0",
|
||||||
"import-fresh": "^3.0.0",
|
"import-fresh": "^3.0.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
|
"is-path-inside": "^3.0.3",
|
||||||
|
"js-sdsl": "^4.1.4",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"levn": "^0.4.1",
|
"levn": "^0.4.1",
|
||||||
|
@ -1100,9 +1081,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/espree": {
|
"node_modules/espree": {
|
||||||
"version": "9.4.0",
|
"version": "9.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
|
||||||
"integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==",
|
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": "^8.8.0",
|
"acorn": "^8.8.0",
|
||||||
|
@ -1301,12 +1282,6 @@
|
||||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/functional-red-black-tree": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
|
@ -1346,9 +1321,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
"node_modules/globals": {
|
||||||
"version": "13.17.0",
|
"version": "13.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz",
|
||||||
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==",
|
"integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"type-fest": "^0.20.2"
|
"type-fest": "^0.20.2"
|
||||||
|
@ -1360,26 +1335,6 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globby": {
|
|
||||||
"version": "11.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
|
||||||
"integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"array-union": "^2.1.0",
|
|
||||||
"dir-glob": "^3.0.1",
|
|
||||||
"fast-glob": "^3.2.9",
|
|
||||||
"ignore": "^5.2.0",
|
|
||||||
"merge2": "^1.4.1",
|
|
||||||
"slash": "^3.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/graceful-fs": {
|
"node_modules/graceful-fs": {
|
||||||
"version": "4.2.10",
|
"version": "4.2.10",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||||
|
@ -1538,6 +1493,15 @@
|
||||||
"node": ">=0.12.0"
|
"node": ">=0.12.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-path-inside": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-plain-object": {
|
"node_modules/is-plain-object": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
|
||||||
|
@ -1594,6 +1558,16 @@
|
||||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/js-sdsl": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/js-sdsl"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||||
|
@ -2263,15 +2237,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/slash": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/source-map": {
|
"node_modules/source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
@ -2708,9 +2673,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@eslint/eslintrc": {
|
"@eslint/eslintrc": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
|
||||||
"integrity": "sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==",
|
"integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
|
@ -2725,22 +2690,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@humanwhocodes/config-array": {
|
"@humanwhocodes/config-array": {
|
||||||
"version": "0.10.4",
|
"version": "0.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz",
|
||||||
"integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==",
|
"integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@humanwhocodes/object-schema": "^1.2.1",
|
"@humanwhocodes/object-schema": "^1.2.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@humanwhocodes/gitignore-to-minimatch": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"@humanwhocodes/module-importer": {
|
"@humanwhocodes/module-importer": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
||||||
|
@ -3140,12 +3099,6 @@
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"array-union": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
@ -3438,15 +3391,15 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"eslint": {
|
"eslint": {
|
||||||
"version": "8.23.0",
|
"version": "8.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz",
|
||||||
"integrity": "sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==",
|
"integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@eslint/eslintrc": "^1.3.1",
|
"@eslint/eslintrc": "^1.3.3",
|
||||||
"@humanwhocodes/config-array": "^0.10.4",
|
"@humanwhocodes/config-array": "^0.11.6",
|
||||||
"@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
|
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
"ajv": "^6.10.0",
|
"ajv": "^6.10.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"cross-spawn": "^7.0.2",
|
"cross-spawn": "^7.0.2",
|
||||||
|
@ -3462,15 +3415,15 @@
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"file-entry-cache": "^6.0.1",
|
"file-entry-cache": "^6.0.1",
|
||||||
"find-up": "^5.0.0",
|
"find-up": "^5.0.0",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"glob-parent": "^6.0.2",
|
||||||
"glob-parent": "^6.0.1",
|
|
||||||
"globals": "^13.15.0",
|
"globals": "^13.15.0",
|
||||||
"globby": "^11.1.0",
|
|
||||||
"grapheme-splitter": "^1.0.4",
|
"grapheme-splitter": "^1.0.4",
|
||||||
"ignore": "^5.2.0",
|
"ignore": "^5.2.0",
|
||||||
"import-fresh": "^3.0.0",
|
"import-fresh": "^3.0.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
|
"is-path-inside": "^3.0.3",
|
||||||
|
"js-sdsl": "^4.1.4",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"levn": "^0.4.1",
|
"levn": "^0.4.1",
|
||||||
|
@ -3526,9 +3479,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"espree": {
|
"espree": {
|
||||||
"version": "9.4.0",
|
"version": "9.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
|
||||||
"integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==",
|
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"acorn": "^8.8.0",
|
"acorn": "^8.8.0",
|
||||||
|
@ -3684,12 +3637,6 @@
|
||||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"functional-red-black-tree": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
|
@ -3720,28 +3667,14 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"version": "13.17.0",
|
"version": "13.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz",
|
||||||
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==",
|
"integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"type-fest": "^0.20.2"
|
"type-fest": "^0.20.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"globby": {
|
|
||||||
"version": "11.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
|
||||||
"integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"array-union": "^2.1.0",
|
|
||||||
"dir-glob": "^3.0.1",
|
|
||||||
"fast-glob": "^3.2.9",
|
|
||||||
"ignore": "^5.2.0",
|
|
||||||
"merge2": "^1.4.1",
|
|
||||||
"slash": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"graceful-fs": {
|
"graceful-fs": {
|
||||||
"version": "4.2.10",
|
"version": "4.2.10",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||||
|
@ -3858,6 +3791,12 @@
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"is-path-inside": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"is-plain-object": {
|
"is-plain-object": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
|
||||||
|
@ -3901,6 +3840,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"js-sdsl": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||||
|
@ -4368,12 +4313,6 @@
|
||||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"slash": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.28.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"terser-webpack-plugin": "^5.3.6",
|
"terser-webpack-plugin": "^5.3.6",
|
||||||
"webpack": "^5.74.0",
|
"webpack": "^5.74.0",
|
||||||
|
|
|
@ -193,21 +193,6 @@ class DocumentHook extends EventEmitter {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
overrideReferrer() {
|
|
||||||
this.ctx.overrideDescriptor(this.docProto, 'referrer', {
|
|
||||||
get: (target, that) => {
|
|
||||||
const event = new HookEvent(
|
|
||||||
{ value: target.call(that) },
|
|
||||||
target,
|
|
||||||
that
|
|
||||||
);
|
|
||||||
this.emit('referrer', event);
|
|
||||||
|
|
||||||
if (event.intercepted) return event.returnValue;
|
|
||||||
return event.data.value;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
overrideCookie() {
|
overrideCookie() {
|
||||||
this.ctx.overrideDescriptor(this.docProto, 'cookie', {
|
this.ctx.overrideDescriptor(this.docProto, 'cookie', {
|
||||||
get: (target, that) => {
|
get: (target, that) => {
|
||||||
|
|
|
@ -204,7 +204,7 @@ class ElementApi extends EventEmitter {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
hookProperty(element, prop, handler) {
|
hookProperty(element, prop, handler) {
|
||||||
if (!element || !prop in element) return false;
|
if (!element || !(prop in element)) return false;
|
||||||
|
|
||||||
if (this.ctx.nativeMethods.isArray(element)) {
|
if (this.ctx.nativeMethods.isArray(element)) {
|
||||||
for (const elem of element) {
|
for (const elem of element) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ class UVClient extends EventEmitter {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
override(obj, prop, wrapper, construct) {
|
override(obj, prop, wrapper, construct) {
|
||||||
if (!prop in obj) return false;
|
if (!(prop in obj)) return false;
|
||||||
const wrapped = this.wrap(obj, prop, wrapper, construct);
|
const wrapped = this.wrap(obj, prop, wrapper, construct);
|
||||||
return (obj[prop] = wrapped);
|
return (obj[prop] = wrapped);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class UVClient extends EventEmitter {
|
||||||
},
|
},
|
||||||
}.attach;
|
}.attach;
|
||||||
|
|
||||||
if (!!construct) {
|
if (construct) {
|
||||||
wrapped.prototype = fn.prototype;
|
wrapped.prototype = fn.prototype;
|
||||||
wrapped.prototype.constructor = wrapped;
|
wrapped.prototype.constructor = wrapped;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class LocationApi extends EventEmitter {
|
||||||
|
|
||||||
for (const key of this.keys) {
|
for (const key of this.keys) {
|
||||||
this.ctx.overrideDescriptor(this.workerLocProto, key, {
|
this.ctx.overrideDescriptor(this.workerLocProto, key, {
|
||||||
get: (target, that) => {
|
get: () => {
|
||||||
return parse(uv.href.get.call(this.location))[key];
|
return parse(uv.href.get.call(this.location))[key];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -78,9 +78,12 @@ class LocationApi extends EventEmitter {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
const url = new URL(emulation.href);
|
{
|
||||||
url[key] = val;
|
const url = new URL(emulation.href);
|
||||||
that.location.href = wrap(url.href);
|
url[key] = val;
|
||||||
|
that.location.href = wrap(url.href);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
|
@ -21,7 +21,7 @@ function validateCookie(cookie, meta, js = false) {
|
||||||
|
|
||||||
async function db(openDB) {
|
async function db(openDB) {
|
||||||
const db = await openDB('__op', 1, {
|
const db = await openDB('__op', 1, {
|
||||||
upgrade(db, oldVersion, newVersion, transaction) {
|
upgrade(db) {
|
||||||
const store = db.createObjectStore('cookies', {
|
const store = db.createObjectStore('cookies', {
|
||||||
keyPath: 'id',
|
keyPath: 'id',
|
||||||
});
|
});
|
||||||
|
|
|
@ -176,7 +176,7 @@ class P5Element extends EventEmitter {
|
||||||
if (this.stream) return null;
|
if (this.stream) return null;
|
||||||
|
|
||||||
let str = '';
|
let str = '';
|
||||||
iterate(this.node, (node) => {
|
this.iterate(this.node, (node) => {
|
||||||
if (node.nodeName === '#text') str += node.value;
|
if (node.nodeName === '#text') str += node.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -365,7 +365,7 @@ export default (function (exports) {
|
||||||
* Calculate specificity of a selector.
|
* Calculate specificity of a selector.
|
||||||
* If the selector is a list, the max specificity is returned.
|
* If the selector is a list, the max specificity is returned.
|
||||||
*/
|
*/
|
||||||
function specificity(selector, { format = 'array' } = {}) {
|
function specificity(selector) {
|
||||||
let ast =
|
let ast =
|
||||||
typeof selector === 'object'
|
typeof selector === 'object'
|
||||||
? selector
|
? selector
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function attributes(ctx, meta = ctx.meta) {
|
function attributes(ctx, meta = ctx.meta) {
|
||||||
const { html, js, css, attributePrefix, handlerScript, bundleScript } = ctx;
|
const { html, js, attributePrefix } = ctx;
|
||||||
const origPrefix = attributePrefix + '-attr-';
|
const origPrefix = attributePrefix + '-attr-';
|
||||||
|
|
||||||
html.on('attr', (attr, type) => {
|
html.on('attr', (attr, type) => {
|
||||||
|
@ -68,8 +68,8 @@ function attributes(ctx, meta = ctx.meta) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function text(ctx, meta = ctx.meta) {
|
function text(ctx) {
|
||||||
const { html, js, css, attributePrefix } = ctx;
|
const { html, js, css } = ctx;
|
||||||
|
|
||||||
html.on('text', (text, type) => {
|
html.on('text', (text, type) => {
|
||||||
if (text.element.tagName === 'script') {
|
if (text.element.tagName === 'script') {
|
||||||
|
@ -181,8 +181,7 @@ function isEvent(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function injectHead(ctx) {
|
function injectHead(ctx) {
|
||||||
const { html, js, css, attributePrefix } = ctx;
|
const { html } = ctx;
|
||||||
const origPrefix = attributePrefix + '-attr-';
|
|
||||||
html.on('element', (element, type) => {
|
html.on('element', (element, type) => {
|
||||||
if (type !== 'rewrite') return false;
|
if (type !== 'rewrite') return false;
|
||||||
if (element.tagName !== 'head') return false;
|
if (element.tagName !== 'head') return false;
|
||||||
|
|
|
@ -261,54 +261,61 @@ function unwrap(ctx) {
|
||||||
|
|
||||||
switch (node.callee.property.name) {
|
switch (node.callee.property.name) {
|
||||||
case '$wrap':
|
case '$wrap':
|
||||||
if (
|
{
|
||||||
!node.arguments ||
|
if (
|
||||||
node.parent.type !== Syntax.MemberExpression ||
|
!node.arguments ||
|
||||||
node.parent.property !== node
|
node.parent.type !== Syntax.MemberExpression ||
|
||||||
)
|
node.parent.property !== node
|
||||||
return false;
|
)
|
||||||
const [property] = node.arguments;
|
return false;
|
||||||
|
const [property] = node.arguments;
|
||||||
|
|
||||||
data.changes.push({
|
|
||||||
start: node.callee.start,
|
|
||||||
end: property.start,
|
|
||||||
});
|
|
||||||
|
|
||||||
node.iterateEnd = function () {
|
|
||||||
data.changes.push({
|
data.changes.push({
|
||||||
start: node.end - 2,
|
start: node.callee.start,
|
||||||
end: node.end,
|
end: property.start,
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
node.iterateEnd = function () {
|
||||||
|
data.changes.push({
|
||||||
|
start: node.end - 2,
|
||||||
|
end: node.end,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '$get':
|
case '$get':
|
||||||
case 'rewriteUrl':
|
case 'rewriteUrl':
|
||||||
const [arg] = node.arguments;
|
{
|
||||||
|
const [arg] = node.arguments;
|
||||||
|
|
||||||
data.changes.push({
|
|
||||||
start: node.callee.start,
|
|
||||||
end: arg.start,
|
|
||||||
});
|
|
||||||
|
|
||||||
node.iterateEnd = function () {
|
|
||||||
data.changes.push({
|
data.changes.push({
|
||||||
start: node.end - 1,
|
start: node.callee.start,
|
||||||
end: node.end,
|
end: arg.start,
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
node.iterateEnd = function () {
|
||||||
|
data.changes.push({
|
||||||
|
start: node.end - 1,
|
||||||
|
end: node.end,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'rewrite':
|
case 'rewrite':
|
||||||
const [script] = node.arguments;
|
{
|
||||||
data.changes.push({
|
const [script] = node.arguments;
|
||||||
start: node.callee.start,
|
|
||||||
end: script.start,
|
|
||||||
});
|
|
||||||
node.iterateEnd = function () {
|
|
||||||
data.changes.push({
|
data.changes.push({
|
||||||
start: node.end - 1,
|
start: node.callee.start,
|
||||||
end: node.end,
|
end: script.start,
|
||||||
});
|
});
|
||||||
};
|
node.iterateEnd = function () {
|
||||||
|
data.changes.push({
|
||||||
|
start: node.end - 1,
|
||||||
|
end: node.end,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*global UVServiceWorker*/
|
||||||
importScripts('/uv.bundle.js');
|
importScripts('/uv.bundle.js');
|
||||||
importScripts('/uv.config.js');
|
importScripts('/uv.config.js');
|
||||||
importScripts('/uv.sw.js');
|
importScripts('/uv.sw.js');
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*global Ultraviolet*/
|
||||||
self.__uv$config = {
|
self.__uv$config = {
|
||||||
prefix: '/service/',
|
prefix: '/service/',
|
||||||
bare: 'https://incog.dev/bare/',
|
bare: 'https://incog.dev/bare/',
|
||||||
|
|
|
@ -481,7 +481,7 @@ function __uvHook(window, config = {}, bare = '/bare/') {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.overrideDescriptor(window, 'origin', {
|
client.overrideDescriptor(window, 'origin', {
|
||||||
get: (target, that) => {
|
get: () => {
|
||||||
return __uv.location.origin;
|
return __uv.location.origin;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1318,20 +1318,13 @@ function __uvHook(window, config = {}, bare = '/bare/') {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Proper hash emulation.
|
// Proper hash emulation.
|
||||||
if (!!window.window) {
|
__uv.addEventListener.call(window, 'hashchange', (event) => {
|
||||||
__uv.addEventListener.call(window, 'hashchange', (event) => {
|
if (event.__uv$dispatched) return false;
|
||||||
if (event.__uv$dispatched) return false;
|
event.stopImmediatePropagation();
|
||||||
event.stopImmediatePropagation();
|
const hash = window.location.hash;
|
||||||
const hash = window.location.hash;
|
client.history.replaceState.call(window.history, '', '', event.oldURL);
|
||||||
client.history.replaceState.call(
|
__uv.location.hash = hash;
|
||||||
window.history,
|
});
|
||||||
'',
|
|
||||||
'',
|
|
||||||
event.oldURL
|
|
||||||
);
|
|
||||||
__uv.location.hash = hash;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
client.location.on('hashchange', (oldUrl, newUrl, ctx) => {
|
client.location.on('hashchange', (oldUrl, newUrl, ctx) => {
|
||||||
if (ctx.HashChangeEvent && client.history.replaceState) {
|
if (ctx.HashChangeEvent && client.history.replaceState) {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*globals __uv$config*/
|
||||||
// Users must import the config (and bundle) prior to importing uv.sw.js
|
// Users must import the config (and bundle) prior to importing uv.sw.js
|
||||||
// This is to allow us to produce a generic bundle with no hard-coded paths.
|
// This is to allow us to produce a generic bundle with no hard-coded paths.
|
||||||
|
|
||||||
|
@ -29,7 +30,6 @@ const cspHeaders = [
|
||||||
'x-xss-protection',
|
'x-xss-protection',
|
||||||
];
|
];
|
||||||
const emptyMethods = ['GET', 'HEAD'];
|
const emptyMethods = ['GET', 'HEAD'];
|
||||||
const emptyStatus = [204, 304];
|
|
||||||
|
|
||||||
class UVServiceWorker extends Ultraviolet.EventEmitter {
|
class UVServiceWorker extends Ultraviolet.EventEmitter {
|
||||||
constructor(config = __uv$config) {
|
constructor(config = __uv$config) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import webpack from 'webpack';
|
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import CopyPlugin from 'copy-webpack-plugin';
|
import CopyPlugin from 'copy-webpack-plugin';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue