Skip to content

Commit 32d805a

Browse files
committed
Fix Capture on reaload
1 parent 39c2c75 commit 32d805a

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
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.32
8+
* Fix [Capture on Reload](https://github.com/BabylonJS/Spector.js/issues/313)
89

910
## v0.9.31
1011
* Fix [Manifest V2](https://github.com/BabylonJS/Spector.js/issues/312)

extensions/contentScriptProxy.js

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,7 @@ var spectorCommunicationRebuildProgramElementId = "SPECTOR_COMMUNICATION_REBUILD
3737

3838
var spectorContextTypeKey = "__spector_context_type";
3939

40-
var captureOnLoad = false;
41-
var captureOnLoadTransient = false;
42-
var captureOnLoadQuickCapture = false;
43-
var captureOnLoadFullCapture = false;
44-
var captureOnLoadCommandCount = 500;
45-
var captureOffScreen = false;
46-
47-
if (sessionStorage.getItem(spectorCaptureOnLoadKey) === "true") {
48-
sessionStorage.setItem(spectorCaptureOnLoadKey, "false");
49-
captureOnLoad = true;
50-
51-
captureOnLoadTransient = (sessionStorage.getItem(spectorCaptureOnLoadTransientKey) === "true");
52-
captureOnLoadQuickCapture = (sessionStorage.getItem(spectorCaptureOnLoadQuickCaptureKey) === "true");
53-
captureOnLoadFullCapture = (sessionStorage.getItem(spectorCaptureOnLoadFullCaptureKey) === "true");
54-
captureOnLoadCommandCount = parseInt(sessionStorage.getItem(spectorCaptureOnLoadCommandCountKey));
55-
}
56-
57-
captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true");
40+
var captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true");
5841

5942
var frameId = null;
6043

@@ -199,15 +182,10 @@ listenForMessage(function (message) {
199182

200183
// We need to reload to inject the capture loading sequence.
201184
if (action === "captureOnLoad") {
202-
var transient = message.transient;
203-
var commandCount = message.commandCount;
204-
var quickCapture = message.quickCapture;
205-
var fullCapture = message.fullCapture;
206-
207-
sessionStorage.setItem(spectorCaptureOnLoadTransientKey, transient);
208-
sessionStorage.setItem(spectorCaptureOnLoadQuickCaptureKey, quickCapture);
209-
sessionStorage.setItem(spectorCaptureOnLoadFullCaptureKey, fullCapture);
210-
sessionStorage.setItem(spectorCaptureOnLoadCommandCountKey, commandCount);
185+
sessionStorage.setItem(spectorCaptureOnLoadTransientKey, message.transient);
186+
sessionStorage.setItem(spectorCaptureOnLoadQuickCaptureKey, message.quickCapture);
187+
sessionStorage.setItem(spectorCaptureOnLoadFullCaptureKey, message.fullCapture);
188+
sessionStorage.setItem(spectorCaptureOnLoadCommandCountKey, message.commandCount);
211189
sessionStorage.setItem(spectorCaptureOnLoadKey, "true");
212190

213191
// Delay for all frames.

0 commit comments

Comments
 (0)