In the current patch, I add three functions in the "nsIXULBrowserWindow.idl".
The three functions are implemented in "browser/base/content/browser.js".
The function "updateSessionStore()" will call SessionStore.updateSessionStoreFromCPP() with "tab" and "data".
Currently, I cannot update TabState correctly. The tab I get seems not the right one.
@TabParent.cpp
browser = mFrameElement->AsBrowser
@browser.js
tab = gBrowser.getTabForBrowser(aBrowser)
@sessionStore.jsm
updateSessionStoreFromCPP(aTab, aData) {
let browser = aTab.linkedBrowser;
let win = browser.ownerGlobal;
TabState.update(browser, aData);
this.saveStateDelayed(win);
}
Originally, the sessionStore get "browser" from "aMessage.target".
https://searchfox.org/mozilla-central/rev/aae527894a97ee3bbe0c2cfce9c67c59e8b8fcb9/browser/components/sessionstore/SessionStore.jsm#829
receiveMessage(aMessage) {
// If we got here, that means we're dealing with a frame message
// manager message, so the target will be a <xul:browser>.
var browser = aMessage.target;
let win = browser.ownerGlobal;
....
switch (aMessage.name) {
case "SessionStore:update":
....
TabState.update(browser, aMessage.data);
this.saveStateDelayed(win);
Bug 1474130 Comment 13 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
In the current patch, I add three functions in the "nsIXULBrowserWindow.idl".
The three functions are implemented in "browser/base/content/browser.js".
The function "updateSessionStore()" will call SessionStore.updateSessionStoreFromCPP() with "tab" and "data".
Currently, I cannot update TabState correctly. The tab I get seems not the right one.
@TabParent.cpp
mozilla::ipc::IPCResult TabParent::RecvSessionStoreUpdate
browser = mFrameElement->AsBrowser
@browser.js
updateSessionStore: function XWB_updateSessionStore(aBrowser)
tab = gBrowser.getTabForBrowser(aBrowser)
@sessionStore.jsm
updateSessionStoreFromCPP(aTab, aData) {
let browser = aTab.linkedBrowser;
let win = browser.ownerGlobal;
TabState.update(browser, aData);
this.saveStateDelayed(win);
}
Originally, the sessionStore get "browser" from "aMessage.target".
https://searchfox.org/mozilla-central/rev/aae527894a97ee3bbe0c2cfce9c67c59e8b8fcb9/browser/components/sessionstore/SessionStore.jsm#829
receiveMessage(aMessage) {
// If we got here, that means we're dealing with a frame message
// manager message, so the target will be a <xul:browser>.
var browser = aMessage.target;
let win = browser.ownerGlobal;
....
switch (aMessage.name) {
case "SessionStore:update":
....
TabState.update(browser, aMessage.data);
this.saveStateDelayed(win);
In the current patch, I add three functions in the "nsIXULBrowserWindow.idl".
The three functions are implemented in "browser/base/content/browser.js".
The function "updateSessionStore()" will call SessionStore.updateSessionStoreFromCPP() with "tab" and "data".
Currently, I cannot update TabState correctly. The tab I get seems not the right one.
@TabParent.cpp mozilla::ipc::IPCResult TabParent::RecvSessionStoreUpdate()
browser = mFrameElement->AsBrowser
@browser.js
updateSessionStore: function XWB_updateSessionStore(aBrowser)
tab = gBrowser.getTabForBrowser(aBrowser)
@sessionStore.jsm
updateSessionStoreFromCPP(aTab, aData) {
let browser = aTab.linkedBrowser;
let win = browser.ownerGlobal;
TabState.update(browser, aData);
this.saveStateDelayed(win);
}
Originally, the sessionStore get "browser" from "aMessage.target".
https://searchfox.org/mozilla-central/rev/aae527894a97ee3bbe0c2cfce9c67c59e8b8fcb9/browser/components/sessionstore/SessionStore.jsm#829
receiveMessage(aMessage) {
// If we got here, that means we're dealing with a frame message
// manager message, so the target will be a <xul:browser>.
var browser = aMessage.target;
let win = browser.ownerGlobal;
....
switch (aMessage.name) {
case "SessionStore:update":
....
TabState.update(browser, aMessage.data);
this.saveStateDelayed(win);
In the current patch, I add three functions in the "nsIXULBrowserWindow.idl".
The three functions are implemented in "browser/base/content/browser.js".
The function "updateSessionStore()" will call SessionStore.updateSessionStoreFromCPP() with "tab" and "data".
Currently, I cannot update TabState correctly. The tab I get seems not the right one.
@TabParent.cpp
mozilla::ipc::IPCResult TabParent::RecvSessionStoreUpdate()
browser = mFrameElement->AsBrowser
@browser/base/content/browser.js
updateSessionStore: function XWB_updateSessionStore(aBrowser)
tab = gBrowser.getTabForBrowser(aBrowser)
@sessionStore.jsm
updateSessionStoreFromCPP(aTab, aData) {
let browser = aTab.linkedBrowser;
let win = browser.ownerGlobal;
TabState.update(browser, aData);
this.saveStateDelayed(win);
}
Originally, the sessionStore get "browser" from "aMessage.target".
https://searchfox.org/mozilla-central/rev/aae527894a97ee3bbe0c2cfce9c67c59e8b8fcb9/browser/components/sessionstore/SessionStore.jsm#829
receiveMessage(aMessage) {
// If we got here, that means we're dealing with a frame message
// manager message, so the target will be a <xul:browser>.
var browser = aMessage.target;
let win = browser.ownerGlobal;
....
switch (aMessage.name) {
case "SessionStore:update":
....
TabState.update(browser, aMessage.data);
this.saveStateDelayed(win);