Skip to content

Commit dc76c67

Browse files
committed
v6.6.0
1 parent cdbceb6 commit dc76c67

File tree

9 files changed

+85
-22
lines changed

9 files changed

+85
-22
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/main.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const Gleap = window.Gleap;
22

3-
Gleap.initialize("wytzEhhSa1EFfTEqK3HXBWuGRt2PREAE");
3+
Gleap.setApiUrl("http://localhost:9000");
4+
Gleap.initialize("x8FMqDm2Q0Pl8f3SbDqyyIFVwOXa1Mws");
45

56
/*
67
@@ -32,9 +33,11 @@ setTimeout(() => {
3233
console.warn(request.statusText, request.responseText);
3334
}
3435
});
35-
request.send(JSON.stringify({
36-
"asdf": "asdfasdf"
37-
}));
36+
request.send(
37+
JSON.stringify({
38+
asdf: "asdfasdf",
39+
})
40+
);
3841
}, 2000);
3942

4043
Gleap.setNetworkLogFilters(["Authentication", "pragma"]);
@@ -68,3 +71,8 @@ Gleap.attachNetworkLogs([
6871
},
6972
},
7073
]);
74+
75+
setTimeout(() => {
76+
x();
77+
// Gleap.sendSilentBugReport("Rage click detected.");
78+
}, 5000);

index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,29 @@ export namespace Gleap {
44
gleapId?: string,
55
gleapHash?: string
66
): void;
7+
/**
8+
* @deprecated Please use sendSilentReport instead.
9+
*/
710
function sendSilentBugReport(
811
description: string,
912
priority: "LOW" | "MEDIUM" | "HIGH"
1013
): void;
14+
function sendSilentReport(
15+
formData: {
16+
[key: string]: string;
17+
},
18+
priority?: "LOW" | "MEDIUM" | "HIGH",
19+
feedbackType?: string,
20+
excludeData?: {
21+
customData: Boolean;
22+
metaData: Boolean;
23+
consoleLog: Boolean;
24+
networkLogs: Boolean;
25+
customEventLog: Boolean;
26+
screenshot: Boolean;
27+
replays: Boolean;
28+
}
29+
): void;
1130
function setCustomerEmail(email: string): void;
1231
function attachCustomData(customData: any): void;
1332
function setCustomData(key: string, value: string): void;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "6.5.9",
3+
"version": "6.6.0",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/6.6.0/appwidget.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/6.6.0/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/6.6.0/index.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gleap.js

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,9 @@ class Gleap {
621621
startRageClickDetector(function (target) {
622622
instance.rageClickDetected = true;
623623
if (instance.enabledRageClickDetectorSilent) {
624-
Gleap.sendSilentBugReport("Rage click detected.");
624+
Gleap.sendSilentReport({
625+
description: "Rage click detected.",
626+
});
625627
} else {
626628
Gleap.startFeedbackFlow("crash");
627629
}
@@ -680,30 +682,50 @@ class Gleap {
680682

681683
/**
682684
* Reports a bug silently
683-
* @param {*} description
685+
* @param {*} formData
686+
* @param {*} priority
687+
* @param {*} feedbackType
684688
*/
685-
static sendSilentBugReport(description, priority = Gleap.PRIORITY_MEDIUM) {
689+
static sendSilentReport(
690+
formData,
691+
priority = Gleap.PRIORITY_MEDIUM,
692+
feedbackType = "BUG",
693+
excludeData = {}
694+
) {
686695
const instance = this.getInstance();
687696
const sessionInstance = Session.getInstance();
688697

689698
if (!sessionInstance.ready) {
690699
return;
691700
}
692701

693-
instance.formData = {};
702+
instance.excludeData = excludeData ? excludeData : {};
703+
instance.severity = priority;
704+
instance.feedbackType = feedbackType;
705+
706+
instance.formData = formData ? formData : {};
694707
if (sessionInstance.session.email) {
695708
instance.formData.reportedBy = sessionInstance.session.email;
696709
}
697-
if (description) {
698-
instance.formData.description = description;
699-
}
700-
701-
instance.severity = priority;
702-
instance.feedbackType = "BUG";
703710

704711
this.startFeedbackFlow(null, true);
705712
}
706713

714+
/**
715+
* Reports a bug silently
716+
* @param {*} description
717+
* @deprecated Please use sendSilentReport instead.
718+
*/
719+
static sendSilentBugReport(description, priority = Gleap.PRIORITY_MEDIUM) {
720+
return Gleap.sendSilentReport(
721+
{
722+
description: description,
723+
},
724+
priority,
725+
"BUG"
726+
);
727+
}
728+
707729
/**
708730
* Starts the feedback type selection flow.
709731
*/
@@ -948,7 +970,7 @@ class Gleap {
948970
"URL: " + url,
949971
"Line: " + lineNo,
950972
"Column: " + columnNo,
951-
"Error object: " + JSON.stringify(error),
973+
"Stack: " + (error && error.stack) ? error.stack : "",
952974
];
953975
self.addLog(message, "ERROR");
954976

@@ -959,10 +981,21 @@ class Gleap {
959981
) {
960982
self.appCrashDetected = true;
961983
if (self.enabledCrashDetectorSilent) {
962-
const errorMessage = `Message: ${msg}\nURL: ${url}\nLine: ${lineNo}\nColumn: ${columnNo}\nError object: ${JSON.stringify(
963-
error
964-
)}\n`;
965-
Gleap.sendSilentBugReport(errorMessage);
984+
return Gleap.sendSilentReport(
985+
{
986+
errorMessage: msg,
987+
url: url,
988+
lineNo: lineNo,
989+
columnNo: columnNo,
990+
stackTrace: error && error.stack ? error.stack : "",
991+
},
992+
Gleap.PRIORITY_MEDIUM,
993+
"CRASH",
994+
{
995+
screenshot: true,
996+
replays: true,
997+
}
998+
);
966999
} else {
9671000
Gleap.startFeedbackFlow("crash");
9681001
}

0 commit comments

Comments
 (0)