releasebird-javascript-sdk 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -90,18 +90,30 @@ export default class RbirdScreenshotManager {
|
|
|
90
90
|
let that = this;
|
|
91
91
|
const loader = this.showLoader();
|
|
92
92
|
|
|
93
|
-
//
|
|
93
|
+
// Small delay to ensure the loader is rendered before we start the screenshot process
|
|
94
94
|
setTimeout(() => {
|
|
95
|
-
loader.style.display = 'none';
|
|
96
|
-
if (that.boundary) {
|
|
97
|
-
that.boundary.style.display = 'none';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
95
|
html2canvas(document.body, {
|
|
101
|
-
allowTaint:
|
|
102
|
-
useCORS:
|
|
103
|
-
logging:
|
|
104
|
-
foreignObjectRendering:
|
|
96
|
+
allowTaint: true,
|
|
97
|
+
useCORS: true,
|
|
98
|
+
logging: true,
|
|
99
|
+
foreignObjectRendering: true,
|
|
100
|
+
scale: window.devicePixelRatio || 1,
|
|
101
|
+
backgroundColor: null,
|
|
102
|
+
removeContainer: true,
|
|
103
|
+
ignoreElements: function(element) {
|
|
104
|
+
// Ignore the loader and marker boundary elements
|
|
105
|
+
if (element.id === 'rbirdScreenshotLoader' ||
|
|
106
|
+
element.id === 'markerBoundary' ||
|
|
107
|
+
element.className === 'rbird-screenshot-loader' ||
|
|
108
|
+
element.className === 'markerBoundary') {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
// Also ignore any releasebird widget elements
|
|
112
|
+
if (element.id && element.id.startsWith('rbird')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
105
117
|
}).then(function (canvas) {
|
|
106
118
|
that.hideLoader();
|
|
107
119
|
|
|
@@ -117,11 +129,6 @@ export default class RbirdScreenshotManager {
|
|
|
117
129
|
|
|
118
130
|
//document.body.appendChild(canvas);
|
|
119
131
|
}).catch((e) => {
|
|
120
|
-
// Restore visibility in case of error
|
|
121
|
-
loader.style.display = 'flex';
|
|
122
|
-
if (that.boundary) {
|
|
123
|
-
that.boundary.style.display = 'block';
|
|
124
|
-
}
|
|
125
132
|
that.hideLoader();
|
|
126
133
|
console.error('Screenshot error:', e);
|
|
127
134
|
});
|