diff --git a/documentation/changeLogs.md b/documentation/changeLogs.md index 192168c..73ac70c 100644 --- a/documentation/changeLogs.md +++ b/documentation/changeLogs.md @@ -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.32 +* Fix [Capture on Reload](https://github.com/BabylonJS/Spector.js/issues/313) ## v0.9.31 * Fix [Manifest V2](https://github.com/BabylonJS/Spector.js/issues/312) diff --git a/extensions/contentScriptProxy.js b/extensions/contentScriptProxy.js index 5b34929..e68298d 100644 --- a/extensions/contentScriptProxy.js +++ b/extensions/contentScriptProxy.js @@ -37,24 +37,7 @@ var spectorCommunicationRebuildProgramElementId = "SPECTOR_COMMUNICATION_REBUILD var spectorContextTypeKey = "__spector_context_type"; -var captureOnLoad = false; -var captureOnLoadTransient = false; -var captureOnLoadQuickCapture = false; -var captureOnLoadFullCapture = false; -var captureOnLoadCommandCount = 500; -var captureOffScreen = false; - -if (sessionStorage.getItem(spectorCaptureOnLoadKey) === "true") { - sessionStorage.setItem(spectorCaptureOnLoadKey, "false"); - captureOnLoad = true; - - captureOnLoadTransient = (sessionStorage.getItem(spectorCaptureOnLoadTransientKey) === "true"); - captureOnLoadQuickCapture = (sessionStorage.getItem(spectorCaptureOnLoadQuickCaptureKey) === "true"); - captureOnLoadFullCapture = (sessionStorage.getItem(spectorCaptureOnLoadFullCaptureKey) === "true"); - captureOnLoadCommandCount = parseInt(sessionStorage.getItem(spectorCaptureOnLoadCommandCountKey)); -} - -captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true"); +var captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true"); var frameId = null; @@ -199,15 +182,10 @@ listenForMessage(function (message) { // We need to reload to inject the capture loading sequence. if (action === "captureOnLoad") { - var transient = message.transient; - var commandCount = message.commandCount; - var quickCapture = message.quickCapture; - var fullCapture = message.fullCapture; - - sessionStorage.setItem(spectorCaptureOnLoadTransientKey, transient); - sessionStorage.setItem(spectorCaptureOnLoadQuickCaptureKey, quickCapture); - sessionStorage.setItem(spectorCaptureOnLoadFullCaptureKey, fullCapture); - sessionStorage.setItem(spectorCaptureOnLoadCommandCountKey, commandCount); + sessionStorage.setItem(spectorCaptureOnLoadTransientKey, message.transient); + sessionStorage.setItem(spectorCaptureOnLoadQuickCaptureKey, message.quickCapture); + sessionStorage.setItem(spectorCaptureOnLoadFullCaptureKey, message.fullCapture); + sessionStorage.setItem(spectorCaptureOnLoadCommandCountKey, message.commandCount); sessionStorage.setItem(spectorCaptureOnLoadKey, "true"); // Delay for all frames.