Is it possible to take snapshot of a running Chrome tab?

34 views
Skip to first unread message

Cong Zuo

unread,
Jul 27, 2019, 4:44:29 AM7/27/19
to v8-users
Hey guys. I wonder if it's possible to take snapshot of a running Chrome tab and using the snapshot blob to start a isolate with Node.js or d8.

All I need is to capture/snapshot user defined objects and functions only, which means external functions like DOM API are not included.

I wrote a simple runtime function called `%TakeSnapshot`, which failed lots of DCHECKs... 

After some code searching and test, I don't think it's possible to complete the task with little understanding of the whole project. 

Any advises would be appreciated!

Ben Noordhuis

unread,
Jul 29, 2019, 5:02:49 AM7/29/19
to v8-users
The short answer is "you can't."

Snapshots are very closely tied to the environment they were created
in. For example, trying to load a snapshot into Node.js version X that
was created with Node.js version Y almost certainly won't work.

Cong Zuo

unread,
Aug 4, 2019, 9:29:43 AM8/4/19
to v8-users
Thanks for your reply, Ben! Maybe because I didn’t describe it clearly, I am using same libv8.so for chrome and d8.

And after some trials and failures, I found that it's feasible if two embedders depend on a single libv8.so. :-)
Reply all
Reply to author
Forward
0 new messages