Skip to content

Commit fa572ef

Browse files
committed
v8.4.2
1 parent c92eb3f commit fa572ef

File tree

8 files changed

+30
-22
lines changed

8 files changed

+30
-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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const Gleap = window.Gleap;
22

33
// Gleap.setFrameUrl("http://0.0.0.0:3001");
44
// Gleap.setApiUrl("http://0.0.0.0:9000");
5-
Gleap.initialize("9BCaEJAeWk437XdiKKYqxsNvl7WPBpAc");
5+
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
66
//Gleap.setEnvironment("dev");
77

88
Gleap.attachCustomData({

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": "8.4.1",
3+
"version": "8.4.2",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/8.4.2/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/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import GleapPreFillManager from "./GleapPreFillManager";
2323
import GleapNotificationManager from "./GleapNotificationManager";
2424
import GleapAudioManager from "./GleapAudioManager";
2525

26-
if (typeof HTMLCanvasElement !== "undefined" && HTMLCanvasElement.prototype) {
26+
if (typeof HTMLCanvasElement !== "undefined" && HTMLCanvasElement.prototype && HTMLCanvasElement.prototype.__originalGetContext === undefined) {
2727
HTMLCanvasElement.prototype.__originalGetContext =
2828
HTMLCanvasElement.prototype.getContext;
2929
HTMLCanvasElement.prototype.getContext = function (type, options) {
@@ -623,7 +623,7 @@ class Gleap {
623623
/**
624624
* Opens a help center collection
625625
*/
626-
static openHelpCenterCollection(collectionId, showBackButton = true) {
626+
static openHelpCenterCollection(collectionId, showBackButton = true) {
627627
if (!collectionId) {
628628
return;
629629
}

src/GleapConfigManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default class GleapConfigManager {
149149
}
150150

151151
Gleap.enableShortcuts(flowConfig.enableShortcuts ? true : false);
152-
} catch (e) {}
152+
} catch (e) { }
153153
}
154154

155155
getFeedbackOptions(feedbackFlow) {

src/GleapNetworkIntercepter.js

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -425,24 +425,31 @@ class GleapNetworkIntercepter {
425425
const open = XMLHttpRequest.prototype.open;
426426
const send = XMLHttpRequest.prototype.send;
427427

428-
XMLHttpRequest.prototype.wrappedSetRequestHeader =
429-
XMLHttpRequest.prototype.setRequestHeader;
430-
XMLHttpRequest.prototype.setRequestHeader = function (header, value) {
431-
if (!this.requestHeaders) {
432-
this.requestHeaders = {};
433-
}
428+
// Only override open and send if they haven't been overridden already.
429+
if (XMLHttpRequest.prototype.gleapSetRequestHeader === undefined) {
430+
XMLHttpRequest.prototype.gleapSetRequestHeader =
431+
XMLHttpRequest.prototype.setRequestHeader;
432+
}
433+
434+
if (XMLHttpRequest.prototype.gleapSetRequestHeader) {
435+
XMLHttpRequest.prototype.setRequestHeader = function (header, value) {
436+
if (!this.requestHeaders) {
437+
this.requestHeaders = {};
438+
}
434439

435-
if (this.requestHeaders && this.requestHeaders.hasOwnProperty(header)) {
436-
return;
437-
}
440+
if (this.requestHeaders && this.requestHeaders.hasOwnProperty(header)) {
441+
return;
442+
}
438443

439-
if (!this.requestHeaders[header]) {
440-
this.requestHeaders[header] = [];
441-
}
444+
if (!this.requestHeaders[header]) {
445+
this.requestHeaders[header] = [];
446+
}
447+
448+
this.requestHeaders[header].push(value);
449+
this.gleapSetRequestHeader(header, value);
450+
};
451+
}
442452

443-
this.requestHeaders[header].push(value);
444-
this.wrappedSetRequestHeader(header, value);
445-
};
446453
XMLHttpRequest.prototype.open = function () {
447454
this["bbRequestId"] = ++self.requestId;
448455
callback.onOpen && callback.onOpen(this, arguments);

0 commit comments

Comments
 (0)