diff options
author | Sam Potts <sam@potts.es> | 2018-03-30 00:11:48 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-03-30 00:11:48 +1100 |
commit | d7141d5ed70492b084f4cdff9c200f959f149ef7 (patch) | |
tree | 8fe099cbf5413d9c1f8051a1b0a9c9013f649550 /demo/dist/demo.js | |
parent | 0d0ece94d30fc7eb946174703c487012062c57df (diff) | |
download | plyr-d7141d5ed70492b084f4cdff9c200f959f149ef7.tar.lz plyr-d7141d5ed70492b084f4cdff9c200f959f149ef7.tar.xz plyr-d7141d5ed70492b084f4cdff9c200f959f149ef7.zip |
Controls docs, package upgrades
Diffstat (limited to 'demo/dist/demo.js')
-rw-r--r-- | demo/dist/demo.js | 717 |
1 files changed, 459 insertions, 258 deletions
diff --git a/demo/dist/demo.js b/demo/dist/demo.js index f9bf22e9..46a0c9c5 100644 --- a/demo/dist/demo.js +++ b/demo/dist/demo.js @@ -3,10 +3,6 @@ var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - - - function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } @@ -87,19 +83,29 @@ function serializer(replacer, cycleReplacer) { }; } }); +var stringify_2 = stringify_1.getSerialize; -var _window$3 = + +var stringify = Object.freeze({ + default: stringify_1, + __moduleExports: stringify_1, + getSerialize: stringify_2 +}); + +var stringify$1 = ( stringify && stringify_1 ) || stringify; + +var _window = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {}; -function isObject$1(what) { +function isObject(what) { return typeof what === 'object' && what !== null; } // Yanked from https://git.io/vS8DV re-used under CC0 // with some tiny modifications -function isError$1(value) { +function isError(value) { switch ({}.toString.call(value)) { case '[object Error]': return true; @@ -112,32 +118,32 @@ function isError$1(value) { } } -function isErrorEvent$1(value) { +function isErrorEvent(value) { return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]'; } -function isUndefined$1(what) { +function isUndefined(what) { return what === void 0; } -function isFunction$1(what) { +function isFunction(what) { return typeof what === 'function'; } -function isPlainObject$1(what) { +function isPlainObject(what) { return Object.prototype.toString.call(what) === '[object Object]'; } -function isString$1(what) { +function isString(what) { return Object.prototype.toString.call(what) === '[object String]'; } -function isArray$1(what) { +function isArray(what) { return Object.prototype.toString.call(what) === '[object Array]'; } -function isEmptyObject$1(what) { - if (!isPlainObject$1(what)) return false; +function isEmptyObject(what) { + if (!isPlainObject(what)) return false; for (var _ in what) { if (what.hasOwnProperty(_)) { @@ -156,8 +162,8 @@ function supportsErrorEvent() { } } -function supportsFetch$1() { - if (!('fetch' in _window$3)) return false; +function supportsFetch() { + if (!('fetch' in _window)) return false; try { new Headers(); // eslint-disable-line no-new @@ -173,8 +179,8 @@ function supportsFetch$1() { // https://caniuse.com/#feat=referrer-policy // It doesn't. And it throw exception instead of ignoring this parameter... // REF: https://github.com/getsentry/raven-js/issues/1233 -function supportsReferrerPolicy$1() { - if (!supportsFetch$1()) return false; +function supportsReferrerPolicy() { + if (!supportsFetch()) return false; try { // eslint-disable-next-line no-new @@ -203,12 +209,12 @@ function wrappedCallback(callback) { return dataCallback; } -function each$1(obj, callback) { +function each(obj, callback) { var i, j; - if (isUndefined$1(obj.length)) { + if (isUndefined(obj.length)) { for (i in obj) { - if (hasKey$1(obj, i)) { + if (hasKey(obj, i)) { callback.call(null, i, obj[i]); } } @@ -222,11 +228,11 @@ function each$1(obj, callback) { } } -function objectMerge$1(obj1, obj2) { +function objectMerge(obj1, obj2) { if (!obj2) { return obj1; } - each$1(obj2, function(key, value) { + each(obj2, function(key, value) { obj1[key] = value; }); return obj1; @@ -240,14 +246,14 @@ function objectMerge$1(obj1, obj2) { * supported because it's not relevant for other "platforms". See related issue: * https://github.com/getsentry/react-native-sentry/issues/57 */ -function objectFrozen$1(obj) { +function objectFrozen(obj) { if (!Object.isFrozen) { return false; } return Object.isFrozen(obj); } -function truncate$1(str, max) { +function truncate(str, max) { return !max || str.length <= max ? str : str.substr(0, max) + '\u2026'; } @@ -258,11 +264,11 @@ function truncate$1(str, max) { * @param {Object} host object to check property * @param {string} key to check */ -function hasKey$1(object, key) { +function hasKey(object, key) { return Object.prototype.hasOwnProperty.call(object, key); } -function joinRegExp$1(patterns) { +function joinRegExp(patterns) { // Combine an array of regular expressions and strings into one large regexp // Be mad. var sources = [], @@ -272,7 +278,7 @@ function joinRegExp$1(patterns) { for (; i < len; i++) { pattern = patterns[i]; - if (isString$1(pattern)) { + if (isString(pattern)) { // If it's a string, we need to escape it // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1')); @@ -285,9 +291,9 @@ function joinRegExp$1(patterns) { return new RegExp(sources.join('|'), 'i'); } -function urlencode$1(o) { +function urlencode(o) { var pairs = []; - each$1(o, function(key, value) { + each(o, function(key, value) { pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); }); return pairs.join('&'); @@ -296,7 +302,7 @@ function urlencode$1(o) { // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B // intentionally using regex and not <a/> href parsing trick because React Native and other // environments where DOM might not be available -function parseUrl$1(url) { +function parseUrl(url) { if (typeof url !== 'string') return {}; var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); @@ -310,10 +316,10 @@ function parseUrl$1(url) { relative: match[5] + query + fragment // everything minus origin }; } -function uuid4$1() { - var crypto = _window$3.crypto || _window$3.msCrypto; +function uuid4() { + var crypto = _window.crypto || _window.msCrypto; - if (!isUndefined$1(crypto) && crypto.getRandomValues) { + if (!isUndefined(crypto) && crypto.getRandomValues) { // Use window.crypto API if available // eslint-disable-next-line no-undef var arr = new Uint16Array(8); @@ -359,7 +365,7 @@ function uuid4$1() { * @param elem * @returns {string} */ -function htmlTreeAsString$1(elem) { +function htmlTreeAsString(elem) { /* eslint no-extra-parens:0*/ var MAX_TRAVERSE_HEIGHT = 5, MAX_OUTPUT_LEN = 80, @@ -416,7 +422,7 @@ function htmlElementAsString(elem) { } className = elem.className; - if (className && isString$1(className)) { + if (className && isString(className)) { classes = className.split(/\s+/); for (i = 0; i < classes.length; i++) { out.push('.' + classes[i]); @@ -444,13 +450,13 @@ function isOnlyOneTruthy(a, b) { * Returns true if both parameters are undefined */ function isBothUndefined(a, b) { - return isUndefined$1(a) && isUndefined$1(b); + return isUndefined(a) && isUndefined(b); } /** * Returns true if the two input exception interfaces have the same content */ -function isSameException$1(ex1, ex2) { +function isSameException(ex1, ex2) { if (isOnlyOneTruthy(ex1, ex2)) return false; ex1 = ex1.values[0]; @@ -461,13 +467,13 @@ function isSameException$1(ex1, ex2) { // in case both stacktraces are undefined, we can't decide so default to false if (isBothUndefined(ex1.stacktrace, ex2.stacktrace)) return false; - return isSameStacktrace$1(ex1.stacktrace, ex2.stacktrace); + return isSameStacktrace(ex1.stacktrace, ex2.stacktrace); } /** * Returns true if the two input stack trace interfaces have the same content */ -function isSameStacktrace$1(stack1, stack2) { +function isSameStacktrace(stack1, stack2) { if (isOnlyOneTruthy(stack1, stack2)) return false; var frames1 = stack1.frames; @@ -499,7 +505,8 @@ function isSameStacktrace$1(stack1, stack2) { * @param replacement replacement function * @param track {optional} record instrumentation to an array */ -function fill$1(obj, name, replacement, track) { +function fill(obj, name, replacement, track) { + if (obj == null) return; var orig = obj[name]; obj[name] = replacement(orig); obj[name].__raven__ = true; @@ -516,7 +523,7 @@ function fill$1(obj, name, replacement, track) { * @returns {string} */ function safeJoin(input, delimiter) { - if (!isArray$1(input)) return ''; + if (!isArray(input)) return ''; var output = []; @@ -572,7 +579,7 @@ function serializeValue(value) { function serializeObject(value, depth) { if (depth === 0) return serializeValue(value); - if (isPlainObject$1(value)) { + if (isPlainObject(value)) { return Object.keys(value).reduce(function(acc, key) { acc[key] = serializeObject(value[key], depth - 1); return acc; @@ -586,22 +593,22 @@ function serializeObject(value, depth) { return serializeValue(value); } -function serializeException$1(ex, depth, maxSize) { - if (!isPlainObject$1(ex)) return ex; +function serializeException(ex, depth, maxSize) { + if (!isPlainObject(ex)) return ex; depth = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_DEPTH : depth; maxSize = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_SIZE : maxSize; var serialized = serializeObject(ex, depth); - if (jsonSize(stringify_1(serialized)) > maxSize) { - return serializeException$1(ex, depth - 1); + if (jsonSize(stringify$1(serialized)) > maxSize) { + return serializeException(ex, depth - 1); } return serialized; } -function serializeKeysForMessage$1(keys, maxLength) { +function serializeKeysForMessage(keys, maxLength) { if (typeof keys === 'number' || typeof keys === 'string') return keys.toString(); if (!Array.isArray(keys)) return ''; @@ -623,39 +630,150 @@ function serializeKeysForMessage$1(keys, maxLength) { return ''; } +function sanitize(input, sanitizeKeys) { + if (!isArray(sanitizeKeys) || (isArray(sanitizeKeys) && sanitizeKeys.length === 0)) + return input; + + var sanitizeRegExp = joinRegExp(sanitizeKeys); + var sanitizeMask = '********'; + var safeInput; + + try { + safeInput = JSON.parse(stringify$1(input)); + } catch (o_O) { + return input; + } + + function sanitizeWorker(workerInput) { + if (isArray(workerInput)) { + return workerInput.map(function(val) { + return sanitizeWorker(val); + }); + } + + if (isPlainObject(workerInput)) { + return Object.keys(workerInput).reduce(function(acc, k) { + if (sanitizeRegExp.test(k)) { + acc[k] = sanitizeMask; + } else { + acc[k] = sanitizeWorker(workerInput[k]); + } + return acc; + }, {}); + } + + return workerInput; + } + + return sanitizeWorker(safeInput); +} + var utils = { - isObject: isObject$1, - isError: isError$1, - isErrorEvent: isErrorEvent$1, - isUndefined: isUndefined$1, - isFunction: isFunction$1, - isPlainObject: isPlainObject$1, - isString: isString$1, - isArray: isArray$1, - isEmptyObject: isEmptyObject$1, + isObject: isObject, + isError: isError, + isErrorEvent: isErrorEvent, + isUndefined: isUndefined, + isFunction: isFunction, + isPlainObject: isPlainObject, + isString: isString, + isArray: isArray, + isEmptyObject: isEmptyObject, supportsErrorEvent: supportsErrorEvent, - supportsFetch: supportsFetch$1, - supportsReferrerPolicy: supportsReferrerPolicy$1, + supportsFetch: supportsFetch, + supportsReferrerPolicy: supportsReferrerPolicy, supportsPromiseRejectionEvent: supportsPromiseRejectionEvent, wrappedCallback: wrappedCallback, - each: each$1, - objectMerge: objectMerge$1, - truncate: truncate$1, - objectFrozen: objectFrozen$1, - hasKey: hasKey$1, - joinRegExp: joinRegExp$1, - urlencode: urlencode$1, - uuid4: uuid4$1, - htmlTreeAsString: htmlTreeAsString$1, + each: each, + objectMerge: objectMerge, + truncate: truncate, + objectFrozen: objectFrozen, + hasKey: hasKey, + joinRegExp: joinRegExp, + urlencode: urlencode, + uuid4: uuid4, + htmlTreeAsString: htmlTreeAsString, htmlElementAsString: htmlElementAsString, - isSameException: isSameException$1, - isSameStacktrace: isSameStacktrace$1, - parseUrl: parseUrl$1, - fill: fill$1, + isSameException: isSameException, + isSameStacktrace: isSameStacktrace, + parseUrl: parseUrl, + fill: fill, safeJoin: safeJoin, - serializeException: serializeException$1, - serializeKeysForMessage: serializeKeysForMessage$1 + serializeException: serializeException, + serializeKeysForMessage: serializeKeysForMessage, + sanitize: sanitize }; +var utils_1 = utils.isObject; +var utils_2 = utils.isError; +var utils_3 = utils.isErrorEvent; +var utils_4 = utils.isUndefined; +var utils_5 = utils.isFunction; +var utils_6 = utils.isPlainObject; +var utils_7 = utils.isString; +var utils_8 = utils.isArray; +var utils_9 = utils.isEmptyObject; +var utils_10 = utils.supportsErrorEvent; +var utils_11 = utils.supportsFetch; +var utils_12 = utils.supportsReferrerPolicy; +var utils_13 = utils.supportsPromiseRejectionEvent; +var utils_14 = utils.wrappedCallback; +var utils_15 = utils.each; +var utils_16 = utils.objectMerge; +var utils_17 = utils.truncate; +var utils_18 = utils.objectFrozen; +var utils_19 = utils.hasKey; +var utils_20 = utils.joinRegExp; +var utils_21 = utils.urlencode; +var utils_22 = utils.uuid4; +var utils_23 = utils.htmlTreeAsString; +var utils_24 = utils.htmlElementAsString; +var utils_25 = utils.isSameException; +var utils_26 = utils.isSameStacktrace; +var utils_27 = utils.parseUrl; +var utils_28 = utils.fill; +var utils_29 = utils.safeJoin; +var utils_30 = utils.serializeException; +var utils_31 = utils.serializeKeysForMessage; +var utils_32 = utils.sanitize; + + +var utils$1 = Object.freeze({ + default: utils, + __moduleExports: utils, + isObject: utils_1, + isError: utils_2, + isErrorEvent: utils_3, + isUndefined: utils_4, + isFunction: utils_5, + isPlainObject: utils_6, + isString: utils_7, + isArray: utils_8, + isEmptyObject: utils_9, + supportsErrorEvent: utils_10, + supportsFetch: utils_11, + supportsReferrerPolicy: utils_12, + supportsPromiseRejectionEvent: utils_13, + wrappedCallback: utils_14, + each: utils_15, + objectMerge: utils_16, + truncate: utils_17, + objectFrozen: utils_18, + hasKey: utils_19, + joinRegExp: utils_20, + urlencode: utils_21, + uuid4: utils_22, + htmlTreeAsString: utils_23, + htmlElementAsString: utils_24, + isSameException: utils_25, + isSameStacktrace: utils_26, + parseUrl: utils_27, + fill: utils_28, + safeJoin: utils_29, + serializeException: utils_30, + serializeKeysForMessage: utils_31, + sanitize: utils_32 +}); + +var utils$2 = ( utils$1 && utils ) || utils$1; /* TraceKit - Cross brower stack traces @@ -673,7 +791,7 @@ var TraceKit = { }; // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) -var _window$2 = +var _window$1 = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {}; @@ -805,9 +923,9 @@ TraceKit.report = (function reportModuleWrapper() { function traceKitWindowOnError(msg, url, lineNo, colNo, ex) { var stack = null; // If 'ex' is ErrorEvent, get real Error from inside - var exception = utils.isErrorEvent(ex) ? ex.error : ex; + var exception = utils$2.isErrorEvent(ex) ? ex.error : ex; // If 'msg' is ErrorEvent, get real message from inside - var message = utils.isErrorEvent(msg) ? msg.message : msg; + var message = utils$2.isErrorEvent(msg) ? msg.message : msg; if (lastExceptionStack) { TraceKit.computeStackTrace.augmentStackTraceWithInitialElement( @@ -817,7 +935,7 @@ TraceKit.report = (function reportModuleWrapper() { message ); processLastException(); - } else if (exception && utils.isError(exception)) { + } else if (exception && utils$2.isError(exception)) { // non-string `exception` arg; attempt to extract stack trace // New chrome and blink send along a real error object @@ -865,8 +983,8 @@ TraceKit.report = (function reportModuleWrapper() { if (_onErrorHandlerInstalled) { return; } - _oldOnerrorHandler = _window$2.onerror; - _window$2.onerror = traceKitWindowOnError; + _oldOnerrorHandler = _window$1.onerror; + _window$1.onerror = traceKitWindowOnError; _onErrorHandlerInstalled = true; } @@ -874,7 +992,7 @@ TraceKit.report = (function reportModuleWrapper() { if (!_onErrorHandlerInstalled) { return; } - _window$2.onerror = _oldOnerrorHandler; + _window$1.onerror = _oldOnerrorHandler; _onErrorHandlerInstalled = false; _oldOnerrorHandler = undefined; } @@ -1284,6 +1402,12 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() { var tracekit = TraceKit; + +var tracekit$1 = Object.freeze({ + default: tracekit, + __moduleExports: tracekit +}); + /* * JavaScript MD5 * https://github.com/blueimp/JavaScript-MD5 @@ -1551,6 +1675,12 @@ function md5(string, key, raw) { var md5_1 = md5; + +var md5$1 = Object.freeze({ + default: md5_1, + __moduleExports: md5_1 +}); + function RavenConfigError(message) { this.name = 'RavenConfigError'; this.message = message; @@ -1560,6 +1690,12 @@ RavenConfigError.prototype.constructor = RavenConfigError; var configError = RavenConfigError; + +var configError$1 = Object.freeze({ + default: configError, + __moduleExports: configError +}); + var wrapMethod = function(console, level, callback) { var originalConsoleLevel = console[level]; var originalConsole = console; @@ -1573,14 +1709,14 @@ var wrapMethod = function(console, level, callback) { console[level] = function() { var args = [].slice.call(arguments); - var msg = utils.safeJoin(args, ' '); + var msg = utils$2.safeJoin(args, ' '); var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}}; if (level === 'assert') { if (args[0] === false) { // Default browsers message msg = - 'Assertion failed: ' + (utils.safeJoin(args.slice(1), ' ') || 'console.assert'); + 'Assertion failed: ' + (utils$2.safeJoin(args.slice(1), ' ') || 'console.assert'); data.extra.arguments = args.slice(1); callback && callback(msg, data); } @@ -1600,6 +1736,22 @@ var wrapMethod = function(console, level, callback) { var console$1 = { wrapMethod: wrapMethod }; +var console_1 = console$1.wrapMethod; + + +var console$2 = Object.freeze({ + default: console$1, + __moduleExports: console$1, + wrapMethod: console_1 +}); + +var TraceKit$1 = ( tracekit$1 && tracekit ) || tracekit$1; + +var md5$2 = ( md5$1 && md5_1 ) || md5$1; + +var RavenConfigError$1 = ( configError$1 && configError ) || configError$1; + +var require$$0 = ( console$2 && console$1 ) || console$2; /*global XDomainRequest:false */ @@ -1609,52 +1761,53 @@ var console$1 = { -var isError = utils.isError; -var isObject = utils.isObject; -var isPlainObject = utils.isPlainObject; -var isErrorEvent = utils.isErrorEvent; -var isUndefined = utils.isUndefined; -var isFunction = utils.isFunction; -var isString = utils.isString; -var isArray = utils.isArray; -var isEmptyObject = utils.isEmptyObject; -var each = utils.each; -var objectMerge = utils.objectMerge; -var truncate = utils.truncate; -var objectFrozen = utils.objectFrozen; -var hasKey = utils.hasKey; -var joinRegExp = utils.joinRegExp; -var urlencode = utils.urlencode; -var uuid4 = utils.uuid4; -var htmlTreeAsString = utils.htmlTreeAsString; -var isSameException = utils.isSameException; -var isSameStacktrace = utils.isSameStacktrace; -var parseUrl = utils.parseUrl; -var fill = utils.fill; -var supportsFetch = utils.supportsFetch; -var supportsReferrerPolicy = utils.supportsReferrerPolicy; -var serializeKeysForMessage = utils.serializeKeysForMessage; -var serializeException = utils.serializeException; +var isError$1 = utils$2.isError; +var isObject$1 = utils$2.isObject; +var isPlainObject$1 = utils$2.isPlainObject; +var isErrorEvent$1 = utils$2.isErrorEvent; +var isUndefined$1 = utils$2.isUndefined; +var isFunction$1 = utils$2.isFunction; +var isString$1 = utils$2.isString; +var isArray$1 = utils$2.isArray; +var isEmptyObject$1 = utils$2.isEmptyObject; +var each$1 = utils$2.each; +var objectMerge$1 = utils$2.objectMerge; +var truncate$1 = utils$2.truncate; +var objectFrozen$1 = utils$2.objectFrozen; +var hasKey$1 = utils$2.hasKey; +var joinRegExp$1 = utils$2.joinRegExp; +var urlencode$1 = utils$2.urlencode; +var uuid4$1 = utils$2.uuid4; +var htmlTreeAsString$1 = utils$2.htmlTreeAsString; +var isSameException$1 = utils$2.isSameException; +var isSameStacktrace$1 = utils$2.isSameStacktrace; +var parseUrl$1 = utils$2.parseUrl; +var fill$1 = utils$2.fill; +var supportsFetch$1 = utils$2.supportsFetch; +var supportsReferrerPolicy$1 = utils$2.supportsReferrerPolicy; +var serializeKeysForMessage$1 = utils$2.serializeKeysForMessage; +var serializeException$1 = utils$2.serializeException; +var sanitize$1 = utils$2.sanitize; -var wrapConsoleMethod = console$1.wrapMethod; +var wrapConsoleMethod = require$$0.wrapMethod; -var dsnKeys = 'source protocol user pass host port path'.split(' '); -var dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/; +var dsnKeys = 'source protocol user pass host port path'.split(' '), + dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/; function now() { return +new Date(); } // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) -var _window$1 = +var _window$2 = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {}; -var _document = _window$1.document; -var _navigator = _window$1.navigator; +var _document = _window$2.document; +var _navigator = _window$2.navigator; function keepOriginalCallback(original, callback) { - return isFunction(callback) + return isFunction$1(callback) ? function(data) { return callback(data, original); } @@ -1664,11 +1817,11 @@ function keepOriginalCallback(original, callback) { // First, check for JSON support // If there is no JSON, we no-op the core features of Raven // since JSON is required to encode the payload -function Raven$2() { +function Raven() { this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify); // Raven can run in contexts where there's no document (react-native) - this._hasDocument = !isUndefined(_document); - this._hasNavigator = !isUndefined(_navigator); + this._hasDocument = !isUndefined$1(_document); + this._hasNavigator = !isUndefined$1(_navigator); this._lastCapturedException = null; this._lastData = null; this._lastEventId = null; @@ -1678,7 +1831,7 @@ function Raven$2() { this._globalContext = {}; this._globalOptions = { // SENTRY_RELEASE can be injected by https://github.com/getsentry/sentry-webpack-plugin - release: _window$1.SENTRY_RELEASE && _window$1.SENTRY_RELEASE.id, + release: _window$2.SENTRY_RELEASE && _window$2.SENTRY_RELEASE.id, logger: 'javascript', ignoreErrors: [], ignoreUrls: [], @@ -1688,13 +1841,13 @@ function Raven$2() { collectWindowErrors: true, captureUnhandledRejections: true, maxMessageLength: 0, - // By default, truncates URL values to 250 chars maxUrlLength: 250, stackTraceLimit: 50, autoBreadcrumbs: true, instrument: true, - sampleRate: 1 + sampleRate: 1, + sanitizeKeys: [] }; this._fetchDefaults = { method: 'POST', @@ -1703,14 +1856,14 @@ function Raven$2() { // https://caniuse.com/#feat=referrer-policy // It doesn't. And it throw exception instead of ignoring this parameter... // REF: https://github.com/getsentry/raven-js/issues/1233 - referrerPolicy: supportsReferrerPolicy() ? 'origin' : '' + referrerPolicy: supportsReferrerPolicy$1() ? 'origin' : '' }; this._ignoreOnError = 0; this._isRavenInstalled = false; this._originalErrorStackTraceLimit = Error.stackTraceLimit; // capture references to window.console *and* all its methods first // before the console plugin has a chance to monkey patch - this._originalConsole = _window$1.console || {}; + this._originalConsole = _window$2.console || {}; this._originalConsoleMethods = {}; this._plugins = []; this._startTime = now(); @@ -1718,7 +1871,7 @@ function Raven$2() { this._breadcrumbs = []; this._lastCapturedEvent = null; this._keypressTimeout; - this._location = _window$1.location; + this._location = _window$2.location; this._lastHref = this._location && this._location.href; this._resetBackoff(); @@ -1734,16 +1887,16 @@ function Raven$2() { * @this {Raven} */ -Raven$2.prototype = { +Raven.prototype = { // Hardcode version string so that raven source can be loaded directly via // webpack (using a build step causes webpack #1617). Grunt verifies that // this value matches package.json during build. // See: https://github.com/getsentry/raven-js/issues/465 - VERSION: '3.23.3', + VERSION: '3.24.0', debug: false, - TraceKit: tracekit, // alias to TraceKit + TraceKit: TraceKit$1, // alias to TraceKit /* * Configure Raven with a DSN and extra options @@ -1765,7 +1918,7 @@ Raven$2.prototype = { // merge in options if (options) { - each(options, function(key, value) { + each$1(options, function(key, value) { // tags and extra are special and need to be put into context if (key === 'tags' || key === 'extra' || key === 'user') { self._globalContext[key] = value; @@ -1783,14 +1936,14 @@ Raven$2.prototype = { globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/); // join regexp rules into one big rule - globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors); + globalOptions.ignoreErrors = joinRegExp$1(globalOptions.ignoreErrors); globalOptions.ignoreUrls = globalOptions.ignoreUrls.length - ? joinRegExp(globalOptions.ignoreUrls) + ? joinRegExp$1(globalOptions.ignoreUrls) : false; globalOptions.whitelistUrls = globalOptions.whitelistUrls.length - ? joinRegExp(globalOptions.whitelistUrls) + ? joinRegExp$1(globalOptions.whitelistUrls) : false; - globalOptions.includePaths = joinRegExp(globalOptions.includePaths); + globalOptions.includePaths = joinRegExp$1(globalOptions.includePaths); globalOptions.maxBreadcrumbs = Math.max( 0, Math.min(globalOptions.maxBreadcrumbs || 100, 100) @@ -1806,7 +1959,7 @@ Raven$2.prototype = { var autoBreadcrumbs = globalOptions.autoBreadcrumbs; if ({}.toString.call(autoBreadcrumbs) === '[object Object]') { - autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs); + autoBreadcrumbs = objectMerge$1(autoBreadcrumbDefaults, autoBreadcrumbs); } else if (autoBreadcrumbs !== false) { autoBreadcrumbs = autoBreadcrumbDefaults; } @@ -1818,13 +1971,13 @@ Raven$2.prototype = { var instrument = globalOptions.instrument; if ({}.toString.call(instrument) === '[object Object]') { - instrument = objectMerge(instrumentDefaults, instrument); + instrument = objectMerge$1(instrumentDefaults, instrument); } else if (instrument !== false) { instrument = instrumentDefaults; } globalOptions.instrument = instrument; - tracekit.collectWindowErrors = !!globalOptions.collectWindowErrors; + TraceKit$1.collectWindowErrors = !!globalOptions.collectWindowErrors; // return for chaining return self; @@ -1841,7 +1994,7 @@ Raven$2.prototype = { install: function() { var self = this; if (self.isSetup() && !self._isRavenInstalled) { - tracekit.report.subscribe(function() { + TraceKit$1.report.subscribe(function() { self._handleOnErrorStackInfo.apply(self, arguments); }); @@ -1902,7 +2055,7 @@ Raven$2.prototype = { * @param {array} args An array of arguments to be called with the callback [optional] */ context: function(options, func, args) { - if (isFunction(options)) { + if (isFunction$1(options)) { args = func || []; func = options; options = undefined; @@ -1923,19 +2076,19 @@ Raven$2.prototype = { var self = this; // 1 argument has been passed, and it's not a function // so just return it - if (isUndefined(func) && !isFunction(options)) { + if (isUndefined$1(func) && !isFunction$1(options)) { return options; } // options is optional - if (isFunction(options)) { + if (isFunction$1(options)) { func = options; options = undefined; } // At this point, we've passed along 2 arguments, and the second one // is not a function either, so we'll just return the second argument. - if (!isFunction(func)) { + if (!isFunction$1(func)) { return func; } @@ -1961,7 +2114,7 @@ Raven$2.prototype = { i = arguments.length, deep = !options || (options && options.deep !== false); - if (_before && isFunction(_before)) { + if (_before && isFunction$1(_before)) { _before.apply(this, arguments); } @@ -1984,7 +2137,7 @@ Raven$2.prototype = { // copy over properties of the old function for (var property in func) { - if (hasKey(func, property)) { + if (hasKey$1(func, property)) { wrapped[property] = func[property]; } } @@ -2005,7 +2158,7 @@ Raven$2.prototype = { * @return {Raven} */ uninstall: function() { - tracekit.report.uninstall(); + TraceKit$1.report.uninstall(); this._detachPromiseRejectionHandler(); this._unpatchFunctionToString(); @@ -2038,8 +2191,8 @@ Raven$2.prototype = { */ _attachPromiseRejectionHandler: function() { this._promiseRejectionHandler = this._promiseRejectionHandler.bind(this); - _window$1.addEventListener && - _window$1.addEventListener('unhandledrejection', this._promiseRejectionHandler); + _window$2.addEventListener && + _window$2.addEventListener('unhandledrejection', this._promiseRejectionHandler); return this; }, @@ -2049,8 +2202,8 @@ Raven$2.prototype = { * @return {raven} */ _detachPromiseRejectionHandler: function() { - _window$1.removeEventListener && - _window$1.removeEventListener('unhandledrejection', this._promiseRejectionHandler); + _window$2.removeEventListener && + _window$2.removeEventListener('unhandledrejection', this._promiseRejectionHandler); return this; }, @@ -2062,15 +2215,15 @@ Raven$2.prototype = { * @return {Raven} */ captureException: function(ex, options) { - options = objectMerge({trimHeadFrames: 0}, options ? options : {}); + options = objectMerge$1({trimHeadFrames: 0}, options ? options : {}); - if (isErrorEvent(ex) && ex.error) { + if (isErrorEvent$1(ex) && ex.error) { // If it is an ErrorEvent with `error` property, extract it to get actual Error ex = ex.error; - } else if (isError(ex)) { + } else if (isError$1(ex)) { // we have a real Error object ex = ex; - } else if (isPlainObject(ex)) { + } else if (isPlainObject$1(ex)) { // If it is plain Object, serialize it manually and extract options // This will allow us to group events based on top-level keys // which is much better than creating new group when any key/value change @@ -2084,7 +2237,7 @@ Raven$2.prototype = { // So bail out and capture it as a simple message: return this.captureMessage( ex, - objectMerge(options, { + objectMerge$1(options, { stacktrace: true, // if we fall back to captureMessage, default to attempting a new trace trimHeadFrames: options.trimHeadFrames + 1 }) @@ -2100,7 +2253,7 @@ Raven$2.prototype = { // raises an exception different from the one we asked to // report on. try { - var stack = tracekit.computeStackTrace(ex); + var stack = TraceKit$1.computeStackTrace(ex); this._handleStackInfo(stack, options); } catch (ex1) { if (ex !== ex1) { @@ -2113,13 +2266,13 @@ Raven$2.prototype = { _getCaptureExceptionOptionsFromPlainObject: function(currentOptions, ex) { var exKeys = Object.keys(ex).sort(); - var options = objectMerge(currentOptions, { + var options = objectMerge$1(currentOptions, { message: - 'Non-Error exception captured with keys: ' + serializeKeysForMessage(exKeys), - fingerprint: [md5_1(exKeys)], + 'Non-Error exception captured with keys: ' + serializeKeysForMessage$1(exKeys), + fingerprint: [md5$2(exKeys)], extra: currentOptions.extra || {} }); - options.extra.__serialized__ = serializeException(ex); + options.extra.__serialized__ = serializeException$1(ex); return options; }, @@ -2145,7 +2298,7 @@ Raven$2.prototype = { options = options || {}; msg = msg + ''; // Make sure it's actually a string - var data = objectMerge( + var data = objectMerge$1( { message: msg }, @@ -2165,10 +2318,10 @@ Raven$2.prototype = { // null exception name so `Error` isn't prefixed to msg ex.name = null; - var stack = tracekit.computeStackTrace(ex); + var stack = TraceKit$1.computeStackTrace(ex); // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1] - var initialCall = isArray(stack.stack) && stack.stack[1]; + var initialCall = isArray$1(stack.stack) && stack.stack[1]; var fileurl = (initialCall && initialCall.url) || ''; if ( @@ -2189,7 +2342,7 @@ Raven$2.prototype = { // fingerprint on msg, not stack trace (legacy behavior, could be revisited) data.fingerprint = data.fingerprint == null ? msg : data.fingerprint; - options = objectMerge( + options = objectMerge$1( { trimHeadFrames: 0 }, @@ -2210,7 +2363,7 @@ Raven$2.prototype = { // Make sure that fingerprint is always wrapped in an array if (data.fingerprint) { - data.fingerprint = isArray(data.fingerprint) + data.fingerprint = isArray$1(data.fingerprint) ? data.fingerprint : [data.fingerprint]; } @@ -2222,17 +2375,17 @@ Raven$2.prototype = { }, captureBreadcrumb: function(obj) { - var crumb = objectMerge( + var crumb = objectMerge$1( { timestamp: now() / 1000 }, obj ); - if (isFunction(this._globalOptions.breadcrumbCallback)) { + if (isFunction$1(this._globalOptions.breadcrumbCallback)) { var result = this._globalOptions.breadcrumbCallback(crumb); - if (isObject(result) && !isEmptyObject(result)) { + if (isObject$1(result) && !isEmptyObject$1(result)) { crumb = result; } else if (result === false) { return this; @@ -2312,7 +2465,7 @@ Raven$2.prototype = { */ getContext: function() { // lol javascript - return JSON.parse(stringify_1(this._globalContext)); + return JSON.parse(stringify$1(this._globalContext)); }, /* @@ -2432,7 +2585,7 @@ Raven$2.prototype = { // TODO: remove window dependence? // Attempt to initialize Raven on load - var RavenConfig = _window$1.RavenConfig; + var RavenConfig = _window$2.RavenConfig; if (RavenConfig) { this.config(RavenConfig.dsn, RavenConfig.config).install(); } @@ -2448,12 +2601,12 @@ Raven$2.prototype = { var lastEventId = options.eventId || this.lastEventId(); if (!lastEventId) { - throw new configError('Missing eventId'); + throw new RavenConfigError$1('Missing eventId'); } var dsn = options.dsn || this._dsn; if (!dsn) { - throw new configError('Missing DSN'); + throw new RavenConfigError$1('Missing DSN'); } var encode = encodeURIComponent; @@ -2504,7 +2657,7 @@ Raven$2.prototype = { } for (key in options) - if (hasKey(options, key)) { + if (hasKey$1(options, key)) { evt[key] = options[key]; } @@ -2549,7 +2702,7 @@ Raven$2.prototype = { // can throw an exception in some circumstances. var target; try { - target = htmlTreeAsString(evt.target); + target = htmlTreeAsString$1(evt.target); } catch (e) { target = '<unknown>'; } @@ -2613,9 +2766,9 @@ Raven$2.prototype = { * @private */ _captureUrlChange: function(from, to) { - var parsedLoc = parseUrl(this._location.href); - var parsedTo = parseUrl(to); - var parsedFrom = parseUrl(from); + var parsedLoc = parseUrl$1(this._location.href); + var parsedTo = parseUrl$1(to); + var parsedFrom = parseUrl$1(from); // because onpopstate only tells you the "new" (to) value of location.href, and // not the previous (from) value, we need to track the value of the current URL @@ -2676,7 +2829,7 @@ Raven$2.prototype = { args[i] = arguments[i]; } var originalCallback = args[0]; - if (isFunction(originalCallback)) { + if (isFunction$1(originalCallback)) { args[0] = self.wrap(originalCallback); } @@ -2694,9 +2847,9 @@ Raven$2.prototype = { var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs; function wrapEventTarget(global) { - var proto = _window$1[global] && _window$1[global].prototype; + var proto = _window$2[global] && _window$2[global].prototype; if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) { - fill( + fill$1( proto, 'addEventListener', function(orig) { @@ -2752,7 +2905,7 @@ Raven$2.prototype = { }, wrappedBuiltIns ); - fill( + fill$1( proto, 'removeEventListener', function(orig) { @@ -2770,11 +2923,11 @@ Raven$2.prototype = { } } - fill(_window$1, 'setTimeout', wrapTimeFn, wrappedBuiltIns); - fill(_window$1, 'setInterval', wrapTimeFn, wrappedBuiltIns); - if (_window$1.requestAnimationFrame) { - fill( - _window$1, + fill$1(_window$2, 'setTimeout', wrapTimeFn, wrappedBuiltIns); + fill$1(_window$2, 'setInterval', wrapTimeFn, wrappedBuiltIns); + if (_window$2.requestAnimationFrame) { + fill$1( + _window$2, 'requestAnimationFrame', function(orig) { return function(cb) { @@ -2839,16 +2992,16 @@ Raven$2.prototype = { var wrappedBuiltIns = self._wrappedBuiltIns; function wrapProp(prop, xhr) { - if (prop in xhr && isFunction(xhr[prop])) { - fill(xhr, prop, function(orig) { + if (prop in xhr && isFunction$1(xhr[prop])) { + fill$1(xhr, prop, function(orig) { return self.wrap(orig); }); // intentionally don't track filled methods on XHR instances } } - if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window$1) { - var xhrproto = XMLHttpRequest.prototype; - fill( + if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window$2) { + var xhrproto = _window$2.XMLHttpRequest && _window$2.XMLHttpRequest.prototype; + fill$1( xhrproto, 'open', function(origOpen) { @@ -2856,7 +3009,7 @@ Raven$2.prototype = { // preserve arity // if Sentry key appears in URL, don't capture - if (isString(url) && url.indexOf(self._globalKey) === -1) { + if (isString$1(url) && url.indexOf(self._globalKey) === -1) { this.__raven_xhr = { method: method, url: url, @@ -2870,7 +3023,7 @@ Raven$2.prototype = { wrappedBuiltIns ); - fill( + fill$1( xhrproto, 'send', function(origSend) { @@ -2901,8 +3054,8 @@ Raven$2.prototype = { wrapProp(props[j], xhr); } - if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) { - fill( + if ('onreadystatechange' in xhr && isFunction$1(xhr.onreadystatechange)) { + fill$1( xhr, 'onreadystatechange', function(orig) { @@ -2922,9 +3075,9 @@ Raven$2.prototype = { ); } - if (autoBreadcrumbs.xhr && supportsFetch()) { - fill( - _window$1, + if (autoBreadcrumbs.xhr && supportsFetch$1()) { + fill$1( + _window$2, 'fetch', function(origFetch) { return function() { @@ -2942,7 +3095,7 @@ Raven$2.prototype = { if (typeof fetchInput === 'string') { url = fetchInput; - } else if ('Request' in _window$1 && fetchInput instanceof _window$1.Request) { + } else if ('Request' in _window$2 && fetchInput instanceof _window$2.Request) { url = fetchInput.url; if (fetchInput.method) { method = fetchInput.method; @@ -3000,17 +3153,17 @@ Raven$2.prototype = { // NOTE: in Chrome App environment, touching history.pushState, *even inside // a try/catch block*, will cause Chrome to output an error to console.error // borrowed from: https://github.com/angular/angular.js/pull/13945/files - var chrome = _window$1.chrome; + var chrome = _window$2.chrome; var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; var hasPushAndReplaceState = !isChromePackagedApp && - _window$1.history && + _window$2.history && history.pushState && history.replaceState; if (autoBreadcrumbs.location && hasPushAndReplaceState) { // TODO: remove onpopstate handler on uninstall() - var oldOnPopState = _window$1.onpopstate; - _window$1.onpopstate = function() { + var oldOnPopState = _window$2.onpopstate; + _window$2.onpopstate = function() { var currentHref = self._location.href; self._captureUrlChange(self._lastHref, currentHref); @@ -3035,11 +3188,11 @@ Raven$2.prototype = { }; }; - fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns); - fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns); + fill$1(history, 'pushState', historyReplacementFunction, wrappedBuiltIns); + fill$1(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns); } - if (autoBreadcrumbs.console && 'console' in _window$1 && console.log) { + if (autoBreadcrumbs.console && 'console' in _window$2 && console.log) { // console var consoleMethodCallback = function(msg, data) { self.captureBreadcrumb({ @@ -3049,7 +3202,7 @@ Raven$2.prototype = { }); }; - each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) { + each$1(['debug', 'info', 'warn', 'error', 'log'], function(_, level) { wrapConsoleMethod(console, level, consoleMethodCallback); }); } @@ -3080,7 +3233,7 @@ Raven$2.prototype = { var self = this; // FIX ME TODO - each(this._plugins, function(_, plugin) { + each$1(this._plugins, function(_, plugin) { var installer = plugin[0]; var args = plugin[1]; installer.apply(self, [self].concat(args)); @@ -3095,11 +3248,11 @@ Raven$2.prototype = { try { while (i--) dsn[dsnKeys[i]] = m[i] || ''; } catch (e) { - throw new configError('Invalid DSN: ' + str); + throw new RavenConfigError$1('Invalid DSN: ' + str); } if (dsn.pass && !this._globalOptions.allowSecretKey) { - throw new configError( + throw new RavenConfigError$1( 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key' ); } @@ -3146,7 +3299,7 @@ Raven$2.prototype = { var self = this; var frames = []; if (stackInfo.stack && stackInfo.stack.length) { - each(stackInfo.stack, function(i, stack) { + each$1(stackInfo.stack, function(i, stack) { var frame = self._normalizeFrame(stack, stackInfo.url); if (frame) { frames.push(frame); @@ -3240,7 +3393,7 @@ Raven$2.prototype = { return; } - var data = objectMerge( + var data = objectMerge$1( { // sentry.interfaces.Exception exception: { @@ -3266,20 +3419,20 @@ Raven$2.prototype = { // but this could/should be expanded to just trim everything var max = this._globalOptions.maxMessageLength; if (data.message) { - data.message = truncate(data.message, max); + data.message = truncate$1(data.message, max); } if (data.exception) { var exception = data.exception.values[0]; - exception.value = truncate(exception.value, max); + exception.value = truncate$1(exception.value, max); } var request = data.request; if (request) { if (request.url) { - request.url = truncate(request.url, this._globalOptions.maxUrlLength); + request.url = truncate$1(request.url, this._globalOptions.maxUrlLength); } if (request.Referer) { - request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength); + request.Referer = truncate$1(request.Referer, this._globalOptions.maxUrlLength); } } @@ -3304,16 +3457,16 @@ Raven$2.prototype = { crumb = breadcrumbs.values[i]; if ( !crumb.hasOwnProperty('data') || - !isObject(crumb.data) || - objectFrozen(crumb.data) + !isObject$1(crumb.data) || + objectFrozen$1(crumb.data) ) continue; - data = objectMerge({}, crumb.data); + data = objectMerge$1({}, crumb.data); for (var j = 0; j < urlProps.length; ++j) { urlProp = urlProps[j]; if (data.hasOwnProperty(urlProp) && data[urlProp]) { - data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength); + data[urlProp] = truncate$1(data[urlProp], this._globalOptions.maxUrlLength); } } breadcrumbs.values[i].data = data; @@ -3331,8 +3484,8 @@ Raven$2.prototype = { } // Check in `window` instead of `document`, as we may be in ServiceWorker environment - if (_window$1.location && _window$1.location.href) { - httpData.url = _window$1.location.href; + if (_window$2.location && _window$2.location.href) { + httpData.url = _window$2.location.href; } if (this._hasDocument && _document.referrer) { @@ -3373,10 +3526,10 @@ Raven$2.prototype = { // Stacktrace interface (i.e. from captureMessage) if (current.stacktrace || last.stacktrace) { - return isSameStacktrace(current.stacktrace, last.stacktrace); + return isSameStacktrace$1(current.stacktrace, last.stacktrace); } else if (current.exception || last.exception) { // Exception interface (i.e. from captureException/onerror) - return isSameException(current.exception, last.exception); + return isSameException$1(current.exception, last.exception); } return true; @@ -3399,7 +3552,7 @@ Raven$2.prototype = { try { // If Retry-After is not in Access-Control-Expose-Headers, most // browsers will throw an exception trying to access it - if (supportsFetch()) { + if (supportsFetch$1()) { retry = request.headers.get('Retry-After'); } else { retry = request.getResponseHeader('Retry-After'); @@ -3437,11 +3590,11 @@ Raven$2.prototype = { // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload if (data.trimHeadFrames) delete data.trimHeadFrames; - data = objectMerge(baseData, data); + data = objectMerge$1(baseData, data); // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge - data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags); - data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra); + data.tags = objectMerge$1(objectMerge$1({}, this._globalContext.tags), data.tags); + data.extra = objectMerge$1(objectMerge$1({}, this._globalContext.extra), data.extra); // Send along our own collected metadata with extra data.extra['session:duration'] = now() - this._startTime; @@ -3468,25 +3621,27 @@ Raven$2.prototype = { // Include server_name if it's defined in globalOptions if (globalOptions.serverName) data.server_name = globalOptions.serverName; + data = this._sanitizeData(data); + // Cleanup empty properties before sending them to the server Object.keys(data).forEach(function(key) { - if (data[key] == null || data[key] === '' || isEmptyObject(data[key])) { + if (data[key] == null || data[key] === '' || isEmptyObject$1(data[key])) { delete data[key]; } }); - if (isFunction(globalOptions.dataCallback)) { + if (isFunction$1(globalOptions.dataCallback)) { data = globalOptions.dataCallback(data) || data; } // Why?????????? - if (!data || isEmptyObject(data)) { + if (!data || isEmptyObject$1(data)) { return; } // Check if the request should be filtered or not if ( - isFunction(globalOptions.shouldSendCallback) && + isFunction$1(globalOptions.shouldSendCallback) && !globalOptions.shouldSendCallback(data) ) { return; @@ -3508,8 +3663,12 @@ Raven$2.prototype = { } }, + _sanitizeData: function(data) { + return sanitize$1(data, this._globalOptions.sanitizeKeys); + }, + _getUuid: function() { - return uuid4(); + return uuid4$1(); }, _sendProcessedPayload: function(data, callback) { @@ -3600,7 +3759,7 @@ Raven$2.prototype = { _makeRequest: function(opts) { // Auth is intentionally sent as part of query string (NOT as custom HTTP header) to avoid preflight CORS requests - var url = opts.url + '?' + urlencode(opts.auth); + var url = opts.url + '?' + urlencode$1(opts.auth); var evaluatedHeaders = null; var evaluatedFetchParameters = {}; @@ -3613,17 +3772,17 @@ Raven$2.prototype = { evaluatedFetchParameters = this._evaluateHash(opts.options.fetchParameters); } - if (supportsFetch()) { - evaluatedFetchParameters.body = stringify_1(opts.data); + if (supportsFetch$1()) { + evaluatedFetchParameters.body = stringify$1(opts.data); - var defaultFetchOptions = objectMerge({}, this._fetchDefaults); - var fetchOptions = objectMerge(defaultFetchOptions, evaluatedFetchParameters); + var defaultFetchOptions = objectMerge$1({}, this._fetchDefaults); + var fetchOptions = objectMerge$1(defaultFetchOptions, evaluatedFetchParameters); if (evaluatedHeaders) { fetchOptions.headers = evaluatedHeaders; } - return _window$1 + return _window$2 .fetch(url, fetchOptions) .then(function(response) { if (response.ok) { @@ -3642,7 +3801,7 @@ Raven$2.prototype = { }); } - var request = _window$1.XMLHttpRequest && new _window$1.XMLHttpRequest(); + var request = _window$2.XMLHttpRequest && new _window$2.XMLHttpRequest(); if (!request) return; // if browser doesn't support CORS (e.g. IE7), we are out of luck @@ -3684,12 +3843,12 @@ Raven$2.prototype = { request.open('POST', url); if (evaluatedHeaders) { - each(evaluatedHeaders, function(key, value) { + each$1(evaluatedHeaders, function(key, value) { request.setRequestHeader(key, value); }); } - request.send(stringify_1(opts.data)); + request.send(stringify$1(opts.data)); }, _evaluateHash: function(hash) { @@ -3717,19 +3876,27 @@ Raven$2.prototype = { }, _mergeContext: function(key, context) { - if (isUndefined(context)) { + if (isUndefined$1(context)) { delete this._globalContext[key]; } else { - this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context); + this._globalContext[key] = objectMerge$1(this._globalContext[key] || {}, context); } } }; // Deprecations -Raven$2.prototype.setUser = Raven$2.prototype.setUserContext; -Raven$2.prototype.setReleaseContext = Raven$2.prototype.setRelease; +Raven.prototype.setUser = Raven.prototype.setUserContext; +Raven.prototype.setReleaseContext = Raven.prototype.setRelease; + +var raven = Raven; + -var raven = Raven$2; +var raven$1 = Object.freeze({ + default: raven, + __moduleExports: raven +}); + +var RavenConstructor = ( raven$1 && raven ) || raven$1; /** * Enforces a single instance of the Raven client, and the @@ -3740,13 +3907,13 @@ var raven = Raven$2; // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) -var _window = +var _window$3 = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {}; -var _Raven = _window.Raven; +var _Raven = _window$3.Raven; -var Raven = new raven(); +var Raven$1 = new RavenConstructor(); /* * Allow multiple versions of Raven to be installed. @@ -3754,19 +3921,52 @@ var Raven = new raven(); * * @return {Raven} */ -Raven.noConflict = function() { - _window.Raven = _Raven; - return Raven; +Raven$1.noConflict = function() { + _window$3.Raven = _Raven; + return Raven$1; }; -Raven.afterLoad(); +Raven$1.afterLoad(); -var singleton = Raven; +var singleton = Raven$1; + +/** + * DISCLAIMER: + * + * Expose `Client` constructor for cases where user want to track multiple "sub-applications" in one larger app. + * It's not meant to be used by a wide audience, so pleaaase make sure that you know what you're doing before using it. + * Accidentally calling `install` multiple times, may result in an unexpected behavior that's very hard to debug. + * + * It's called `Client' to be in-line with Raven Node implementation. + * + * HOWTO: + * + * import Raven from 'raven-js'; + * + * const someAppReporter = new Raven.Client(); + * const someOtherAppReporter = new Raven.Client(); + * + * someAppReporter('__DSN__', { + * ...config goes here + * }); + * + * someOtherAppReporter('__OTHER_DSN__', { + * ...config goes here + * }); + * + * someAppReporter.captureMessage(...); + * someAppReporter.captureException(...); + * someAppReporter.captureBreadcrumb(...); + * + * someOtherAppReporter.captureMessage(...); + * someOtherAppReporter.captureException(...); + * someOtherAppReporter.captureBreadcrumb(...); + * + * It should "just work". + */ +var Client = RavenConstructor; +singleton.Client = Client; -// ========================================================================== -// Plyr.io demo -// This code is purely for the https://plyr.io website -// Please see readme.md in the root or github.com/sampotts/plyr // ========================================================================== (function () { @@ -3828,6 +4028,7 @@ var singleton = Raven; 'fast-forward', 'progress', 'current-time', + 'duration', 'mute', 'volume', 'captions', |