Skip to content

Commit ac081e3

Browse files
committed
Fix Drag and Drop captures
1 parent 46113e5 commit ac081e3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

documentation/changeLogs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
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.
66

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

910
## v0.9.24
1011
* Chrome web Store policy change

extensions/background.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ listenForMessage(function(request, sender, sendResponse) {
115115
popup.captureComplete(request.errorString);
116116
}
117117
}
118+
else if (request.capture) {
119+
var capture = request.capture;
120+
// Open the result view if not open (need to check if length == 1 that the function exists for Edge),
121+
window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
122+
resultTab = tab;
123+
currentCapture = capture;
124+
currentFrameId = frameId;
125+
currentTabId = sender.tab.id;
126+
});
127+
}
118128
else if (request.captureChunk) {
119129
currentCaptureChunks.push(request.captureChunk);
120130
}
@@ -124,8 +134,6 @@ listenForMessage(function(request, sender, sendResponse) {
124134
currentCaptureChunks = [];
125135
var fullJSON = "".concat.apply("", allChunks);
126136
var capture = JSON.parse(fullJSON);
127-
// If a capture has been received,
128-
var tabWindows = browser.extension.getViews({type: "tab"});
129137
// Open the result view if not open (need to check if length == 1 that the function exists for Edge),
130138
window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
131139
resultTab = tab;

0 commit comments

Comments
 (0)