Skip to content

Commit 350d208

Browse files
authored
Revert "Remove Headless Browsers from pushing data to RUMVision"
1 parent 649d26f commit 350d208

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

src/view/frontend/templates/script/rumvision.phtml

+12-31
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,16 @@ if (! $viewModel->shouldIncludeScript()) {
1515
?>
1616

1717
<script>
18-
(function() {
19-
const isHeadless = navigator.userAgent.includes('HeadlessChrome')
20-
|| navigator.webdriver
21-
|| !window.chrome
22-
|| /Headless/.test(navigator.userAgent);
23-
24-
if (isHeadless) return;
25-
26-
window.rumv = window.rumv || function() {
27-
(window.rumv.q = window.rumv.q || []).push(arguments);
28-
};
29-
30-
(function(rum, vi, si, on) {
31-
var s = JSON.parse(sessionStorage.getItem('rumv') || '{"pageviews":0}');
32-
s.pageviews++;
33-
34-
if (s.urls && s.regex && (s.page = eval('(' + s.regex + ')')(s.urls, vi.location.pathname)) && !s.page.type) {
35-
return sessionStorage.setItem('rumv', JSON.stringify(s));
36-
}
37-
38-
vi.rumv.storage = s;
39-
var head = si.querySelector('head'), js = si.createElement('script');
40-
js.src = 'https://d5yoctgpv4cpx.cloudfront.net/' + rum + '/v4-' + vi.location.hostname + '.js';
41-
head.appendChild(js);
42-
})(
43-
'<?= $escaper->escapeJs($viewModel->getTrackingId()) ?>',
44-
window,
45-
document,
46-
'<?= $escaper->escapeJs($viewModel->getHostName()) ?>'
47-
);
48-
})();
18+
window.rumv = window.rumv || function() { (window.rumv.q = window.rumv.q || []).push(arguments) };
19+
(function(rum, vi,si,on) {
20+
var s = JSON.parse( sessionStorage.getItem('rumv') || '{"pageviews":0}' ); s.pageviews++;
21+
if ( s.urls && s.regex && ( s.page = eval('('+s.regex+')')( s.urls, vi.location.pathname ) ) && !s.page.type ) {
22+
return sessionStorage.setItem('rumv', JSON.stringify( s ) );
23+
}
24+
25+
vi.rumv.storage = s;
26+
var head = si.querySelector('head'), js = si.createElement('script');
27+
js.src = 'https://d5yoctgpv4cpx.cloudfront.net/'+rum+'/v4-'+vi.location.hostname+'.js';
28+
head.appendChild(js);
29+
})( '<?= $escaper->escapeJs($viewModel->getTrackingId()) ?>', window, document, '<?= $escaper->escapeJs($viewModel->getHostName()) ?>' );
4930
</script>

0 commit comments

Comments
 (0)