* record canvas mutations close #60, #261 This patch implements the canvas mutation observer. It consists of both the record and the replay side changes. In the record side, we add a `recordCanvas` flag to indicate whether to record canvas elements and the flag defaults to false. Different from our other observers, the canvas observer was disabled by default. Because some applications with heavy canvas usage may emit a lot of data as canvas changed, especially the scenarios that use a lot of `drawImage` API. So the behavior should be audited by users and only record canvas when the flag was set to true. In the replay side, we add a `UNSAFE_replayCanvas` flag to indicate whether to replay canvas mutations. Similar to the `recordCanvas` flag, `UNSAFE_replayCanvas` defaults to false. But unlike the record canvas implementation is stable and safe, the replay canvas implementation is UNSAFE. It's unsafe because we need to add `allow-scripts` to the replay sandbox, which may cause some unexpected script execution. Currently, users should be aware of this implementation detail and enable this feature carefully. * update canvas integration test
69 lines
2.0 KiB
JSON
69 lines
2.0 KiB
JSON
{
|
|
"name": "rrweb",
|
|
"version": "0.9.0",
|
|
"description": "record and replay the web",
|
|
"scripts": {
|
|
"test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts",
|
|
"test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch --watch-extensions js,ts",
|
|
"repl": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true ts-node scripts/repl.ts",
|
|
"bundle:browser": "cross-env BROWSER_ONLY=true rollup --config",
|
|
"bundle": "rollup --config",
|
|
"typings": "tsc -d --declarationDir typings"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+ssh://git@github.com/rrweb-io/rrweb.git"
|
|
},
|
|
"keywords": [
|
|
"rrweb"
|
|
],
|
|
"main": "lib/rrweb-all.js",
|
|
"module": "es/rrweb/src/entries/all.js",
|
|
"unpkg": "dist/rrweb.js",
|
|
"sideEffects": false,
|
|
"typings": "typings/entries/all.d.ts",
|
|
"files": [
|
|
"dist",
|
|
"lib",
|
|
"es",
|
|
"typings"
|
|
],
|
|
"author": "yanzhen@smartx.com",
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://github.com/rrweb-io/rrweb/issues"
|
|
},
|
|
"homepage": "https://github.com/rrweb-io/rrweb#readme",
|
|
"devDependencies": {
|
|
"@types/chai": "^4.1.6",
|
|
"@types/inquirer": "0.0.43",
|
|
"@types/mocha": "^5.2.5",
|
|
"@types/node": "^10.11.7",
|
|
"@types/puppeteer": "^1.11.1",
|
|
"chai": "^4.2.0",
|
|
"cross-env": "^5.2.0",
|
|
"inquirer": "^6.2.1",
|
|
"jest-snapshot": "^23.6.0",
|
|
"mocha": "^5.2.0",
|
|
"puppeteer": "^1.11.0",
|
|
"rollup": "^2.3.3",
|
|
"rollup-plugin-commonjs": "^9.2.0",
|
|
"rollup-plugin-node-resolve": "^3.4.0",
|
|
"rollup-plugin-postcss": "^3.1.1",
|
|
"rollup-plugin-terser": "^5.3.0",
|
|
"rollup-plugin-typescript": "^1.0.0",
|
|
"ts-node": "^7.0.1",
|
|
"tslib": "^1.9.3",
|
|
"tslint": "^4.5.1",
|
|
"typescript": "^3.9.5"
|
|
},
|
|
"dependencies": {
|
|
"@types/smoothscroll-polyfill": "^0.3.0",
|
|
"@xstate/fsm": "^1.4.0",
|
|
"mitt": "^1.1.3",
|
|
"pako": "^1.0.11",
|
|
"rrweb-snapshot": "^0.8.1",
|
|
"smoothscroll-polyfill": "^0.4.3"
|
|
}
|
|
}
|