Skip to content

Commit

Permalink
v8.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Oct 20, 2022
1 parent 80cc3ad commit bfa3b0e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

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": "8.2.1",
"version": "8.2.2",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/8.2.2/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ class Gleap {
instance.offlineMode = offlineMode;
}

static doFun() {
const feedback = new GleapFeedback("CRASH", "HIGH", {}, true, false);
return feedback.takeSnapshot();
}

/**
* Revert console log overwrite.
*/
Expand Down Expand Up @@ -692,4 +697,4 @@ if (typeof window !== "undefined") {
}

export { GleapNetworkIntercepter, GleapAudioManager, GleapNotificationManager, GleapPreFillManager, GleapShortcutListener, GleapMarkerManager, GleapTranslationManager, GleapReplayRecorder, GleapFeedback, GleapConsoleLogManager, GleapRageClickDetector, GleapCustomActionManager, GleapEventManager, GleapCustomDataManager, GleapFeedbackButtonManager, GleapCrashDetector, GleapClickListener, GleapSession, GleapStreamedEvent, GleapConfigManager, GleapFrameManager, GleapMetaDataManager };
export default Gleap;
export default Gleap;
20 changes: 12 additions & 8 deletions src/ScreenCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const replaceAsync = (str, regex, asyncFn) => {
});
};

const loadCSSUrlResources = (data, basePath) => {
const loadCSSUrlResources = (data, basePath, remote) => {
return replaceAsync(
data,
/url\((.*?)\)/g,
Expand All @@ -55,7 +55,7 @@ const loadCSSUrlResources = (data, basePath) => {
if (!matchedData) {
return resolve(matchedData);
}

var matchedUrl = matchedData
.substr(4, matchedData.length - 5)
.replaceAll("'", "")
Expand All @@ -76,9 +76,14 @@ const loadCSSUrlResources = (data, basePath) => {
resourcePath = basePath + "/" + matchedUrl;
}

return fetchCSSResource(resourcePath).then((resourceData) => {
return resolve("url(" + resourceData + ")");
});
// Try to fetch external resource.
if (!remote) {
return fetchCSSResource(resourcePath).then((resourceData) => {
return resolve("url(" + resourceData + ")");
});
} else {
return resolve("url(" + resourcePath + ")");
}
} catch (exp) {
return resolve(matchedData);
}
Expand Down Expand Up @@ -238,9 +243,8 @@ const downloadAllCSSUrlResources = (clone, remote) => {
for (var i = 0; i < document.styleSheets.length; i++) {
const styleSheet = document.styleSheets[i];
const cssTextContent = getTextContentFromStyleSheet(styleSheet);

if (styleSheet && styleSheet.ownerNode) {
if (cssTextContent != "" && !remote) {
if (cssTextContent != "") {
// Resolve resources.
const baseTags = document.getElementsByTagName("base");
var basePathURL = baseTags.length
Expand All @@ -251,7 +255,7 @@ const downloadAllCSSUrlResources = (clone, remote) => {
}
const basePath = basePathURL.substring(0, basePathURL.lastIndexOf("/"));
promises.push(
loadCSSUrlResources(cssTextContent, basePath).then(
loadCSSUrlResources(cssTextContent, basePath, remote).then(
(replacedStyle) => {
return {
styletext: replacedStyle,
Expand Down

0 comments on commit bfa3b0e

Please sign in to comment.