Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Oct 16, 2020
1 parent 02b2248 commit 797a199
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/integration/relay-analytics-disabled/pages/_app.js
@@ -0,0 +1,15 @@
/* global localStorage */
/* eslint-disable camelcase */
import App from 'next/app'

export default class MyApp extends App {}

/*
Method is experimental and will eventually be handled in a Next.js plugin
*/
export function reportWebVitals(data) {
localStorage.setItem(
data.name || data.entryType,
data.value !== undefined ? data.value : data.startTime
)
}
25 changes: 25 additions & 0 deletions test/integration/relay-analytics-disabled/pages/index.js
@@ -0,0 +1,25 @@
if (typeof navigator !== 'undefined') {
window.__BEACONS = window.__BEACONS || []

navigator.sendBeacon = async function () {
const args = await Promise.all(
[...arguments].map((v) => {
if (v instanceof Blob) {
return v.text()
}
return v
})
)

window.__BEACONS.push(args)
}
}

export default () => {
return (
<div>
<h1>Foo!</h1>
<h2>bar!</h2>
</div>
)
}

0 comments on commit 797a199

Please sign in to comment.