summaryrefslogtreecommitdiff
path: root/browser
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-01 07:17:50 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-01 07:17:50 +0100
commite59c00a5c59aefe2a408eb78509ef3afaf3658f8 (patch)
tree40b8c8bd311ff17abb81edd6f24bb6ad3ce9b9b8 /browser
parentabf60058584772437a317fbc27ea32cbda4a07cb (diff)
downloaduxp-e59c00a5c59aefe2a408eb78509ef3afaf3658f8.tar.gz
DevTools - Browser Console - restore sessions
https://github.com/MoonchildProductions/moebius/pull/112
Diffstat (limited to 'browser')
-rwxr-xr-xbrowser/base/content/browser.js2
-rw-r--r--browser/components/sessionstore/SessionStore.jsm25
2 files changed, 26 insertions, 1 deletions
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 910dc4f685..f2f64d75da 100755
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7913,7 +7913,7 @@ var TabContextMenu = {
Object.defineProperty(this, "HUDService", {
get: function HUDService_getter() {
let devtools = Cu.import("resource://devtools/shared/Loader.jsm", {}).devtools;
- return devtools.require("devtools/client/webconsole/hudservice");
+ return devtools.require("devtools/client/webconsole/hudservice").HUDService;
},
configurable: true,
enumerable: true
diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm
index 2f44b2af3b..93e21357f2 100644
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -186,6 +186,15 @@ XPCOMUtils.defineLazyModuleGetter(this, "ViewSourceBrowser",
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
"resource://gre/modules/AsyncShutdown.jsm");
+Object.defineProperty(this, "HUDService", {
+ get: function HUDService_getter() {
+ let devtools = Cu.import("resource://devtools/shared/Loader.jsm", {}).devtools;
+ return devtools.require("devtools/client/webconsole/hudservice").HUDService;
+ },
+ configurable: true,
+ enumerable: true
+});
+
/**
* |true| if we are in debug mode, |false| otherwise.
* Debug mode is controlled by preference browser.sessionstore.debug
@@ -2570,10 +2579,16 @@ var SessionStoreInternal = {
this._capClosedWindows();
}
+ // Scratchpad
if (lastSessionState.scratchpads) {
ScratchpadManager.restoreSession(lastSessionState.scratchpads);
}
+ // The Browser Console
+ if (lastSessionState.browserConsole) {
+ HUDService.restoreBrowserConsoleSession();
+ }
+
// Set data that persists between sessions
this._recentCrashes = lastSessionState.session &&
lastSessionState.session.recentCrashes || 0;
@@ -2931,6 +2946,7 @@ var SessionStoreInternal = {
global: this._globalState.getState()
};
+ // Scratchpad
if (Cu.isModuleLoaded("resource://devtools/client/scratchpad/scratchpad-manager.jsm")) {
// get open Scratchpad window states too
let scratchpads = ScratchpadManager.getSessionState();
@@ -2939,6 +2955,9 @@ var SessionStoreInternal = {
}
}
+ // The Browser Console
+ state.browserConsole = HUDService.getBrowserConsoleSessionState();
+
// Persist the last session if we deferred restoring it
if (LastSession.canRestore) {
state.lastSessionState = LastSession.getState();
@@ -3290,9 +3309,15 @@ var SessionStoreInternal = {
this.restoreWindow(aWindow, root.windows[0], aOptions);
+ // Scratchpad
if (aState.scratchpads) {
ScratchpadManager.restoreSession(aState.scratchpads);
}
+
+ // The Browser Console
+ if (aState.browserConsole) {
+ HUDService.restoreBrowserConsoleSession();
+ }
},
/**