Skip to content

Commit 50ce3ee

Browse files
committed
v6.8.11
1 parent ca45e99 commit 50ce3ee

File tree

9 files changed

+7480
-48
lines changed

9 files changed

+7480
-48
lines changed

build/index.js

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,28 @@ var GleapNetworkIntercepter = /*#__PURE__*/function () {
971971
}
972972

973973
_createClass(GleapNetworkIntercepter, [{
974+
key: "isContentTypeSupported",
975+
value: function isContentTypeSupported(contentType) {
976+
if (typeof contentType !== "string") {
977+
return false;
978+
}
979+
980+
if (contentType === "") {
981+
return true;
982+
}
983+
984+
contentType = contentType.toLocaleLowerCase();
985+
var supportedContentTypes = ["text/", "xml", "json"];
986+
987+
for (var i = 0; i < supportedContentTypes.length; i++) {
988+
if (contentType.includes(supportedContentTypes[i])) {
989+
return true;
990+
}
991+
}
992+
993+
return false;
994+
}
995+
}, {
974996
key: "getRequests",
975997
value: function getRequests() {
976998
var requests = this.externalConsoleLogs.concat(Object.values(this.requests));
@@ -1154,22 +1176,47 @@ var GleapNetworkIntercepter = /*#__PURE__*/function () {
11541176
_this.calcRequestTime(bbRequestId);
11551177
} catch (exp) {}
11561178

1157-
req.text().then(function (responseText) {
1158-
if (_this.requests[bbRequestId]) {
1159-
_this.requests[bbRequestId]["success"] = true;
1160-
_this.requests[bbRequestId]["response"] = {
1161-
status: req.status,
1162-
statusText: req.statusText,
1163-
responseText: self.calculateTextSize(responseText) > 0.5 ? "<response_too_large>" : responseText
1164-
};
1179+
try {
1180+
var contentType = "";
1181+
1182+
if (req.headers && typeof req.headers.get !== "undefined") {
1183+
contentType = req.headers.get("content-type");
11651184
}
11661185

1167-
_this.calcRequestTime(bbRequestId);
1186+
console.log(contentType);
11681187

1169-
_this.cleanRequests();
1170-
})["catch"](function (err) {
1171-
_this.cleanRequests();
1172-
});
1188+
if (_this.isContentTypeSupported(contentType)) {
1189+
req.text().then(function (responseText) {
1190+
if (_this.requests[bbRequestId]) {
1191+
_this.requests[bbRequestId]["success"] = true;
1192+
_this.requests[bbRequestId]["response"] = {
1193+
status: req.status,
1194+
statusText: req.statusText,
1195+
responseText: self.calculateTextSize(responseText) > 0.5 ? "<response_too_large>" : responseText
1196+
};
1197+
}
1198+
1199+
_this.calcRequestTime(bbRequestId);
1200+
1201+
_this.cleanRequests();
1202+
})["catch"](function (err) {
1203+
_this.cleanRequests();
1204+
});
1205+
} else {
1206+
if (_this.requests[bbRequestId]) {
1207+
_this.requests[bbRequestId]["success"] = true;
1208+
_this.requests[bbRequestId]["response"] = {
1209+
status: req.status,
1210+
statusText: req.statusText,
1211+
responseText: "<content_type_not_supported>"
1212+
};
1213+
}
1214+
1215+
_this.calcRequestTime(bbRequestId);
1216+
1217+
_this.cleanRequests();
1218+
}
1219+
} catch (exp) {}
11731220
},
11741221
onFetchFailed: function onFetchFailed(err, bbRequestId) {
11751222
if (_this.stopped || !bbRequestId || !_this.requests || !_this.requests[bbRequestId]) {
@@ -6264,7 +6311,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
62646311
currentUrl: window.location.href,
62656312
language: navigator.language || navigator.userLanguage,
62666313
mobile: isMobile(),
6267-
sdkVersion: "6.8.10",
6314+
sdkVersion: "6.8.11",
62686315
sdkType: "javascript"
62696316
};
62706317
}

demo/index.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
rel="stylesheet"
2222
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
2323
/>
24+
<!-- index.js as found in build/index.js -->
25+
<script src="index.js"></script>
26+
<script src="main.js"></script>
2427
<style>
2528
* {
2629
box-sizing: border-box;
@@ -129,7 +132,7 @@
129132
font-size: 16px;
130133
font-weight: 600;
131134
color: rgb(255, 255, 255);
132-
background-color: #485BFF;
135+
background-color: #485bff;
133136
border-style: solid;
134137
border-width: 0px;
135138
border-radius: 10px;
@@ -236,9 +239,13 @@ <h2 class="sub-headline">
236239
SHOOTS OF ANY KIND TO BE BOOKED THROUGH AIRBNB. WE ARE NO LONGER ALLOWING
237240
WEDDINGS. FOR INQUIRIES BEYOND VACATION RENTAL PLEASE CONTACT LOCATIONS
238241
UNLIMITED.
242+
<audio controls>
243+
<source
244+
src="https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga"
245+
type="audio/mpeg"
246+
/>
247+
Your browser does not support the audio element.
248+
</audio>
239249
</div>
240-
<!-- index.js as found in build/index.js -->
241-
<script src="index.js"></script>
242-
<script src="main.js"></script>
243250
</body>
244251
</html>

demo/main.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,26 @@ setTimeout(() => {
3838
console.log("Data will be loaded soon.");
3939
}, 0);
4040

41-
setTimeout(() => {
42-
console.warn("Failed to attach button listener.");
43-
x();
44-
}, 4000);
41+
const files = [
42+
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
43+
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
44+
"https://reqres.in/api/products/3",
45+
];
46+
47+
setTimeout(async () => {
48+
console.log("LOADING AUDIO:");
49+
for (let i = 0; i < files.length; i++) {
50+
let file = files[i];
51+
52+
const response = await fetch(file);
53+
if (response.ok) {
54+
const arrayBuffer = await response.arrayBuffer();
55+
if (!arrayBuffer.byteLength) return;
56+
}
57+
}
58+
59+
60+
const a = await fetch("https://reqres.in/api/products/3");
61+
const j = await a.json();
62+
console.log(j);
63+
}, 5000);

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

published/6.8.11/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.

0 commit comments

Comments
 (0)