Skip to content

Commit

Permalink
v6.8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Apr 9, 2022
1 parent ca45e99 commit 50ce3ee
Show file tree
Hide file tree
Showing 9 changed files with 7,480 additions and 48 deletions.
75 changes: 61 additions & 14 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,28 @@ var GleapNetworkIntercepter = /*#__PURE__*/function () {
}

_createClass(GleapNetworkIntercepter, [{
key: "isContentTypeSupported",
value: function isContentTypeSupported(contentType) {
if (typeof contentType !== "string") {
return false;
}

if (contentType === "") {
return true;
}

contentType = contentType.toLocaleLowerCase();
var supportedContentTypes = ["text/", "xml", "json"];

for (var i = 0; i < supportedContentTypes.length; i++) {
if (contentType.includes(supportedContentTypes[i])) {
return true;
}
}

return false;
}
}, {
key: "getRequests",
value: function getRequests() {
var requests = this.externalConsoleLogs.concat(Object.values(this.requests));
Expand Down Expand Up @@ -1154,22 +1176,47 @@ var GleapNetworkIntercepter = /*#__PURE__*/function () {
_this.calcRequestTime(bbRequestId);
} catch (exp) {}

req.text().then(function (responseText) {
if (_this.requests[bbRequestId]) {
_this.requests[bbRequestId]["success"] = true;
_this.requests[bbRequestId]["response"] = {
status: req.status,
statusText: req.statusText,
responseText: self.calculateTextSize(responseText) > 0.5 ? "<response_too_large>" : responseText
};
try {
var contentType = "";

if (req.headers && typeof req.headers.get !== "undefined") {
contentType = req.headers.get("content-type");
}

_this.calcRequestTime(bbRequestId);
console.log(contentType);

_this.cleanRequests();
})["catch"](function (err) {
_this.cleanRequests();
});
if (_this.isContentTypeSupported(contentType)) {
req.text().then(function (responseText) {
if (_this.requests[bbRequestId]) {
_this.requests[bbRequestId]["success"] = true;
_this.requests[bbRequestId]["response"] = {
status: req.status,
statusText: req.statusText,
responseText: self.calculateTextSize(responseText) > 0.5 ? "<response_too_large>" : responseText
};
}

_this.calcRequestTime(bbRequestId);

_this.cleanRequests();
})["catch"](function (err) {
_this.cleanRequests();
});
} else {
if (_this.requests[bbRequestId]) {
_this.requests[bbRequestId]["success"] = true;
_this.requests[bbRequestId]["response"] = {
status: req.status,
statusText: req.statusText,
responseText: "<content_type_not_supported>"
};
}

_this.calcRequestTime(bbRequestId);

_this.cleanRequests();
}
} catch (exp) {}
},
onFetchFailed: function onFetchFailed(err, bbRequestId) {
if (_this.stopped || !bbRequestId || !_this.requests || !_this.requests[bbRequestId]) {
Expand Down Expand Up @@ -6264,7 +6311,7 @@ var Gleap_Gleap = /*#__PURE__*/function () {
currentUrl: window.location.href,
language: navigator.language || navigator.userLanguage,
mobile: isMobile(),
sdkVersion: "6.8.10",
sdkVersion: "6.8.11",
sdkType: "javascript"
};
}
Expand Down
15 changes: 11 additions & 4 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<!-- index.js as found in build/index.js -->
<script src="index.js"></script>
<script src="main.js"></script>
<style>
* {
box-sizing: border-box;
Expand Down Expand Up @@ -129,7 +132,7 @@
font-size: 16px;
font-weight: 600;
color: rgb(255, 255, 255);
background-color: #485BFF;
background-color: #485bff;
border-style: solid;
border-width: 0px;
border-radius: 10px;
Expand Down Expand Up @@ -236,9 +239,13 @@ <h2 class="sub-headline">
SHOOTS OF ANY KIND TO BE BOOKED THROUGH AIRBNB. WE ARE NO LONGER ALLOWING
WEDDINGS. FOR INQUIRIES BEYOND VACATION RENTAL PLEASE CONTACT LOCATIONS
UNLIMITED.
<audio controls>
<source
src="https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga"
type="audio/mpeg"
/>
Your browser does not support the audio element.
</audio>
</div>
<!-- index.js as found in build/index.js -->
<script src="index.js"></script>
<script src="main.js"></script>
</body>
</html>
27 changes: 23 additions & 4 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,26 @@ setTimeout(() => {
console.log("Data will be loaded soon.");
}, 0);

setTimeout(() => {
console.warn("Failed to attach button listener.");
x();
}, 4000);
const files = [
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
"https://reqres.in/api/products/3",
];

setTimeout(async () => {
console.log("LOADING AUDIO:");
for (let i = 0; i < files.length; i++) {
let file = files[i];

const response = await fetch(file);
if (response.ok) {
const arrayBuffer = await response.arrayBuffer();
if (!arrayBuffer.byteLength) return;
}
}


const a = await fetch("https://reqres.in/api/products/3");
const j = await a.json();
console.log(j);
}, 5000);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "6.8.10",
"version": "6.8.11",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/6.8.11/appwidget.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 50ce3ee

Please sign in to comment.