Skip to content

Commit

Permalink
Fix Drag and Drop captures
Browse files Browse the repository at this point in the history
  • Loading branch information
sebavan committed Jun 8, 2021
1 parent 46113e5 commit ac081e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/changeLogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Please, find below the per release summary of the contribution added to the project per version. Each of the listed versions is having its corresponding tag in the repo.

## v0.9.25
* [Fix Drag and Drop captures in the main extension popup](https://github.com/BabylonJS/Spector.js/issues/199)

## v0.9.24
* Chrome web Store policy change
Expand Down
12 changes: 10 additions & 2 deletions extensions/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ listenForMessage(function(request, sender, sendResponse) {
popup.captureComplete(request.errorString);
}
}
else if (request.capture) {
var capture = request.capture;
// Open the result view if not open (need to check if length == 1 that the function exists for Edge),
window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
resultTab = tab;
currentCapture = capture;
currentFrameId = frameId;
currentTabId = sender.tab.id;
});
}
else if (request.captureChunk) {
currentCaptureChunks.push(request.captureChunk);
}
Expand All @@ -124,8 +134,6 @@ listenForMessage(function(request, sender, sendResponse) {
currentCaptureChunks = [];
var fullJSON = "".concat.apply("", allChunks);
var capture = JSON.parse(fullJSON);
// If a capture has been received,
var tabWindows = browser.extension.getViews({type: "tab"});
// Open the result view if not open (need to check if length == 1 that the function exists for Edge),
window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
resultTab = tab;
Expand Down

0 comments on commit ac081e3

Please sign in to comment.