Skip to content

Commit 543fa72

Browse files
committed
Revert "feat: add support for proper tracking in a speculative pre-rendering context (#102)"
This reverts commit aba822a.
1 parent c58d021 commit 543fa72

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/setup.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,5 @@ export function setup() {
4040
/* c8 ignore next 18 */
4141
export function init() {
4242
setup();
43-
// Prerender-aware initialization
44-
if (document.prerendering) {
45-
document.addEventListener('prerenderingchange', sampleRUM, { once: true });
46-
} else {
47-
sampleRUM();
48-
}
43+
sampleRUM();
4944
}

test/setup/setup.test.html

+1-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/* eslint-env mocha */
99
import { runTests } from '@web/test-runner-mocha';
1010
import { expect } from '@esm-bundle/chai';
11-
import { setup, init } from '../../src/setup.js';
11+
import { setup } from '../../src/setup.js';
1212

1313
runTests(() => {
1414
it('setup - defines window.hlx', () => {
@@ -33,14 +33,6 @@
3333
expect(window.hlx.codeBasePath).to.be.equal('/some/path');
3434
expect(window.hlx.lighthouse).to.be.false;
3535
});
36-
37-
it('init - does not enable RUM during prerendering', () => {
38-
Object.defineProperty(document, 'prerendering', { value: true });
39-
init();
40-
expect(window.hlx.rum).to.be.undefined;
41-
document.dispatchEvent(new Event('prerenderingchange'));
42-
expect(window.hlx.rum).to.not.be.undefined;
43-
});
4436
});
4537
</script>
4638
</body>

0 commit comments

Comments
 (0)