Skip to content

Commit bfa3b0e

Browse files
committed
v8.2.2
1 parent 80cc3ad commit bfa3b0e

File tree

6 files changed

+22
-12
lines changed

6 files changed

+22
-12
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.

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

published/8.2.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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ class Gleap {
9191
instance.offlineMode = offlineMode;
9292
}
9393

94+
static doFun() {
95+
const feedback = new GleapFeedback("CRASH", "HIGH", {}, true, false);
96+
return feedback.takeSnapshot();
97+
}
98+
9499
/**
95100
* Revert console log overwrite.
96101
*/
@@ -692,4 +697,4 @@ if (typeof window !== "undefined") {
692697
}
693698

694699
export { GleapNetworkIntercepter, GleapAudioManager, GleapNotificationManager, GleapPreFillManager, GleapShortcutListener, GleapMarkerManager, GleapTranslationManager, GleapReplayRecorder, GleapFeedback, GleapConsoleLogManager, GleapRageClickDetector, GleapCustomActionManager, GleapEventManager, GleapCustomDataManager, GleapFeedbackButtonManager, GleapCrashDetector, GleapClickListener, GleapSession, GleapStreamedEvent, GleapConfigManager, GleapFrameManager, GleapMetaDataManager };
695-
export default Gleap;
700+
export default Gleap;

src/ScreenCapture.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const replaceAsync = (str, regex, asyncFn) => {
4646
});
4747
};
4848

49-
const loadCSSUrlResources = (data, basePath) => {
49+
const loadCSSUrlResources = (data, basePath, remote) => {
5050
return replaceAsync(
5151
data,
5252
/url\((.*?)\)/g,
@@ -55,7 +55,7 @@ const loadCSSUrlResources = (data, basePath) => {
5555
if (!matchedData) {
5656
return resolve(matchedData);
5757
}
58-
58+
5959
var matchedUrl = matchedData
6060
.substr(4, matchedData.length - 5)
6161
.replaceAll("'", "")
@@ -76,9 +76,14 @@ const loadCSSUrlResources = (data, basePath) => {
7676
resourcePath = basePath + "/" + matchedUrl;
7777
}
7878

79-
return fetchCSSResource(resourcePath).then((resourceData) => {
80-
return resolve("url(" + resourceData + ")");
81-
});
79+
// Try to fetch external resource.
80+
if (!remote) {
81+
return fetchCSSResource(resourcePath).then((resourceData) => {
82+
return resolve("url(" + resourceData + ")");
83+
});
84+
} else {
85+
return resolve("url(" + resourcePath + ")");
86+
}
8287
} catch (exp) {
8388
return resolve(matchedData);
8489
}
@@ -238,9 +243,8 @@ const downloadAllCSSUrlResources = (clone, remote) => {
238243
for (var i = 0; i < document.styleSheets.length; i++) {
239244
const styleSheet = document.styleSheets[i];
240245
const cssTextContent = getTextContentFromStyleSheet(styleSheet);
241-
242246
if (styleSheet && styleSheet.ownerNode) {
243-
if (cssTextContent != "" && !remote) {
247+
if (cssTextContent != "") {
244248
// Resolve resources.
245249
const baseTags = document.getElementsByTagName("base");
246250
var basePathURL = baseTags.length
@@ -251,7 +255,7 @@ const downloadAllCSSUrlResources = (clone, remote) => {
251255
}
252256
const basePath = basePathURL.substring(0, basePathURL.lastIndexOf("/"));
253257
promises.push(
254-
loadCSSUrlResources(cssTextContent, basePath).then(
258+
loadCSSUrlResources(cssTextContent, basePath, remote).then(
255259
(replacedStyle) => {
256260
return {
257261
styletext: replacedStyle,

0 commit comments

Comments
 (0)