backtrace-js
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -5,6 +5,6 @@ exports.report = report; | ||
var myVersion = "0.0.6"; // should match package.json | ||
var myVersion = "0.0.11"; // should match package.json | ||
var initialized = false; | ||
var uuidArray = new Uint8Array(16); | ||
var crypto = window.crypto || window.msCrypto; | ||
var pageStartTime = new Date(); | ||
@@ -22,2 +22,3 @@ var stackLineRe = /\s+at (.+) \((.+):(\d+):(\d+)\)/; | ||
var sampling; | ||
var crypto; | ||
@@ -31,3 +32,26 @@ function report(err, attributes, callback) { | ||
function validateWindow() { | ||
try { | ||
window; | ||
window.crypto || window.msCrypto; | ||
window.addEventListener; | ||
XMLHttpRequest; | ||
} catch (e) { | ||
console.error( | ||
new Error( | ||
[ | ||
e.message || "", | ||
"Backtrace-JS requires a standard web-browser window object.", | ||
"Consider Backtrace-Node for non web-browser based javascript applications" | ||
].join("\n") | ||
).stack | ||
); | ||
return false; | ||
} | ||
return true; | ||
} | ||
function initialize(options) { | ||
if (!validateWindow()) return; | ||
options = options || {}; | ||
@@ -44,2 +68,4 @@ | ||
crypto = window.crypto || window.msCrypto; | ||
var disableGlobalHandler = !!options.disableGlobalHandler; | ||
@@ -100,4 +126,4 @@ var handlePromises = !!options.handlePromises; | ||
"user.agent": navigator.userAgent, | ||
"hostname": window.location && window.location.hostname, | ||
"referer": window.location && window.location.href | ||
hostname: window.location && window.location.hostname, | ||
referer: window.location && window.location.href | ||
}, | ||
@@ -104,0 +130,0 @@ userAttributes |
{ | ||
"name": "backtrace-js", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Backtrace.io error reporting tool for client-side applications", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13248
375