Record and replay Javascript

前端 未结 6 973
时光取名叫无心
时光取名叫无心 2020-12-23 23:09

I know it is possible to record mouse movements, scrolling and keystrokes. But what about changes to the document? How can I record changes to the document?

Here is

6条回答
  •  不思量自难忘°
    2020-12-23 23:18

    Record

    Save the initial DOM of the page, remove the scripts from it and also you need to change all relative URLs to absolute ones.

    Then, record DOM mutations and Keyboard/Mouse event.

    Replay

    Start with initial saved DOM, apply mutations and events using timestamp order.

    In fact, clicks will not do anything because we have removed any scripts. but because we have saved the DOM changes we can replay the effect after the click.

提交回复
热议问题