gleap 6.8.14 → 6.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +362 -147
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -112,6 +112,13 @@ var loadFromGleapCache = function loadFromGleapCache(key) {
|
|
|
112
112
|
|
|
113
113
|
return null;
|
|
114
114
|
};
|
|
115
|
+
var truncateString = function truncateString(str, num) {
|
|
116
|
+
if (str.length > num) {
|
|
117
|
+
return str.slice(0, num) + "...";
|
|
118
|
+
} else {
|
|
119
|
+
return str;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
115
122
|
var saveToGleapCache = function saveToGleapCache(key, data) {
|
|
116
123
|
var k = "gleap-widget-".concat(key);
|
|
117
124
|
|
|
@@ -123,6 +130,37 @@ var saveToGleapCache = function saveToGleapCache(key, data) {
|
|
|
123
130
|
localStorage.removeItem(k);
|
|
124
131
|
}
|
|
125
132
|
};
|
|
133
|
+
var getDOMElementDescription = function getDOMElementDescription(element) {
|
|
134
|
+
var html = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
135
|
+
var innerText = truncateString(element.innerText || '', 40).replace(/(\r\n|\n|\r)/gm, "").replace(/ +(?= )/g, '');
|
|
136
|
+
var elementId = "";
|
|
137
|
+
var elementClass = "";
|
|
138
|
+
|
|
139
|
+
if (typeof element.getAttribute !== "undefined") {
|
|
140
|
+
var elemId = element.getAttribute("id");
|
|
141
|
+
|
|
142
|
+
if (elemId) {
|
|
143
|
+
elementId = " id=\"".concat(elemId, "\"");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var elemClass = element.getAttribute("class");
|
|
147
|
+
|
|
148
|
+
if (elemClass) {
|
|
149
|
+
elementClass = " class=\"".concat(elemClass, "\"");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var elementTag = (element.tagName || '').toLowerCase();
|
|
154
|
+
var htmlPre = "<";
|
|
155
|
+
var htmlPost = ">";
|
|
156
|
+
|
|
157
|
+
if (!html) {
|
|
158
|
+
htmlPre = "[";
|
|
159
|
+
htmlPost = "]";
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return "".concat(htmlPre).concat(elementTag).concat(elementId).concat(elementClass).concat(htmlPost).concat(innerText).concat(htmlPre, "/").concat(elementTag).concat(htmlPost);
|
|
163
|
+
};
|
|
126
164
|
;// CONCATENATED MODULE: ./src/ResourceExclusionList.js
|
|
127
165
|
var blacklist = ["//fonts.googleapis.com", "//cdn.jsdelivr.net", "//cdnjs.cloudflare.com", "//ajax.googleapis.com", "//use.typekit.net", ".amazonaws.com", "//jssdk.gleap.io", ".gstatic.com"];
|
|
128
166
|
var isBlacklisted = function isBlacklisted(url) {
|
|
@@ -350,30 +388,36 @@ var replaceStyleNodes = function replaceStyleNodes(clone, styleSheet, cssTextCon
|
|
|
350
388
|
}
|
|
351
389
|
};
|
|
352
390
|
|
|
353
|
-
var
|
|
354
|
-
var
|
|
355
|
-
|
|
356
|
-
var _loop = function _loop() {
|
|
357
|
-
var styleSheet = document.styleSheets[i];
|
|
358
|
-
cssRules = null;
|
|
391
|
+
var getTextContentFromStyleSheet = function getTextContentFromStyleSheet(styleSheet) {
|
|
392
|
+
var cssRules = null;
|
|
359
393
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
394
|
+
try {
|
|
395
|
+
if (styleSheet.cssRules) {
|
|
396
|
+
cssRules = styleSheet.cssRules;
|
|
397
|
+
} else if (styleSheet.rules) {
|
|
398
|
+
cssRules = styleSheet.rules;
|
|
399
|
+
}
|
|
400
|
+
} catch (exp) {}
|
|
367
401
|
|
|
368
|
-
|
|
402
|
+
var cssTextContent = "";
|
|
369
403
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
404
|
+
if (cssRules) {
|
|
405
|
+
for (var cssRuleItem in cssRules) {
|
|
406
|
+
if (cssRules[cssRuleItem].cssText) {
|
|
407
|
+
cssTextContent += cssRules[cssRuleItem].cssText;
|
|
375
408
|
}
|
|
376
409
|
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return cssTextContent;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
var downloadAllCSSUrlResources = function downloadAllCSSUrlResources(clone, remote) {
|
|
416
|
+
var promises = [];
|
|
417
|
+
|
|
418
|
+
var _loop = function _loop() {
|
|
419
|
+
var styleSheet = document.styleSheets[i];
|
|
420
|
+
var cssTextContent = getTextContentFromStyleSheet(styleSheet);
|
|
377
421
|
|
|
378
422
|
if (styleSheet && styleSheet.ownerNode) {
|
|
379
423
|
if (cssTextContent != "" && !remote) {
|
|
@@ -404,9 +448,6 @@ var downloadAllCSSUrlResources = function downloadAllCSSUrlResources(clone, remo
|
|
|
404
448
|
};
|
|
405
449
|
|
|
406
450
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
407
|
-
var cssRules;
|
|
408
|
-
var cssTextContent;
|
|
409
|
-
var cssRuleItem;
|
|
410
451
|
var basePathURL;
|
|
411
452
|
|
|
412
453
|
_loop();
|
|
@@ -445,6 +486,29 @@ var prepareRemoteData = function prepareRemoteData(clone, remote) {
|
|
|
445
486
|
});
|
|
446
487
|
};
|
|
447
488
|
|
|
489
|
+
var handleAdoptedStyleSheets = function handleAdoptedStyleSheets(doc, clone, shadowNodeId) {
|
|
490
|
+
if (typeof doc.adoptedStyleSheets !== "undefined") {
|
|
491
|
+
for (var i = 0; i < doc.adoptedStyleSheets.length; i++) {
|
|
492
|
+
var styleSheet = doc.adoptedStyleSheets[i];
|
|
493
|
+
var cssTextContent = getTextContentFromStyleSheet(styleSheet);
|
|
494
|
+
var shadowStyleNode = window.document.createElement("style");
|
|
495
|
+
shadowStyleNode.type = "text/css";
|
|
496
|
+
|
|
497
|
+
if (shadowStyleNode.styleSheet) {
|
|
498
|
+
shadowStyleNode.styleSheet.cssText = cssTextContent;
|
|
499
|
+
} else {
|
|
500
|
+
shadowStyleNode.appendChild(window.document.createTextNode(cssTextContent));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (shadowNodeId) {
|
|
504
|
+
shadowStyleNode.setAttribute("bb-shadow-child", shadowNodeId);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
clone.insertBefore(shadowStyleNode, clone.firstElementChild);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
448
512
|
var deepClone = function deepClone(host) {
|
|
449
513
|
var shadowNodeId = 1;
|
|
450
514
|
|
|
@@ -506,20 +570,29 @@ var deepClone = function deepClone(host) {
|
|
|
506
570
|
parent.appendChild(clone);
|
|
507
571
|
|
|
508
572
|
if (node.shadowRoot) {
|
|
509
|
-
|
|
573
|
+
var rootShadowNodeId = shadowNodeId;
|
|
574
|
+
shadowNodeId++;
|
|
575
|
+
walkTree(node.shadowRoot.firstChild, clone, rootShadowNodeId);
|
|
576
|
+
handleAdoptedStyleSheets(node.shadowRoot, clone, rootShadowNodeId);
|
|
510
577
|
|
|
511
578
|
if (typeof clone.setAttribute !== "undefined") {
|
|
512
|
-
clone.setAttribute("bb-shadow-parent",
|
|
579
|
+
clone.setAttribute("bb-shadow-parent", rootShadowNodeId);
|
|
513
580
|
}
|
|
514
|
-
|
|
515
|
-
++shadowNodeId;
|
|
516
581
|
}
|
|
517
582
|
|
|
518
583
|
walkTree(node.firstChild, clone);
|
|
519
584
|
};
|
|
520
585
|
|
|
521
586
|
var fragment = document.createDocumentFragment();
|
|
522
|
-
cloneNode(host, fragment);
|
|
587
|
+
cloneNode(host, fragment); // Work on adopted stylesheets.
|
|
588
|
+
|
|
589
|
+
var clonedHead = fragment.querySelector("head");
|
|
590
|
+
|
|
591
|
+
if (!clonedHead) {
|
|
592
|
+
clonedHead = fragment;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
handleAdoptedStyleSheets(window.document, clonedHead);
|
|
523
596
|
return fragment;
|
|
524
597
|
};
|
|
525
598
|
|
|
@@ -4565,12 +4638,6 @@ var validateFormPage = function validateFormPage(page) {
|
|
|
4565
4638
|
return formValid;
|
|
4566
4639
|
};
|
|
4567
4640
|
;// CONCATENATED MODULE: ./src/UXDetectors.js
|
|
4568
|
-
var getSelectorFromTarget = function getSelectorFromTarget(target) {
|
|
4569
|
-
var className = target.className !== "" ? "." + target.className : "";
|
|
4570
|
-
var targetId = target.id !== "" ? "#" + target.id : "";
|
|
4571
|
-
return [target.nodeName, className, targetId].join(" ");
|
|
4572
|
-
};
|
|
4573
|
-
|
|
4574
4641
|
var detectRageClicks = function detectRageClicks(subscribe, options) {
|
|
4575
4642
|
var interval = options.interval,
|
|
4576
4643
|
limit = options.limit;
|
|
@@ -4581,10 +4648,7 @@ var detectRageClicks = function detectRageClicks(subscribe, options) {
|
|
|
4581
4648
|
|
|
4582
4649
|
var listener = function listener(event) {
|
|
4583
4650
|
if (count === limit) {
|
|
4584
|
-
subscribe(
|
|
4585
|
-
clearInterval(countClear);
|
|
4586
|
-
document.removeEventListener("click", listener);
|
|
4587
|
-
});
|
|
4651
|
+
subscribe(event.target);
|
|
4588
4652
|
}
|
|
4589
4653
|
|
|
4590
4654
|
count++;
|
|
@@ -5280,6 +5344,255 @@ var isLocalNetwork = function isLocalNetwork() {
|
|
|
5280
5344
|
var hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname;
|
|
5281
5345
|
return ["localhost", "127.0.0.1", "0.0.0.0", "", "::1"].includes(hostname) || hostname.startsWith("192.168.") || hostname.startsWith("10.0.") || hostname.endsWith(".local") || !hostname.includes(".");
|
|
5282
5346
|
};
|
|
5347
|
+
;// CONCATENATED MODULE: ./src/GleapConsoleLogManager.js
|
|
5348
|
+
function GleapConsoleLogManager_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
5349
|
+
|
|
5350
|
+
function GleapConsoleLogManager_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { GleapConsoleLogManager_ownKeys(Object(source), true).forEach(function (key) { GleapConsoleLogManager_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { GleapConsoleLogManager_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
5351
|
+
|
|
5352
|
+
function GleapConsoleLogManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5353
|
+
|
|
5354
|
+
function GleapConsoleLogManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
5355
|
+
|
|
5356
|
+
function GleapConsoleLogManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) GleapConsoleLogManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) GleapConsoleLogManager_defineProperties(Constructor, staticProps); return Constructor; }
|
|
5357
|
+
|
|
5358
|
+
function GleapConsoleLogManager_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5359
|
+
|
|
5360
|
+
|
|
5361
|
+
|
|
5362
|
+
var GleapConsoleLogManager = /*#__PURE__*/function () {
|
|
5363
|
+
function GleapConsoleLogManager() {
|
|
5364
|
+
GleapConsoleLogManager_classCallCheck(this, GleapConsoleLogManager);
|
|
5365
|
+
|
|
5366
|
+
GleapConsoleLogManager_defineProperty(this, "logArray", []);
|
|
5367
|
+
|
|
5368
|
+
GleapConsoleLogManager_defineProperty(this, "originalConsoleLog", void 0);
|
|
5369
|
+
|
|
5370
|
+
GleapConsoleLogManager_defineProperty(this, "logMaxLength", 500);
|
|
5371
|
+
}
|
|
5372
|
+
|
|
5373
|
+
GleapConsoleLogManager_createClass(GleapConsoleLogManager, [{
|
|
5374
|
+
key: "getLogs",
|
|
5375
|
+
value:
|
|
5376
|
+
/**
|
|
5377
|
+
* Return the console logs
|
|
5378
|
+
* @returns {any[]} logs
|
|
5379
|
+
*/
|
|
5380
|
+
function getLogs() {
|
|
5381
|
+
return this.logArray;
|
|
5382
|
+
}
|
|
5383
|
+
/**
|
|
5384
|
+
* Revert console log overwrite.
|
|
5385
|
+
*/
|
|
5386
|
+
|
|
5387
|
+
}, {
|
|
5388
|
+
key: "stop",
|
|
5389
|
+
value: function stop() {
|
|
5390
|
+
window.console = this.originalConsoleLog;
|
|
5391
|
+
}
|
|
5392
|
+
/**
|
|
5393
|
+
* Add entry to logs.
|
|
5394
|
+
* @param {*} args
|
|
5395
|
+
* @param {*} priority
|
|
5396
|
+
* @returns
|
|
5397
|
+
*/
|
|
5398
|
+
|
|
5399
|
+
}, {
|
|
5400
|
+
key: "addLog",
|
|
5401
|
+
value: function addLog(args, priority) {
|
|
5402
|
+
if (!args || args.length <= 0) {
|
|
5403
|
+
return;
|
|
5404
|
+
}
|
|
5405
|
+
|
|
5406
|
+
var log = "";
|
|
5407
|
+
|
|
5408
|
+
for (var i = 0; i < args.length; i++) {
|
|
5409
|
+
log += args[i] + " ";
|
|
5410
|
+
}
|
|
5411
|
+
|
|
5412
|
+
this.logArray.push({
|
|
5413
|
+
log: truncateString(log, 1000),
|
|
5414
|
+
date: new Date(),
|
|
5415
|
+
priority: priority
|
|
5416
|
+
});
|
|
5417
|
+
|
|
5418
|
+
if (this.logArray.length > this.logMaxLength) {
|
|
5419
|
+
this.logArray.shift();
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
/**
|
|
5423
|
+
* Start console log overwrite.
|
|
5424
|
+
*/
|
|
5425
|
+
|
|
5426
|
+
}, {
|
|
5427
|
+
key: "start",
|
|
5428
|
+
value: function start() {
|
|
5429
|
+
var self = this;
|
|
5430
|
+
|
|
5431
|
+
window.console = function (origConsole) {
|
|
5432
|
+
if (!window.console || !origConsole) {
|
|
5433
|
+
origConsole = {};
|
|
5434
|
+
}
|
|
5435
|
+
|
|
5436
|
+
self.originalConsoleLog = origConsole;
|
|
5437
|
+
return GleapConsoleLogManager_objectSpread(GleapConsoleLogManager_objectSpread({}, origConsole), {}, {
|
|
5438
|
+
log: function log() {
|
|
5439
|
+
self.addLog(arguments, "INFO");
|
|
5440
|
+
origConsole.log && origConsole.log.apply(origConsole, arguments);
|
|
5441
|
+
},
|
|
5442
|
+
warn: function warn() {
|
|
5443
|
+
self.addLog(arguments, "WARNING");
|
|
5444
|
+
origConsole.warn && origConsole.warn.apply(origConsole, arguments);
|
|
5445
|
+
},
|
|
5446
|
+
error: function error() {
|
|
5447
|
+
self.addLog(arguments, "ERROR");
|
|
5448
|
+
origConsole.error && origConsole.error.apply(origConsole, arguments);
|
|
5449
|
+
},
|
|
5450
|
+
info: function info(v) {
|
|
5451
|
+
self.addLog(arguments, "INFO");
|
|
5452
|
+
origConsole.info && origConsole.info.apply(origConsole, arguments);
|
|
5453
|
+
}
|
|
5454
|
+
});
|
|
5455
|
+
}(window.console);
|
|
5456
|
+
}
|
|
5457
|
+
}], [{
|
|
5458
|
+
key: "getInstance",
|
|
5459
|
+
value: function getInstance() {
|
|
5460
|
+
if (!this.instance) {
|
|
5461
|
+
this.instance = new GleapConsoleLogManager();
|
|
5462
|
+
}
|
|
5463
|
+
|
|
5464
|
+
return this.instance;
|
|
5465
|
+
}
|
|
5466
|
+
}]);
|
|
5467
|
+
|
|
5468
|
+
return GleapConsoleLogManager;
|
|
5469
|
+
}();
|
|
5470
|
+
|
|
5471
|
+
GleapConsoleLogManager_defineProperty(GleapConsoleLogManager, "instance", void 0);
|
|
5472
|
+
|
|
5473
|
+
|
|
5474
|
+
;// CONCATENATED MODULE: ./src/GleapCrashDetector.js
|
|
5475
|
+
function GleapCrashDetector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5476
|
+
|
|
5477
|
+
function GleapCrashDetector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
5478
|
+
|
|
5479
|
+
function GleapCrashDetector_createClass(Constructor, protoProps, staticProps) { if (protoProps) GleapCrashDetector_defineProperties(Constructor.prototype, protoProps); if (staticProps) GleapCrashDetector_defineProperties(Constructor, staticProps); return Constructor; }
|
|
5480
|
+
|
|
5481
|
+
function GleapCrashDetector_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5482
|
+
|
|
5483
|
+
|
|
5484
|
+
|
|
5485
|
+
|
|
5486
|
+
var GleapCrashDetector = /*#__PURE__*/function () {
|
|
5487
|
+
function GleapCrashDetector() {
|
|
5488
|
+
GleapCrashDetector_classCallCheck(this, GleapCrashDetector);
|
|
5489
|
+
}
|
|
5490
|
+
|
|
5491
|
+
GleapCrashDetector_createClass(GleapCrashDetector, [{
|
|
5492
|
+
key: "start",
|
|
5493
|
+
value: function start() {
|
|
5494
|
+
window.addEventListener('error', function (e) {
|
|
5495
|
+
var message = e.message,
|
|
5496
|
+
filename = e.filename,
|
|
5497
|
+
lineno = e.lineno,
|
|
5498
|
+
colno = e.colno,
|
|
5499
|
+
error = e.error;
|
|
5500
|
+
var stackTrace = "";
|
|
5501
|
+
|
|
5502
|
+
if (error !== null && typeof error.stack !== "undefined") {
|
|
5503
|
+
stackTrace = error.stack;
|
|
5504
|
+
}
|
|
5505
|
+
|
|
5506
|
+
var messageObject = ["Message: " + message, "URL: " + filename, "Line: " + lineno, "Column: " + colno, "Stack: " + stackTrace];
|
|
5507
|
+
GleapConsoleLogManager.getInstance().addLog(messageObject, "ERROR");
|
|
5508
|
+
var gleapInstance = src_Gleap.getInstance();
|
|
5509
|
+
|
|
5510
|
+
if (gleapInstance.enabledCrashDetector && !gleapInstance.appCrashDetected && !gleapInstance.currentlySendingBug) {
|
|
5511
|
+
gleapInstance.appCrashDetected = true;
|
|
5512
|
+
|
|
5513
|
+
if (gleapInstance.enabledCrashDetectorSilent) {
|
|
5514
|
+
return src_Gleap.sendSilentReport({
|
|
5515
|
+
errorMessage: message,
|
|
5516
|
+
url: filename,
|
|
5517
|
+
lineNo: lineno,
|
|
5518
|
+
columnNo: colno,
|
|
5519
|
+
stackTrace: stackTrace
|
|
5520
|
+
}, src_Gleap.PRIORITY_MEDIUM, "CRASH", {
|
|
5521
|
+
screenshot: true,
|
|
5522
|
+
replays: true
|
|
5523
|
+
});
|
|
5524
|
+
} else {
|
|
5525
|
+
src_Gleap.startFeedbackFlow("crash");
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
});
|
|
5529
|
+
}
|
|
5530
|
+
}], [{
|
|
5531
|
+
key: "getInstance",
|
|
5532
|
+
value: // GleapCrashDetector singleton
|
|
5533
|
+
function getInstance() {
|
|
5534
|
+
if (!this.instance) {
|
|
5535
|
+
this.instance = new GleapCrashDetector();
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5538
|
+
return this.instance;
|
|
5539
|
+
}
|
|
5540
|
+
}]);
|
|
5541
|
+
|
|
5542
|
+
return GleapCrashDetector;
|
|
5543
|
+
}();
|
|
5544
|
+
|
|
5545
|
+
GleapCrashDetector_defineProperty(GleapCrashDetector, "instance", void 0);
|
|
5546
|
+
|
|
5547
|
+
|
|
5548
|
+
;// CONCATENATED MODULE: ./src/GleapClickListener.js
|
|
5549
|
+
function GleapClickListener_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5550
|
+
|
|
5551
|
+
function GleapClickListener_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
5552
|
+
|
|
5553
|
+
function GleapClickListener_createClass(Constructor, protoProps, staticProps) { if (protoProps) GleapClickListener_defineProperties(Constructor.prototype, protoProps); if (staticProps) GleapClickListener_defineProperties(Constructor, staticProps); return Constructor; }
|
|
5554
|
+
|
|
5555
|
+
function GleapClickListener_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5556
|
+
|
|
5557
|
+
|
|
5558
|
+
|
|
5559
|
+
|
|
5560
|
+
|
|
5561
|
+
var GleapClickListener = /*#__PURE__*/function () {
|
|
5562
|
+
function GleapClickListener() {
|
|
5563
|
+
GleapClickListener_classCallCheck(this, GleapClickListener);
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
GleapClickListener_createClass(GleapClickListener, [{
|
|
5567
|
+
key: "start",
|
|
5568
|
+
value: function start() {
|
|
5569
|
+
document.addEventListener("click", function (event) {
|
|
5570
|
+
if (!event.target) {
|
|
5571
|
+
return;
|
|
5572
|
+
}
|
|
5573
|
+
|
|
5574
|
+
if (!src_Gleap.getInstance().currentlySendingBug) {
|
|
5575
|
+
GleapConsoleLogManager.getInstance().addLog([getDOMElementDescription(event.target)], "CLICK");
|
|
5576
|
+
}
|
|
5577
|
+
});
|
|
5578
|
+
}
|
|
5579
|
+
}], [{
|
|
5580
|
+
key: "getInstance",
|
|
5581
|
+
value: function getInstance() {
|
|
5582
|
+
if (!this.instance) {
|
|
5583
|
+
this.instance = new GleapClickListener();
|
|
5584
|
+
}
|
|
5585
|
+
|
|
5586
|
+
return this.instance;
|
|
5587
|
+
}
|
|
5588
|
+
}]);
|
|
5589
|
+
|
|
5590
|
+
return GleapClickListener;
|
|
5591
|
+
}();
|
|
5592
|
+
|
|
5593
|
+
GleapClickListener_defineProperty(GleapClickListener, "instance", void 0);
|
|
5594
|
+
|
|
5595
|
+
|
|
5283
5596
|
;// CONCATENATED MODULE: ./src/Gleap.js
|
|
5284
5597
|
function Gleap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5285
5598
|
|
|
@@ -5309,6 +5622,9 @@ function Gleap_defineProperty(obj, key, value) { if (key in obj) { Object.define
|
|
|
5309
5622
|
|
|
5310
5623
|
|
|
5311
5624
|
|
|
5625
|
+
|
|
5626
|
+
|
|
5627
|
+
|
|
5312
5628
|
if (typeof HTMLCanvasElement !== "undefined" && HTMLCanvasElement.prototype) {
|
|
5313
5629
|
HTMLCanvasElement.prototype.__originalGetContext = HTMLCanvasElement.prototype.getContext;
|
|
5314
5630
|
|
|
@@ -5356,16 +5672,12 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5356
5672
|
|
|
5357
5673
|
Gleap_defineProperty(this, "actionLog", []);
|
|
5358
5674
|
|
|
5359
|
-
Gleap_defineProperty(this, "logArray", []);
|
|
5360
|
-
|
|
5361
5675
|
Gleap_defineProperty(this, "customData", {});
|
|
5362
5676
|
|
|
5363
5677
|
Gleap_defineProperty(this, "formData", {});
|
|
5364
5678
|
|
|
5365
5679
|
Gleap_defineProperty(this, "excludeData", {});
|
|
5366
5680
|
|
|
5367
|
-
Gleap_defineProperty(this, "logMaxLength", 500);
|
|
5368
|
-
|
|
5369
5681
|
Gleap_defineProperty(this, "buttonType", Gleap.FEEDBACK_BUTTON_NONE);
|
|
5370
5682
|
|
|
5371
5683
|
Gleap_defineProperty(this, "feedbackType", "BUG");
|
|
@@ -5598,106 +5910,6 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5598
5910
|
this.replay.stop(!this.isLiveSite);
|
|
5599
5911
|
}
|
|
5600
5912
|
}
|
|
5601
|
-
}, {
|
|
5602
|
-
key: "startCrashDetection",
|
|
5603
|
-
value: function startCrashDetection() {
|
|
5604
|
-
var self = this;
|
|
5605
|
-
|
|
5606
|
-
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
|
5607
|
-
var stackTrace = "";
|
|
5608
|
-
|
|
5609
|
-
if (error !== null && typeof error.stack !== "undefined") {
|
|
5610
|
-
stackTrace = error.stack;
|
|
5611
|
-
}
|
|
5612
|
-
|
|
5613
|
-
var message = ["Message: " + msg, "URL: " + url, "Line: " + lineNo, "Column: " + columnNo, "Stack: " + stackTrace];
|
|
5614
|
-
self.addLog(message, "ERROR");
|
|
5615
|
-
|
|
5616
|
-
if (self.enabledCrashDetector && !self.appCrashDetected && !self.currentlySendingBug) {
|
|
5617
|
-
self.appCrashDetected = true;
|
|
5618
|
-
|
|
5619
|
-
if (self.enabledCrashDetectorSilent) {
|
|
5620
|
-
return Gleap.sendSilentReport({
|
|
5621
|
-
errorMessage: msg,
|
|
5622
|
-
url: url,
|
|
5623
|
-
lineNo: lineNo,
|
|
5624
|
-
columnNo: columnNo,
|
|
5625
|
-
stackTrace: stackTrace
|
|
5626
|
-
}, Gleap.PRIORITY_MEDIUM, "CRASH", {
|
|
5627
|
-
screenshot: true,
|
|
5628
|
-
replays: true
|
|
5629
|
-
});
|
|
5630
|
-
} else {
|
|
5631
|
-
Gleap.startFeedbackFlow("crash");
|
|
5632
|
-
}
|
|
5633
|
-
}
|
|
5634
|
-
|
|
5635
|
-
return false;
|
|
5636
|
-
};
|
|
5637
|
-
}
|
|
5638
|
-
}, {
|
|
5639
|
-
key: "truncateString",
|
|
5640
|
-
value: function truncateString(str, num) {
|
|
5641
|
-
if (str.length > num) {
|
|
5642
|
-
return str.slice(0, num) + "...";
|
|
5643
|
-
} else {
|
|
5644
|
-
return str;
|
|
5645
|
-
}
|
|
5646
|
-
}
|
|
5647
|
-
}, {
|
|
5648
|
-
key: "addLog",
|
|
5649
|
-
value: function addLog(args, priority) {
|
|
5650
|
-
if (!args) {
|
|
5651
|
-
return;
|
|
5652
|
-
}
|
|
5653
|
-
|
|
5654
|
-
var log = "";
|
|
5655
|
-
|
|
5656
|
-
for (var i = 0; i < args.length; i++) {
|
|
5657
|
-
log += args[i] + " ";
|
|
5658
|
-
}
|
|
5659
|
-
|
|
5660
|
-
this.logArray.push({
|
|
5661
|
-
log: this.truncateString(log, 1000),
|
|
5662
|
-
date: new Date(),
|
|
5663
|
-
priority: priority
|
|
5664
|
-
});
|
|
5665
|
-
|
|
5666
|
-
if (this.logArray.length > this.logMaxLength) {
|
|
5667
|
-
this.logArray.shift();
|
|
5668
|
-
}
|
|
5669
|
-
}
|
|
5670
|
-
}, {
|
|
5671
|
-
key: "overwriteConsoleLog",
|
|
5672
|
-
value: function overwriteConsoleLog() {
|
|
5673
|
-
var self = this;
|
|
5674
|
-
|
|
5675
|
-
window.console = function (origConsole) {
|
|
5676
|
-
if (!window.console || !origConsole) {
|
|
5677
|
-
origConsole = {};
|
|
5678
|
-
}
|
|
5679
|
-
|
|
5680
|
-
self.originalConsoleLog = origConsole;
|
|
5681
|
-
return Gleap_objectSpread(Gleap_objectSpread({}, origConsole), {}, {
|
|
5682
|
-
log: function log() {
|
|
5683
|
-
self.addLog(arguments, "INFO");
|
|
5684
|
-
origConsole.log && origConsole.log.apply(origConsole, arguments);
|
|
5685
|
-
},
|
|
5686
|
-
warn: function warn() {
|
|
5687
|
-
self.addLog(arguments, "WARNING");
|
|
5688
|
-
origConsole.warn && origConsole.warn.apply(origConsole, arguments);
|
|
5689
|
-
},
|
|
5690
|
-
error: function error() {
|
|
5691
|
-
self.addLog(arguments, "ERROR");
|
|
5692
|
-
origConsole.error && origConsole.error.apply(origConsole, arguments);
|
|
5693
|
-
},
|
|
5694
|
-
info: function info(v) {
|
|
5695
|
-
self.addLog(arguments, "INFO");
|
|
5696
|
-
origConsole.info && origConsole.info.apply(origConsole, arguments);
|
|
5697
|
-
}
|
|
5698
|
-
});
|
|
5699
|
-
}(window.console);
|
|
5700
|
-
}
|
|
5701
5913
|
}, {
|
|
5702
5914
|
key: "resetLoading",
|
|
5703
5915
|
value: function resetLoading(resetProgress) {
|
|
@@ -5882,8 +6094,9 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5882
6094
|
}, {
|
|
5883
6095
|
key: "init",
|
|
5884
6096
|
value: function init() {
|
|
5885
|
-
|
|
5886
|
-
|
|
6097
|
+
GleapConsoleLogManager.getInstance().start();
|
|
6098
|
+
GleapCrashDetector.getInstance().start();
|
|
6099
|
+
GleapClickListener.getInstance().start();
|
|
5887
6100
|
this.registerKeyboardListener();
|
|
5888
6101
|
this.registerEscListener(); // Initially check network
|
|
5889
6102
|
|
|
@@ -6149,7 +6362,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6149
6362
|
priority: this.severity,
|
|
6150
6363
|
customData: this.customData,
|
|
6151
6364
|
metaData: this.getMetaData(),
|
|
6152
|
-
consoleLog:
|
|
6365
|
+
consoleLog: GleapConsoleLogManager.getInstance().getLogs(),
|
|
6153
6366
|
networkLogs: this.networkIntercepter.getRequests(),
|
|
6154
6367
|
customEventLog: StreamedEvent.getInstance().eventArray,
|
|
6155
6368
|
type: this.feedbackType,
|
|
@@ -6311,7 +6524,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6311
6524
|
currentUrl: window.location.href,
|
|
6312
6525
|
language: navigator.language || navigator.userLanguage,
|
|
6313
6526
|
mobile: isMobile(),
|
|
6314
|
-
sdkVersion: "6.
|
|
6527
|
+
sdkVersion: "6.9.2",
|
|
6315
6528
|
sdkType: "javascript"
|
|
6316
6529
|
};
|
|
6317
6530
|
}
|
|
@@ -6907,11 +7120,13 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6907
7120
|
instance.enabledRageClickDetector = true;
|
|
6908
7121
|
instance.enabledRageClickDetectorSilent = silent;
|
|
6909
7122
|
startRageClickDetector(function (target) {
|
|
7123
|
+
var elementDescription = getDOMElementDescription(target, false);
|
|
6910
7124
|
instance.rageClickDetected = true;
|
|
6911
7125
|
|
|
6912
7126
|
if (instance.enabledRageClickDetectorSilent) {
|
|
6913
7127
|
Gleap.sendSilentReport({
|
|
6914
|
-
description: "Rage click detected."
|
|
7128
|
+
description: "Rage click detected.",
|
|
7129
|
+
element: elementDescription
|
|
6915
7130
|
});
|
|
6916
7131
|
} else {
|
|
6917
7132
|
Gleap.startFeedbackFlow("crash");
|
|
@@ -7233,7 +7448,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
7233
7448
|
}, {
|
|
7234
7449
|
key: "disableConsoleLogOverwrite",
|
|
7235
7450
|
value: function disableConsoleLogOverwrite() {
|
|
7236
|
-
|
|
7451
|
+
GleapConsoleLogManager.getInstance().stop();
|
|
7237
7452
|
}
|
|
7238
7453
|
}]);
|
|
7239
7454
|
|