rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

Add option to block animation on <title> tag

Open eoghanmurray opened this issue 3 years ago • 5 comments

These can generate massive recordings on some websites (think scrolling title tag)

eoghanmurray avatar Nov 26 '21 17:11 eoghanmurray

I am making use of the <title> in recordings. I think it's fine to offer the option to ignore changes, but maybe removing changes from recordings by default when slimDOMOptions is set to all is an unintended breaking change?

Use case - when recording SPAs I would like the <title> value to update when navigating from page to page.

jlalmes avatar Dec 09 '21 17:12 jlalmes

good point @jlalmes

Yuyz0112 avatar Dec 09 '21 17:12 Yuyz0112

Great spot, thanks @jlalmes ... in light of that, maybe it should be a throttling thing? In the mean time I'll update so that you have to explicitly turn this on, rather than including it with all as you suggested.

eoghanmurray avatar Dec 10 '21 09:12 eoghanmurray

Actually @jlalmes, the intention of the 'all' is to enable all slim dom options — there is also a true option which is there to enable all 'safe' options (for some definition of 'safe'). Do you think you should change to using true or is that difference non-obvious?

This also reminds me that I've got some code external to rrweb which detects Single Page App url changes, but only if they happen in tandem with a

tag change. If I were to integrate that in rrweb it would introduce a new event, analogous to the <code>Meta</code> event to record SPA navigation. (this wouldn't get recorded if just the URL changed). Would that be useful?

eoghanmurray avatar Dec 10 '21 11:12 eoghanmurray

Do you think you should change to using true or is that difference non-obvious?

Good idea! I will look into that.

This also reminds me that I've got some code external to rrweb which detects Single Page App url changes, but only if they happen in tandem with a

tag change. If I were to integrate that in rrweb it would introduce a new event, analogous to the Meta event to record SPA navigation. (this wouldn't get recorded if just the URL changed). Would that be useful?

Yes, a PageNavigation event would be really useful I think. I imagine we would want this event to fire even if the <title> tag doesn't change, however, I'd be interested to take a look at your implementation of this & collaborate on a PR.

jlalmes avatar Dec 10 '21 13:12 jlalmes