Skip to content

Commit

Permalink
v3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Dec 11, 2020
1 parent 9c58347 commit d4e8c97
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build/index.css

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

2 changes: 1 addition & 1 deletion build/index.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.js.map

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": "bugbattle",
"version": "3.1.5",
"version": "3.1.6",
"main": "build/index.js",
"types": "index.d.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion published/latest/index.css

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

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions published/latest/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions src/lib/BugBattle.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,31 +170,11 @@ class BugBattle {
feedbackBtn.style.display = "none";
}

const self = this;
html2canvas(document.body, {
x: window.scrollX,
y: window.scrollY,
width: window.innerWidth,
height: window.innerHeight,
letterRendering: 1,
allowTaint: true,
useCORS: false,
logging: false,
imageTimeout: 15000,
proxy: "https://jsproxy.bugbattle.io/",
}).then(function (canvas) {
if (canvas) {
self.instance.screenshot = canvas.toDataURL();
if (self.instance.crashDetected) {
self.instance.askForCrashReport();
} else {
self.instance.showBugReportEditor();
}
} else {
console.warn("Couldn't create image.");
self.instance.showBugReportEditor();
}
});
if (this.instance.crashDetected) {
this.instance.askForCrashReport();
} else {
this.instance.showBugReportEditor();
}
}

startCrashDetection() {
Expand Down Expand Up @@ -286,6 +266,7 @@ class BugBattle {

var elem = document.createElement("div");
elem.className = "bugbattle--feedback-dialog-container";
elem.setAttribute("data-html2canvas-ignore", "true");
elem.innerHTML = `<div class='bugbattle--feedback-dialog'>
<div class="bugbattle--feedback-dialog-header">
<div></div>
Expand Down Expand Up @@ -330,6 +311,7 @@ class BugBattle {

var elem = document.createElement("div");
elem.className = "bugbattle--feedback-dialog-container";
elem.setAttribute("data-html2canvas-ignore", "true");
elem.innerHTML = `<div class='bugbattle--feedback-dialog'>
<div class="bugbattle--feedback-dialog-header">
<div></div>
Expand Down Expand Up @@ -475,7 +457,24 @@ class BugBattle {
console.log("BUGBATTLE: Please provide a valid API key!");
}

self.prepareScreenshot();
html2canvas(document.body, {
x: window.scrollX,
y: window.scrollY,
width: window.innerWidth,
height: window.innerHeight,
letterRendering: 1,
allowTaint: true,
useCORS: false,
logging: false,
imageTimeout: 15000,
proxy: "https://jsproxy.bugbattle.io/",
}).then(function (canvas) {
if (canvas) {
self.screenshot = canvas.toDataURL();
self.prepareScreenshot();
}
});

};
}

Expand Down Expand Up @@ -629,6 +628,7 @@ class BugBattle {

// Upload screenshot
self.uploadScreenshot(canvas.toDataURL("image/jpeg", 0.5));
self.screenshot = null;
};
imageObj.onerror = function () {
self.hide();
Expand Down Expand Up @@ -795,6 +795,7 @@ class BugBattle {
const self = this;
var bugReportingEditor = document.createElement("div");
bugReportingEditor.className = "bugbattle-screenshot-editor-container";
bugReportingEditor.setAttribute("data-html2canvas-ignore", "true");
bugReportingEditor.innerHTML = `
<div class='bugbattle-screenshot-editor-container-inner'>
<div class='bugbattle-screenshot-editor-borderlayer'></div>
Expand Down

0 comments on commit d4e8c97

Please sign in to comment.