gleap 6.8.14 → 6.9.0
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 +361 -143
- 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
|
|
|
@@ -507,6 +571,7 @@ var deepClone = function deepClone(host) {
|
|
|
507
571
|
|
|
508
572
|
if (node.shadowRoot) {
|
|
509
573
|
walkTree(node.shadowRoot.firstChild, clone, shadowNodeId);
|
|
574
|
+
handleAdoptedStyleSheets(node.shadowRoot, clone, shadowNodeId);
|
|
510
575
|
|
|
511
576
|
if (typeof clone.setAttribute !== "undefined") {
|
|
512
577
|
clone.setAttribute("bb-shadow-parent", shadowNodeId);
|
|
@@ -519,7 +584,15 @@ var deepClone = function deepClone(host) {
|
|
|
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,258 @@ 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
|
+
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
|
5531
|
+
return false;
|
|
5532
|
+
};
|
|
5533
|
+
}
|
|
5534
|
+
}], [{
|
|
5535
|
+
key: "getInstance",
|
|
5536
|
+
value: // GleapCrashDetector singleton
|
|
5537
|
+
function getInstance() {
|
|
5538
|
+
if (!this.instance) {
|
|
5539
|
+
this.instance = new GleapCrashDetector();
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
return this.instance;
|
|
5543
|
+
}
|
|
5544
|
+
}]);
|
|
5545
|
+
|
|
5546
|
+
return GleapCrashDetector;
|
|
5547
|
+
}();
|
|
5548
|
+
|
|
5549
|
+
GleapCrashDetector_defineProperty(GleapCrashDetector, "instance", void 0);
|
|
5550
|
+
|
|
5551
|
+
|
|
5552
|
+
;// CONCATENATED MODULE: ./src/GleapClickListener.js
|
|
5553
|
+
function GleapClickListener_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5554
|
+
|
|
5555
|
+
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); } }
|
|
5556
|
+
|
|
5557
|
+
function GleapClickListener_createClass(Constructor, protoProps, staticProps) { if (protoProps) GleapClickListener_defineProperties(Constructor.prototype, protoProps); if (staticProps) GleapClickListener_defineProperties(Constructor, staticProps); return Constructor; }
|
|
5558
|
+
|
|
5559
|
+
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; }
|
|
5560
|
+
|
|
5561
|
+
|
|
5562
|
+
|
|
5563
|
+
|
|
5564
|
+
var GleapClickListener = /*#__PURE__*/function () {
|
|
5565
|
+
function GleapClickListener() {
|
|
5566
|
+
GleapClickListener_classCallCheck(this, GleapClickListener);
|
|
5567
|
+
}
|
|
5568
|
+
|
|
5569
|
+
GleapClickListener_createClass(GleapClickListener, [{
|
|
5570
|
+
key: "start",
|
|
5571
|
+
value: function start() {
|
|
5572
|
+
document.addEventListener("click", function (event) {
|
|
5573
|
+
if (!event.target) {
|
|
5574
|
+
return;
|
|
5575
|
+
}
|
|
5576
|
+
|
|
5577
|
+
if (!Gleap.getInstance().currentlySendingBug) {
|
|
5578
|
+
GleapConsoleLogManager.getInstance().addLog([getDOMElementDescription(event.target)], "CLICK");
|
|
5579
|
+
}
|
|
5580
|
+
});
|
|
5581
|
+
}
|
|
5582
|
+
}], [{
|
|
5583
|
+
key: "getInstance",
|
|
5584
|
+
value: function getInstance() {
|
|
5585
|
+
if (!this.instance) {
|
|
5586
|
+
this.instance = new GleapClickListener();
|
|
5587
|
+
}
|
|
5588
|
+
|
|
5589
|
+
return this.instance;
|
|
5590
|
+
}
|
|
5591
|
+
}]);
|
|
5592
|
+
|
|
5593
|
+
return GleapClickListener;
|
|
5594
|
+
}();
|
|
5595
|
+
|
|
5596
|
+
GleapClickListener_defineProperty(GleapClickListener, "instance", void 0);
|
|
5597
|
+
|
|
5598
|
+
|
|
5283
5599
|
;// CONCATENATED MODULE: ./src/Gleap.js
|
|
5284
5600
|
function Gleap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5285
5601
|
|
|
@@ -5309,6 +5625,9 @@ function Gleap_defineProperty(obj, key, value) { if (key in obj) { Object.define
|
|
|
5309
5625
|
|
|
5310
5626
|
|
|
5311
5627
|
|
|
5628
|
+
|
|
5629
|
+
|
|
5630
|
+
|
|
5312
5631
|
if (typeof HTMLCanvasElement !== "undefined" && HTMLCanvasElement.prototype) {
|
|
5313
5632
|
HTMLCanvasElement.prototype.__originalGetContext = HTMLCanvasElement.prototype.getContext;
|
|
5314
5633
|
|
|
@@ -5356,16 +5675,12 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5356
5675
|
|
|
5357
5676
|
Gleap_defineProperty(this, "actionLog", []);
|
|
5358
5677
|
|
|
5359
|
-
Gleap_defineProperty(this, "logArray", []);
|
|
5360
|
-
|
|
5361
5678
|
Gleap_defineProperty(this, "customData", {});
|
|
5362
5679
|
|
|
5363
5680
|
Gleap_defineProperty(this, "formData", {});
|
|
5364
5681
|
|
|
5365
5682
|
Gleap_defineProperty(this, "excludeData", {});
|
|
5366
5683
|
|
|
5367
|
-
Gleap_defineProperty(this, "logMaxLength", 500);
|
|
5368
|
-
|
|
5369
5684
|
Gleap_defineProperty(this, "buttonType", Gleap.FEEDBACK_BUTTON_NONE);
|
|
5370
5685
|
|
|
5371
5686
|
Gleap_defineProperty(this, "feedbackType", "BUG");
|
|
@@ -5598,106 +5913,6 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5598
5913
|
this.replay.stop(!this.isLiveSite);
|
|
5599
5914
|
}
|
|
5600
5915
|
}
|
|
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
5916
|
}, {
|
|
5702
5917
|
key: "resetLoading",
|
|
5703
5918
|
value: function resetLoading(resetProgress) {
|
|
@@ -5882,8 +6097,9 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
5882
6097
|
}, {
|
|
5883
6098
|
key: "init",
|
|
5884
6099
|
value: function init() {
|
|
5885
|
-
|
|
5886
|
-
|
|
6100
|
+
GleapConsoleLogManager.getInstance().start();
|
|
6101
|
+
GleapCrashDetector.getInstance().start();
|
|
6102
|
+
GleapClickListener.getInstance().start();
|
|
5887
6103
|
this.registerKeyboardListener();
|
|
5888
6104
|
this.registerEscListener(); // Initially check network
|
|
5889
6105
|
|
|
@@ -6149,7 +6365,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6149
6365
|
priority: this.severity,
|
|
6150
6366
|
customData: this.customData,
|
|
6151
6367
|
metaData: this.getMetaData(),
|
|
6152
|
-
consoleLog:
|
|
6368
|
+
consoleLog: GleapConsoleLogManager.getInstance().getLogs(),
|
|
6153
6369
|
networkLogs: this.networkIntercepter.getRequests(),
|
|
6154
6370
|
customEventLog: StreamedEvent.getInstance().eventArray,
|
|
6155
6371
|
type: this.feedbackType,
|
|
@@ -6311,7 +6527,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6311
6527
|
currentUrl: window.location.href,
|
|
6312
6528
|
language: navigator.language || navigator.userLanguage,
|
|
6313
6529
|
mobile: isMobile(),
|
|
6314
|
-
sdkVersion: "6.
|
|
6530
|
+
sdkVersion: "6.9.0",
|
|
6315
6531
|
sdkType: "javascript"
|
|
6316
6532
|
};
|
|
6317
6533
|
}
|
|
@@ -6907,11 +7123,13 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
6907
7123
|
instance.enabledRageClickDetector = true;
|
|
6908
7124
|
instance.enabledRageClickDetectorSilent = silent;
|
|
6909
7125
|
startRageClickDetector(function (target) {
|
|
7126
|
+
var elementDescription = getDOMElementDescription(target, false);
|
|
6910
7127
|
instance.rageClickDetected = true;
|
|
6911
7128
|
|
|
6912
7129
|
if (instance.enabledRageClickDetectorSilent) {
|
|
6913
7130
|
Gleap.sendSilentReport({
|
|
6914
|
-
description: "Rage click detected."
|
|
7131
|
+
description: "Rage click detected.",
|
|
7132
|
+
element: elementDescription
|
|
6915
7133
|
});
|
|
6916
7134
|
} else {
|
|
6917
7135
|
Gleap.startFeedbackFlow("crash");
|
|
@@ -7233,7 +7451,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
|
|
|
7233
7451
|
}, {
|
|
7234
7452
|
key: "disableConsoleLogOverwrite",
|
|
7235
7453
|
value: function disableConsoleLogOverwrite() {
|
|
7236
|
-
|
|
7454
|
+
GleapConsoleLogManager.getInstance().stop();
|
|
7237
7455
|
}
|
|
7238
7456
|
}]);
|
|
7239
7457
|
|