Created
April 5, 2020 14:06
-
-
Save omrilotan/d059561eb043312409a64e0b97b986a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record.metadata = { | |
url: document.location.href, | |
referrer: document.referrer, | |
cookie: navigator.cookieEnabled ? document.cookie : 'disabled', | |
language: navigator.language, | |
connection: navigator.connection.effectiveType, | |
hasFocus: document.hasFocus(), | |
readyState: document.readyState, | |
secondsIn: Math.round(performance.now() / 1000), // page age in seconds | |
heap: Math.round(performance.memory.usedJSHeapSize / 1048576), // MB of heap used | |
heapPercent: Math.round(performance.memory.usedJSHeapSize / performance.memory.jsHeapSizeLimit * 100), // Percent of heap used | |
}; | |
... | |
sendError(record); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment