Fix for Safari with adblockers
This commit is contained in:
parent
43e6dcd41d
commit
595c5e95bc
226
demo/dist/demo.js
vendored
226
demo/dist/demo.js
vendored
@ -88,6 +88,17 @@ function serializer(replacer, cycleReplacer) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var stringify_2 = stringify_1.getSerialize;
|
||||||
|
|
||||||
|
|
||||||
|
var stringify = Object.freeze({
|
||||||
|
default: stringify_1,
|
||||||
|
__moduleExports: stringify_1,
|
||||||
|
getSerialize: stringify_2
|
||||||
|
});
|
||||||
|
|
||||||
|
var stringify$1 = ( stringify && stringify_1 ) || stringify;
|
||||||
|
|
||||||
var _window$3 =
|
var _window$3 =
|
||||||
typeof window !== 'undefined'
|
typeof window !== 'undefined'
|
||||||
? window
|
? window
|
||||||
@ -594,7 +605,7 @@ function serializeException$1(ex, depth, maxSize) {
|
|||||||
|
|
||||||
var serialized = serializeObject(ex, depth);
|
var serialized = serializeObject(ex, depth);
|
||||||
|
|
||||||
if (jsonSize(stringify_1(serialized)) > maxSize) {
|
if (jsonSize(stringify$1(serialized)) > maxSize) {
|
||||||
return serializeException$1(ex, depth - 1);
|
return serializeException$1(ex, depth - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -657,15 +668,76 @@ var utils = {
|
|||||||
serializeKeysForMessage: serializeKeysForMessage$1
|
serializeKeysForMessage: serializeKeysForMessage$1
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
var utils_1 = utils.isObject;
|
||||||
TraceKit - Cross brower stack traces
|
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;
|
||||||
|
|
||||||
This was originally forked from github.com/occ/TraceKit, but has since been
|
|
||||||
largely re-written and is now maintained as part of raven-js. Tests for
|
|
||||||
this are in test/vendor.
|
|
||||||
|
|
||||||
MIT license
|
var utils$2 = 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
|
||||||
|
});
|
||||||
|
|
||||||
|
var utils$3 = ( utils$2 && utils ) || utils$2;
|
||||||
|
|
||||||
var TraceKit = {
|
var TraceKit = {
|
||||||
collectWindowErrors: true,
|
collectWindowErrors: true,
|
||||||
@ -805,9 +877,9 @@ TraceKit.report = (function reportModuleWrapper() {
|
|||||||
function traceKitWindowOnError(msg, url, lineNo, colNo, ex) {
|
function traceKitWindowOnError(msg, url, lineNo, colNo, ex) {
|
||||||
var stack = null;
|
var stack = null;
|
||||||
// If 'ex' is ErrorEvent, get real Error from inside
|
// If 'ex' is ErrorEvent, get real Error from inside
|
||||||
var exception = utils.isErrorEvent(ex) ? ex.error : ex;
|
var exception = utils$3.isErrorEvent(ex) ? ex.error : ex;
|
||||||
// If 'msg' is ErrorEvent, get real message from inside
|
// If 'msg' is ErrorEvent, get real message from inside
|
||||||
var message = utils.isErrorEvent(msg) ? msg.message : msg;
|
var message = utils$3.isErrorEvent(msg) ? msg.message : msg;
|
||||||
|
|
||||||
if (lastExceptionStack) {
|
if (lastExceptionStack) {
|
||||||
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
|
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
|
||||||
@ -817,7 +889,7 @@ TraceKit.report = (function reportModuleWrapper() {
|
|||||||
message
|
message
|
||||||
);
|
);
|
||||||
processLastException();
|
processLastException();
|
||||||
} else if (exception && utils.isError(exception)) {
|
} else if (exception && utils$3.isError(exception)) {
|
||||||
// non-string `exception` arg; attempt to extract stack trace
|
// non-string `exception` arg; attempt to extract stack trace
|
||||||
|
|
||||||
// New chrome and blink send along a real error object
|
// New chrome and blink send along a real error object
|
||||||
@ -1284,6 +1356,13 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
|
|||||||
|
|
||||||
var tracekit = TraceKit;
|
var tracekit = TraceKit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var tracekit$2 = Object.freeze({
|
||||||
|
default: tracekit,
|
||||||
|
__moduleExports: tracekit
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JavaScript MD5
|
* JavaScript MD5
|
||||||
* https://github.com/blueimp/JavaScript-MD5
|
* https://github.com/blueimp/JavaScript-MD5
|
||||||
@ -1551,6 +1630,13 @@ function md5(string, key, raw) {
|
|||||||
|
|
||||||
var md5_1 = md5;
|
var md5_1 = md5;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var md5$1 = Object.freeze({
|
||||||
|
default: md5_1,
|
||||||
|
__moduleExports: md5_1
|
||||||
|
});
|
||||||
|
|
||||||
function RavenConfigError(message) {
|
function RavenConfigError(message) {
|
||||||
this.name = 'RavenConfigError';
|
this.name = 'RavenConfigError';
|
||||||
this.message = message;
|
this.message = message;
|
||||||
@ -1560,6 +1646,13 @@ RavenConfigError.prototype.constructor = RavenConfigError;
|
|||||||
|
|
||||||
var configError = RavenConfigError;
|
var configError = RavenConfigError;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var configError$2 = Object.freeze({
|
||||||
|
default: configError,
|
||||||
|
__moduleExports: configError
|
||||||
|
});
|
||||||
|
|
||||||
var wrapMethod = function(console, level, callback) {
|
var wrapMethod = function(console, level, callback) {
|
||||||
var originalConsoleLevel = console[level];
|
var originalConsoleLevel = console[level];
|
||||||
var originalConsole = console;
|
var originalConsole = console;
|
||||||
@ -1573,14 +1666,14 @@ var wrapMethod = function(console, level, callback) {
|
|||||||
console[level] = function() {
|
console[level] = function() {
|
||||||
var args = [].slice.call(arguments);
|
var args = [].slice.call(arguments);
|
||||||
|
|
||||||
var msg = utils.safeJoin(args, ' ');
|
var msg = utils$3.safeJoin(args, ' ');
|
||||||
var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
|
var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
|
||||||
|
|
||||||
if (level === 'assert') {
|
if (level === 'assert') {
|
||||||
if (args[0] === false) {
|
if (args[0] === false) {
|
||||||
// Default browsers message
|
// Default browsers message
|
||||||
msg =
|
msg =
|
||||||
'Assertion failed: ' + (utils.safeJoin(args.slice(1), ' ') || 'console.assert');
|
'Assertion failed: ' + (utils$3.safeJoin(args.slice(1), ' ') || 'console.assert');
|
||||||
data.extra.arguments = args.slice(1);
|
data.extra.arguments = args.slice(1);
|
||||||
callback && callback(msg, data);
|
callback && callback(msg, data);
|
||||||
}
|
}
|
||||||
@ -1601,42 +1694,51 @@ var console$1 = {
|
|||||||
wrapMethod: wrapMethod
|
wrapMethod: wrapMethod
|
||||||
};
|
};
|
||||||
|
|
||||||
/*global XDomainRequest:false */
|
var console_1 = console$1.wrapMethod;
|
||||||
|
|
||||||
|
|
||||||
|
var console$3 = Object.freeze({
|
||||||
|
default: console$1,
|
||||||
|
__moduleExports: console$1,
|
||||||
|
wrapMethod: console_1
|
||||||
|
});
|
||||||
|
|
||||||
|
var TraceKit$1 = ( tracekit$2 && tracekit ) || tracekit$2;
|
||||||
|
|
||||||
|
var md5$2 = ( md5$1 && md5_1 ) || md5$1;
|
||||||
|
|
||||||
|
var RavenConfigError$1 = ( configError$2 && configError ) || configError$2;
|
||||||
|
|
||||||
|
var require$$0 = ( console$3 && console$1 ) || console$3;
|
||||||
|
|
||||||
var isError = utils.isError;
|
var isError = utils$3.isError;
|
||||||
var isObject = utils.isObject;
|
var isObject = utils$3.isObject;
|
||||||
var isPlainObject = utils.isPlainObject;
|
var isPlainObject = utils$3.isPlainObject;
|
||||||
var isErrorEvent = utils.isErrorEvent;
|
var isErrorEvent = utils$3.isErrorEvent;
|
||||||
var isUndefined = utils.isUndefined;
|
var isUndefined = utils$3.isUndefined;
|
||||||
var isFunction = utils.isFunction;
|
var isFunction = utils$3.isFunction;
|
||||||
var isString = utils.isString;
|
var isString = utils$3.isString;
|
||||||
var isArray = utils.isArray;
|
var isArray = utils$3.isArray;
|
||||||
var isEmptyObject = utils.isEmptyObject;
|
var isEmptyObject = utils$3.isEmptyObject;
|
||||||
var each = utils.each;
|
var each = utils$3.each;
|
||||||
var objectMerge = utils.objectMerge;
|
var objectMerge = utils$3.objectMerge;
|
||||||
var truncate = utils.truncate;
|
var truncate = utils$3.truncate;
|
||||||
var objectFrozen = utils.objectFrozen;
|
var objectFrozen = utils$3.objectFrozen;
|
||||||
var hasKey = utils.hasKey;
|
var hasKey = utils$3.hasKey;
|
||||||
var joinRegExp = utils.joinRegExp;
|
var joinRegExp = utils$3.joinRegExp;
|
||||||
var urlencode = utils.urlencode;
|
var urlencode = utils$3.urlencode;
|
||||||
var uuid4 = utils.uuid4;
|
var uuid4 = utils$3.uuid4;
|
||||||
var htmlTreeAsString = utils.htmlTreeAsString;
|
var htmlTreeAsString = utils$3.htmlTreeAsString;
|
||||||
var isSameException = utils.isSameException;
|
var isSameException = utils$3.isSameException;
|
||||||
var isSameStacktrace = utils.isSameStacktrace;
|
var isSameStacktrace = utils$3.isSameStacktrace;
|
||||||
var parseUrl = utils.parseUrl;
|
var parseUrl = utils$3.parseUrl;
|
||||||
var fill = utils.fill;
|
var fill = utils$3.fill;
|
||||||
var supportsFetch = utils.supportsFetch;
|
var supportsFetch = utils$3.supportsFetch;
|
||||||
var supportsReferrerPolicy = utils.supportsReferrerPolicy;
|
var supportsReferrerPolicy = utils$3.supportsReferrerPolicy;
|
||||||
var serializeKeysForMessage = utils.serializeKeysForMessage;
|
var serializeKeysForMessage = utils$3.serializeKeysForMessage;
|
||||||
var serializeException = utils.serializeException;
|
var serializeException = utils$3.serializeException;
|
||||||
|
|
||||||
var wrapConsoleMethod = console$1.wrapMethod;
|
var wrapConsoleMethod = require$$0.wrapMethod;
|
||||||
|
|
||||||
var dsnKeys = 'source protocol user pass host port path'.split(' ');
|
var dsnKeys = 'source protocol user pass host port path'.split(' ');
|
||||||
var dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
|
var dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
|
||||||
@ -1743,7 +1845,7 @@ Raven$2.prototype = {
|
|||||||
|
|
||||||
debug: false,
|
debug: false,
|
||||||
|
|
||||||
TraceKit: tracekit, // alias to TraceKit
|
TraceKit: TraceKit$1, // alias to TraceKit
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Configure Raven with a DSN and extra options
|
* Configure Raven with a DSN and extra options
|
||||||
@ -1824,7 +1926,7 @@ Raven$2.prototype = {
|
|||||||
}
|
}
|
||||||
globalOptions.instrument = instrument;
|
globalOptions.instrument = instrument;
|
||||||
|
|
||||||
tracekit.collectWindowErrors = !!globalOptions.collectWindowErrors;
|
TraceKit$1.collectWindowErrors = !!globalOptions.collectWindowErrors;
|
||||||
|
|
||||||
// return for chaining
|
// return for chaining
|
||||||
return self;
|
return self;
|
||||||
@ -1841,7 +1943,7 @@ Raven$2.prototype = {
|
|||||||
install: function() {
|
install: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (self.isSetup() && !self._isRavenInstalled) {
|
if (self.isSetup() && !self._isRavenInstalled) {
|
||||||
tracekit.report.subscribe(function() {
|
TraceKit$1.report.subscribe(function() {
|
||||||
self._handleOnErrorStackInfo.apply(self, arguments);
|
self._handleOnErrorStackInfo.apply(self, arguments);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2005,7 +2107,7 @@ Raven$2.prototype = {
|
|||||||
* @return {Raven}
|
* @return {Raven}
|
||||||
*/
|
*/
|
||||||
uninstall: function() {
|
uninstall: function() {
|
||||||
tracekit.report.uninstall();
|
TraceKit$1.report.uninstall();
|
||||||
|
|
||||||
this._detachPromiseRejectionHandler();
|
this._detachPromiseRejectionHandler();
|
||||||
this._unpatchFunctionToString();
|
this._unpatchFunctionToString();
|
||||||
@ -2100,7 +2202,7 @@ Raven$2.prototype = {
|
|||||||
// raises an exception different from the one we asked to
|
// raises an exception different from the one we asked to
|
||||||
// report on.
|
// report on.
|
||||||
try {
|
try {
|
||||||
var stack = tracekit.computeStackTrace(ex);
|
var stack = TraceKit$1.computeStackTrace(ex);
|
||||||
this._handleStackInfo(stack, options);
|
this._handleStackInfo(stack, options);
|
||||||
} catch (ex1) {
|
} catch (ex1) {
|
||||||
if (ex !== ex1) {
|
if (ex !== ex1) {
|
||||||
@ -2116,7 +2218,7 @@ Raven$2.prototype = {
|
|||||||
var options = objectMerge(currentOptions, {
|
var options = objectMerge(currentOptions, {
|
||||||
message:
|
message:
|
||||||
'Non-Error exception captured with keys: ' + serializeKeysForMessage(exKeys),
|
'Non-Error exception captured with keys: ' + serializeKeysForMessage(exKeys),
|
||||||
fingerprint: [md5_1(exKeys)],
|
fingerprint: [md5$2(exKeys)],
|
||||||
extra: currentOptions.extra || {}
|
extra: currentOptions.extra || {}
|
||||||
});
|
});
|
||||||
options.extra.__serialized__ = serializeException(ex);
|
options.extra.__serialized__ = serializeException(ex);
|
||||||
@ -2165,7 +2267,7 @@ Raven$2.prototype = {
|
|||||||
|
|
||||||
// null exception name so `Error` isn't prefixed to msg
|
// null exception name so `Error` isn't prefixed to msg
|
||||||
ex.name = null;
|
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]
|
// 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(stack.stack) && stack.stack[1];
|
||||||
@ -2312,7 +2414,7 @@ Raven$2.prototype = {
|
|||||||
*/
|
*/
|
||||||
getContext: function() {
|
getContext: function() {
|
||||||
// lol javascript
|
// lol javascript
|
||||||
return JSON.parse(stringify_1(this._globalContext));
|
return JSON.parse(stringify$1(this._globalContext));
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2448,12 +2550,12 @@ Raven$2.prototype = {
|
|||||||
|
|
||||||
var lastEventId = options.eventId || this.lastEventId();
|
var lastEventId = options.eventId || this.lastEventId();
|
||||||
if (!lastEventId) {
|
if (!lastEventId) {
|
||||||
throw new configError('Missing eventId');
|
throw new RavenConfigError$1('Missing eventId');
|
||||||
}
|
}
|
||||||
|
|
||||||
var dsn = options.dsn || this._dsn;
|
var dsn = options.dsn || this._dsn;
|
||||||
if (!dsn) {
|
if (!dsn) {
|
||||||
throw new configError('Missing DSN');
|
throw new RavenConfigError$1('Missing DSN');
|
||||||
}
|
}
|
||||||
|
|
||||||
var encode = encodeURIComponent;
|
var encode = encodeURIComponent;
|
||||||
@ -3095,11 +3197,11 @@ Raven$2.prototype = {
|
|||||||
try {
|
try {
|
||||||
while (i--) dsn[dsnKeys[i]] = m[i] || '';
|
while (i--) dsn[dsnKeys[i]] = m[i] || '';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new configError('Invalid DSN: ' + str);
|
throw new RavenConfigError$1('Invalid DSN: ' + str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dsn.pass && !this._globalOptions.allowSecretKey) {
|
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'
|
'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -3614,7 +3716,7 @@ Raven$2.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (supportsFetch()) {
|
if (supportsFetch()) {
|
||||||
evaluatedFetchParameters.body = stringify_1(opts.data);
|
evaluatedFetchParameters.body = stringify$1(opts.data);
|
||||||
|
|
||||||
var defaultFetchOptions = objectMerge({}, this._fetchDefaults);
|
var defaultFetchOptions = objectMerge({}, this._fetchDefaults);
|
||||||
var fetchOptions = objectMerge(defaultFetchOptions, evaluatedFetchParameters);
|
var fetchOptions = objectMerge(defaultFetchOptions, evaluatedFetchParameters);
|
||||||
@ -3689,7 +3791,7 @@ Raven$2.prototype = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
request.send(stringify_1(opts.data));
|
request.send(stringify$1(opts.data));
|
||||||
},
|
},
|
||||||
|
|
||||||
_evaluateHash: function(hash) {
|
_evaluateHash: function(hash) {
|
||||||
@ -3731,22 +3833,22 @@ Raven$2.prototype.setReleaseContext = Raven$2.prototype.setRelease;
|
|||||||
|
|
||||||
var raven = Raven$2;
|
var raven = Raven$2;
|
||||||
|
|
||||||
/**
|
|
||||||
* Enforces a single instance of the Raven client, and the
|
|
||||||
* main entry point for Raven. If you are a consumer of the
|
|
||||||
* Raven library, you SHOULD load this file (vs raven.js).
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
|
var raven$2 = Object.freeze({
|
||||||
|
default: raven,
|
||||||
|
__moduleExports: raven
|
||||||
|
});
|
||||||
|
|
||||||
|
var RavenConstructor = ( raven$2 && 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 =
|
||||||
typeof window !== 'undefined'
|
typeof window !== 'undefined'
|
||||||
? window
|
? window
|
||||||
: typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {};
|
: typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {};
|
||||||
var _Raven = _window.Raven;
|
var _Raven = _window.Raven;
|
||||||
|
|
||||||
var Raven = new raven();
|
var Raven = new RavenConstructor();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allow multiple versions of Raven to be installed.
|
* Allow multiple versions of Raven to be installed.
|
||||||
|
2
demo/dist/demo.js.map
vendored
2
demo/dist/demo.js.map
vendored
File diff suppressed because one or more lines are too long
2
demo/dist/demo.min.js
vendored
2
demo/dist/demo.min.js
vendored
File diff suppressed because one or more lines are too long
2
demo/dist/demo.min.js.map
vendored
2
demo/dist/demo.min.js.map
vendored
File diff suppressed because one or more lines are too long
353
dist/plyr.js
vendored
353
dist/plyr.js
vendored
@ -330,6 +330,305 @@ var defaults = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
var loadjs_umd = createCommonjsModule(function (module, exports) {
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof undefined === 'function' && undefined.amd) {
|
||||||
|
undefined([], factory);
|
||||||
|
} else {
|
||||||
|
module.exports = factory();
|
||||||
|
}
|
||||||
|
}(commonjsGlobal, function() {
|
||||||
|
/**
|
||||||
|
* Global dependencies.
|
||||||
|
* @global {Object} document - DOM
|
||||||
|
*/
|
||||||
|
|
||||||
|
var devnull = function() {},
|
||||||
|
bundleIdCache = {},
|
||||||
|
bundleResultCache = {},
|
||||||
|
bundleCallbackQueue = {};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subscribe to bundle load event.
|
||||||
|
* @param {string[]} bundleIds - Bundle ids
|
||||||
|
* @param {Function} callbackFn - The callback function
|
||||||
|
*/
|
||||||
|
function subscribe(bundleIds, callbackFn) {
|
||||||
|
// listify
|
||||||
|
bundleIds = bundleIds.push ? bundleIds : [bundleIds];
|
||||||
|
|
||||||
|
var depsNotFound = [],
|
||||||
|
i = bundleIds.length,
|
||||||
|
numWaiting = i,
|
||||||
|
fn,
|
||||||
|
bundleId,
|
||||||
|
r,
|
||||||
|
q;
|
||||||
|
|
||||||
|
// define callback function
|
||||||
|
fn = function (bundleId, pathsNotFound) {
|
||||||
|
if (pathsNotFound.length) depsNotFound.push(bundleId);
|
||||||
|
|
||||||
|
numWaiting--;
|
||||||
|
if (!numWaiting) callbackFn(depsNotFound);
|
||||||
|
};
|
||||||
|
|
||||||
|
// register callback
|
||||||
|
while (i--) {
|
||||||
|
bundleId = bundleIds[i];
|
||||||
|
|
||||||
|
// execute callback if in result cache
|
||||||
|
r = bundleResultCache[bundleId];
|
||||||
|
if (r) {
|
||||||
|
fn(bundleId, r);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add to callback queue
|
||||||
|
q = bundleCallbackQueue[bundleId] = bundleCallbackQueue[bundleId] || [];
|
||||||
|
q.push(fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publish bundle load event.
|
||||||
|
* @param {string} bundleId - Bundle id
|
||||||
|
* @param {string[]} pathsNotFound - List of files not found
|
||||||
|
*/
|
||||||
|
function publish(bundleId, pathsNotFound) {
|
||||||
|
// exit if id isn't defined
|
||||||
|
if (!bundleId) return;
|
||||||
|
|
||||||
|
var q = bundleCallbackQueue[bundleId];
|
||||||
|
|
||||||
|
// cache result
|
||||||
|
bundleResultCache[bundleId] = pathsNotFound;
|
||||||
|
|
||||||
|
// exit if queue is empty
|
||||||
|
if (!q) return;
|
||||||
|
|
||||||
|
// empty callback queue
|
||||||
|
while (q.length) {
|
||||||
|
q[0](bundleId, pathsNotFound);
|
||||||
|
q.splice(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute callbacks.
|
||||||
|
* @param {Object or Function} args - The callback args
|
||||||
|
* @param {string[]} depsNotFound - List of dependencies not found
|
||||||
|
*/
|
||||||
|
function executeCallbacks(args, depsNotFound) {
|
||||||
|
// accept function as argument
|
||||||
|
if (args.call) args = {success: args};
|
||||||
|
|
||||||
|
// success and error callbacks
|
||||||
|
if (depsNotFound.length) (args.error || devnull)(depsNotFound);
|
||||||
|
else (args.success || devnull)(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load individual file.
|
||||||
|
* @param {string} path - The file path
|
||||||
|
* @param {Function} callbackFn - The callback function
|
||||||
|
*/
|
||||||
|
function loadFile(path, callbackFn, args, numTries) {
|
||||||
|
var doc = document,
|
||||||
|
async = args.async,
|
||||||
|
maxTries = (args.numRetries || 0) + 1,
|
||||||
|
beforeCallbackFn = args.before || devnull,
|
||||||
|
isCss,
|
||||||
|
e;
|
||||||
|
|
||||||
|
numTries = numTries || 0;
|
||||||
|
|
||||||
|
if (/(^css!|\.css$)/.test(path)) {
|
||||||
|
isCss = true;
|
||||||
|
|
||||||
|
// css
|
||||||
|
e = doc.createElement('link');
|
||||||
|
e.rel = 'stylesheet';
|
||||||
|
e.href = path.replace(/^css!/, ''); // remove "css!" prefix
|
||||||
|
} else {
|
||||||
|
// javascript
|
||||||
|
e = doc.createElement('script');
|
||||||
|
e.src = path;
|
||||||
|
e.async = async === undefined ? true : async;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.onload = e.onerror = e.onbeforeload = function (ev) {
|
||||||
|
var result = ev.type[0];
|
||||||
|
|
||||||
|
// Note: The following code isolates IE using `hideFocus` and treats empty
|
||||||
|
// stylesheets as failures to get around lack of onerror support
|
||||||
|
if (isCss && 'hideFocus' in e) {
|
||||||
|
try {
|
||||||
|
if (!e.sheet.cssText.length) result = 'e';
|
||||||
|
} catch (x) {
|
||||||
|
// sheets objects created from load errors don't allow access to
|
||||||
|
// `cssText`
|
||||||
|
result = 'e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle retries in case of load failure
|
||||||
|
if (result == 'e') {
|
||||||
|
// increment counter
|
||||||
|
numTries += 1;
|
||||||
|
|
||||||
|
// exit function and try again
|
||||||
|
if (numTries < maxTries) {
|
||||||
|
return loadFile(path, callbackFn, args, numTries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute callback
|
||||||
|
callbackFn(path, result, ev.defaultPrevented);
|
||||||
|
};
|
||||||
|
|
||||||
|
// add to document (unless callback returns `false`)
|
||||||
|
if (beforeCallbackFn(path, e) !== false) doc.head.appendChild(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load multiple files.
|
||||||
|
* @param {string[]} paths - The file paths
|
||||||
|
* @param {Function} callbackFn - The callback function
|
||||||
|
*/
|
||||||
|
function loadFiles(paths, callbackFn, args) {
|
||||||
|
// listify paths
|
||||||
|
paths = paths.push ? paths : [paths];
|
||||||
|
|
||||||
|
var numWaiting = paths.length,
|
||||||
|
x = numWaiting,
|
||||||
|
pathsNotFound = [],
|
||||||
|
fn,
|
||||||
|
i;
|
||||||
|
|
||||||
|
// define callback function
|
||||||
|
fn = function(path, result, defaultPrevented) {
|
||||||
|
// handle error
|
||||||
|
if (result == 'e') pathsNotFound.push(path);
|
||||||
|
|
||||||
|
// handle beforeload event. If defaultPrevented then that means the load
|
||||||
|
// will be blocked (ex. Ghostery/ABP on Safari)
|
||||||
|
if (result == 'b') {
|
||||||
|
if (defaultPrevented) pathsNotFound.push(path);
|
||||||
|
else return;
|
||||||
|
}
|
||||||
|
|
||||||
|
numWaiting--;
|
||||||
|
if (!numWaiting) callbackFn(pathsNotFound);
|
||||||
|
};
|
||||||
|
|
||||||
|
// load scripts
|
||||||
|
for (i=0; i < x; i++) loadFile(paths[i], fn, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiate script load and register bundle.
|
||||||
|
* @param {(string|string[])} paths - The file paths
|
||||||
|
* @param {(string|Function)} [arg1] - The bundleId or success callback
|
||||||
|
* @param {Function} [arg2] - The success or error callback
|
||||||
|
* @param {Function} [arg3] - The error callback
|
||||||
|
*/
|
||||||
|
function loadjs(paths, arg1, arg2) {
|
||||||
|
var bundleId,
|
||||||
|
args;
|
||||||
|
|
||||||
|
// bundleId (if string)
|
||||||
|
if (arg1 && arg1.trim) bundleId = arg1;
|
||||||
|
|
||||||
|
// args (default is {})
|
||||||
|
args = (bundleId ? arg2 : arg1) || {};
|
||||||
|
|
||||||
|
// throw error if bundle is already defined
|
||||||
|
if (bundleId) {
|
||||||
|
if (bundleId in bundleIdCache) {
|
||||||
|
throw "LoadJS";
|
||||||
|
} else {
|
||||||
|
bundleIdCache[bundleId] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// load scripts
|
||||||
|
loadFiles(paths, function (pathsNotFound) {
|
||||||
|
// execute callbacks
|
||||||
|
executeCallbacks(args, pathsNotFound);
|
||||||
|
|
||||||
|
// publish bundle load event
|
||||||
|
publish(bundleId, pathsNotFound);
|
||||||
|
}, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute callbacks when dependencies have been satisfied.
|
||||||
|
* @param {(string|string[])} deps - List of bundle ids
|
||||||
|
* @param {Object} args - success/error arguments
|
||||||
|
*/
|
||||||
|
loadjs.ready = function ready(deps, args) {
|
||||||
|
// subscribe to bundle load event
|
||||||
|
subscribe(deps, function (depsNotFound) {
|
||||||
|
// execute callbacks
|
||||||
|
executeCallbacks(args, depsNotFound);
|
||||||
|
});
|
||||||
|
|
||||||
|
return loadjs;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manually satisfy bundle dependencies.
|
||||||
|
* @param {string} bundleId - The bundle id
|
||||||
|
*/
|
||||||
|
loadjs.done = function done(bundleId) {
|
||||||
|
publish(bundleId, []);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset loadjs dependencies statuses
|
||||||
|
*/
|
||||||
|
loadjs.reset = function reset() {
|
||||||
|
bundleIdCache = {};
|
||||||
|
bundleResultCache = {};
|
||||||
|
bundleCallbackQueue = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if bundle has already been defined
|
||||||
|
* @param String} bundleId - The bundle id
|
||||||
|
*/
|
||||||
|
loadjs.isDefined = function isDefined(bundleId) {
|
||||||
|
return bundleId in bundleIdCache;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// export
|
||||||
|
return loadjs;
|
||||||
|
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
var asyncGenerator = function () {
|
var asyncGenerator = function () {
|
||||||
function AwaitValue(value) {
|
function AwaitValue(value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
@ -693,48 +992,10 @@ var utils = {
|
|||||||
// Load an external script
|
// Load an external script
|
||||||
loadScript: function loadScript(url) {
|
loadScript: function loadScript(url) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var current = document.querySelector('script[src="' + url + '"]');
|
loadjs_umd(url, {
|
||||||
|
success: resolve,
|
||||||
// Check script is not already referenced, if so wait for load
|
error: reject
|
||||||
if (current !== null) {
|
|
||||||
current.callbacks = current.callbacks || [];
|
|
||||||
current.callbacks.push(resolve);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the element
|
|
||||||
var element = document.createElement('script');
|
|
||||||
|
|
||||||
// Callback queue
|
|
||||||
element.callbacks = element.callbacks || [];
|
|
||||||
element.callbacks.push(resolve);
|
|
||||||
|
|
||||||
// Error queue
|
|
||||||
element.errors = element.errors || [];
|
|
||||||
element.errors.push(reject);
|
|
||||||
|
|
||||||
// Bind callback
|
|
||||||
element.addEventListener('load', function (event) {
|
|
||||||
element.callbacks.forEach(function (cb) {
|
|
||||||
return cb.call(null, event);
|
|
||||||
});
|
});
|
||||||
element.callbacks = null;
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
// Bind error handling
|
|
||||||
element.addEventListener('error', function (event) {
|
|
||||||
element.errors.forEach(function (err) {
|
|
||||||
return err.call(null, event);
|
|
||||||
});
|
|
||||||
element.errors = null;
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
// Set the URL after binding callback
|
|
||||||
element.src = url;
|
|
||||||
|
|
||||||
// Inject
|
|
||||||
var first = document.getElementsByTagName('script')[0];
|
|
||||||
first.parentNode.insertBefore(element, first);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1486,7 +1747,6 @@ var utils = {
|
|||||||
// Plyr support checks
|
// Plyr support checks
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Check for feature support
|
|
||||||
var support = {
|
var support = {
|
||||||
// Basic support
|
// Basic support
|
||||||
audio: 'canPlayType' in document.createElement('audio'),
|
audio: 'canPlayType' in document.createElement('audio'),
|
||||||
@ -2494,7 +2754,6 @@ var ui = {
|
|||||||
// Plyr controls
|
// Plyr controls
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Sniff out the browser
|
|
||||||
var browser$2 = utils.getBrowser();
|
var browser$2 = utils.getBrowser();
|
||||||
|
|
||||||
var controls = {
|
var controls = {
|
||||||
@ -3692,7 +3951,6 @@ var controls = {
|
|||||||
// Plyr Event Listeners
|
// Plyr Event Listeners
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Sniff out the browser
|
|
||||||
var browser$1 = utils.getBrowser();
|
var browser$1 = utils.getBrowser();
|
||||||
|
|
||||||
var Listeners = function () {
|
var Listeners = function () {
|
||||||
@ -5786,7 +6044,6 @@ var vimeo = {
|
|||||||
// Plyr Media
|
// Plyr Media
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Sniff out the browser
|
|
||||||
var browser$3 = utils.getBrowser();
|
var browser$3 = utils.getBrowser();
|
||||||
|
|
||||||
var media = {
|
var media = {
|
||||||
@ -6031,12 +6288,6 @@ var source = {
|
|||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Private properties
|
|
||||||
// TODO: Use a WeakMap for private globals
|
|
||||||
// const globals = new WeakMap();
|
|
||||||
|
|
||||||
// Plyr instance
|
|
||||||
|
|
||||||
var Plyr = function () {
|
var Plyr = function () {
|
||||||
function Plyr(target, options) {
|
function Plyr(target, options) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
2
dist/plyr.js.map
vendored
2
dist/plyr.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js
vendored
2
dist/plyr.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js.map
vendored
2
dist/plyr.min.js.map
vendored
File diff suppressed because one or more lines are too long
2996
dist/plyr.polyfilled.js
vendored
2996
dist/plyr.polyfilled.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/plyr.polyfilled.js.map
vendored
2
dist/plyr.polyfilled.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js
vendored
2
dist/plyr.polyfilled.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js.map
vendored
2
dist/plyr.polyfilled.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -35,6 +35,8 @@
|
|||||||
"gulp-svgstore": "^6.1.1",
|
"gulp-svgstore": "^6.1.1",
|
||||||
"gulp-uglify-es": "^1.0.1",
|
"gulp-uglify-es": "^1.0.1",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
|
"prettier-eslint": "^8.8.1",
|
||||||
|
"prettier-stylelint": "^0.4.2",
|
||||||
"rollup-plugin-babel": "^3.0.3",
|
"rollup-plugin-babel": "^3.0.3",
|
||||||
"rollup-plugin-commonjs": "^8.4.1",
|
"rollup-plugin-commonjs": "^8.4.1",
|
||||||
"rollup-plugin-node-resolve": "^3.2.0",
|
"rollup-plugin-node-resolve": "^3.2.0",
|
||||||
@ -66,6 +68,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-polyfill": "^6.26.0",
|
"babel-polyfill": "^6.26.0",
|
||||||
"custom-event-polyfill": "^0.3.0",
|
"custom-event-polyfill": "^0.3.0",
|
||||||
|
"loadjs": "^3.5.2",
|
||||||
"raven-js": "^3.23.3"
|
"raven-js": "^3.23.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// Plyr utils
|
// Plyr utils
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
import loadjs from 'loadjs';
|
||||||
|
|
||||||
import support from './support';
|
import support from './support';
|
||||||
import { providers } from './types';
|
import { providers } from './types';
|
||||||
|
|
||||||
@ -100,8 +102,7 @@ const utils = {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
resolve(request.responseText);
|
resolve(request.responseText);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
resolve(request.response);
|
resolve(request.response);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -125,52 +126,10 @@ const utils = {
|
|||||||
// Load an external script
|
// Load an external script
|
||||||
loadScript(url) {
|
loadScript(url) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const current = document.querySelector(`script[src="${url}"]`);
|
loadjs(url, {
|
||||||
|
success: resolve,
|
||||||
// Check script is not already referenced, if so wait for load
|
error: reject,
|
||||||
if (current !== null) {
|
});
|
||||||
current.callbacks = current.callbacks || [];
|
|
||||||
current.callbacks.push(resolve);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the element
|
|
||||||
const element = document.createElement('script');
|
|
||||||
|
|
||||||
// Callback queue
|
|
||||||
element.callbacks = element.callbacks || [];
|
|
||||||
element.callbacks.push(resolve);
|
|
||||||
|
|
||||||
// Error queue
|
|
||||||
element.errors = element.errors || [];
|
|
||||||
element.errors.push(reject);
|
|
||||||
|
|
||||||
// Bind callback
|
|
||||||
element.addEventListener(
|
|
||||||
'load',
|
|
||||||
event => {
|
|
||||||
element.callbacks.forEach(cb => cb.call(null, event));
|
|
||||||
element.callbacks = null;
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Bind error handling
|
|
||||||
element.addEventListener(
|
|
||||||
'error',
|
|
||||||
event => {
|
|
||||||
element.errors.forEach(err => err.call(null, event));
|
|
||||||
element.errors = null;
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the URL after binding callback
|
|
||||||
element.src = url;
|
|
||||||
|
|
||||||
// Inject
|
|
||||||
const first = document.getElementsByTagName('script')[0];
|
|
||||||
first.parentNode.insertBefore(element, first);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user