-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
because the document's frame is sandboxed and the 'allow-scripts' permission is not set #34
Comments
Can you post what's inside |
replay.html referencing external files or not running on the server?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"/>
<script src="https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/index.js"></script>
</head>
<body>
</body>
<script src="jquery-3.1.1.min.js"></script>
<script>
$.ajax({
type: "POST",
url: "http://localhost:8080/rrwebtest/replay?id=7",
success: function (result) {
var eventsstr = JSON.parse(result);
new rrwebPlayer({
target: document.body, // 可以自定义 DOM 元素
data: {events: eventsstr.events}
});
}
});
</script>
</html>
At 2020-08-30 07:43:35, "tungs" <[email protected]> wrote:
Can you post what's inside replay.html? It might be that you have an iframe issue. You might also have luck running a local web server instead of loading it directly from file:///.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
According to the docs for rrweb, it looks like the iframe is sandboxed so that no JavaScript is allowed to run: https://github.com/rrweb-io/rrweb/blob/0f227492dcbd7dd1de7c0c0990d3c4d2ea4e2e4b/docs/sandbox.md#iframe-sandbox timesnap/timecut automatically adds time-handling JavaScript to a page and all of its children frames and runs JavaScript to coordinate virtual times. Because JavaScript is prohibited in a sandboxed iframe, this might be throwing an error which prevents the rest of the page to run. There currently isn't any way to not run the time-handling code to children frames, without editing the timesnap's source code. If you want to edit it, change the line at https://github.com/tungs/timesnap/blob/386541965138b418e47a8ef004ed841b905b2df4/index.js#L187 to use only the main frame:
If there are multiple child frames, this only works if none of them require JavaScript time handling. There's also initialization code that's run from In the future, there may be a configuration option to filter or not run time handling code on child browser frames. |
|
Puppeeter may be the problem, and how to fix it
|
"Blocked script execution in 'file:///D:/makevideo/replay.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.", source: file:///D:/makevideo/replay.html (0)
TimeoutError: Navigation timeout of 30000 ms exceeded
at D:\software\nodejs\node_global\node_modules\timecut\node_modules\puppeteer\lib\LifecycleWatcher.js:142:21
-- ASYNC --
at Frame. (D:\software\nodejs\node_global\node_modules\timecut\node_modules\puppeteer\lib\helper.js:111:15)
at Page.goto (D:\software\nodejs\node_global\node_modules\timecut\node_modules\puppeteer\lib\Page.js:672:49)
at Page. (D:\software\nodejs\node_global\node_modules\timecut\node_modules\puppeteer\lib\helper.js:112:23)
at D:\software\nodejs\node_global\node_modules\timecut\node_modules\timesnap\index.js:173:21
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: spawn ffmpeg ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ffmpeg',
path: 'ffmpeg',
spawnargs: [
'-framerate',
60,
'-i',
'D:\makevideo\timecut-temp-1598701129093\image-%09d.png',
'-pix_fmt',
'yuv420p',
'-y',
'D:\makevideo\video.mp4'
]
}
How to solve this problem,thank you very much
The text was updated successfully, but these errors were encountered: