[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.16.0esr-13.5-1] Bug 1886222 - Start reload by calling reload in the parent....
ma1 (@ma1)
git at gitlab.torproject.org
Tue Oct 15 20:11:59 UTC 2024
ma1 pushed to branch tor-browser-115.16.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
10897e71 by Andreas Farre at 2024-10-15T22:08:54+02:00
Bug 1886222 - Start reload by calling reload in the parent. r=Gijs,canadahonk,smaug, a=dsmith (esr128->esr115 backport)
Differential Revision: https://phabricator.services.mozilla.com/D211519
- - - - -
3 changed files:
- browser/actors/BrowserTabChild.sys.mjs
- browser/base/content/browser.js
- docshell/shistory/nsISHistory.idl
Changes:
=====================================
browser/actors/BrowserTabChild.sys.mjs
=====================================
@@ -3,12 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-const lazy = {};
-
-ChromeUtils.defineESModuleGetters(lazy, {
- E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
-});
-
export class BrowserTabChild extends JSWindowActorChild {
constructor() {
super();
@@ -19,34 +13,6 @@ export class BrowserTabChild extends JSWindowActorChild {
let docShell = context.docShell;
switch (message.name) {
- // XXX(nika): Should we try to call this in the parent process instead?
- case "Browser:Reload":
- /* First, we'll try to use the session history object to reload so
- * that framesets are handled properly. If we're in a special
- * window (such as view-source) that has no session history, fall
- * back on using the web navigation's reload method.
- */
- let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
- try {
- if (webNav.sessionHistory) {
- webNav = webNav.sessionHistory;
- }
- } catch (e) {}
-
- let reloadFlags = message.data.flags;
- if (message.data.handlingUserInput) {
- reloadFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_USER_ACTIVATION;
- }
-
- try {
- lazy.E10SUtils.wrapHandlingUserInput(
- this.document.defaultView,
- message.data.handlingUserInput,
- () => webNav.reload(reloadFlags)
- );
- } catch (e) {}
- break;
-
case "ForceEncodingDetection":
docShell.forceEncodingDetection();
break;
=====================================
browser/base/content/browser.js
=====================================
@@ -3571,17 +3571,29 @@ function BrowserReloadWithFlags(reloadFlags) {
gIdentityHandler.hidePopup();
gPermissionPanel.hidePopup();
- let handlingUserInput = document.hasValidTransientUserGestureActivation;
+ if (document.hasValidTransientUserGestureActivation) {
+ reloadFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_USER_ACTIVATION;
+ }
for (let tab of unchangedRemoteness) {
if (tab.linkedPanel) {
- sendReloadMessage(tab);
+ const { browsingContext } = tab.linkedBrowser;
+ const { sessionHistory } = browsingContext;
+ if (sessionHistory) {
+ sessionHistory.reload(reloadFlags);
+ } else {
+ browsingContext.reload(reloadFlags);
+ }
} else {
// Shift to fully loaded browser and make
// sure load handler is instantiated.
- tab.addEventListener("SSTabRestoring", () => sendReloadMessage(tab), {
- once: true,
- });
+ tab.addEventListener(
+ "SSTabRestoring",
+ () => tab.linkedBrowser.browsingContext.reload(reloadFlags),
+ {
+ once: true,
+ }
+ );
gBrowser._insertBrowser(tab);
}
}
@@ -3593,13 +3605,6 @@ function BrowserReloadWithFlags(reloadFlags) {
});
}
- function sendReloadMessage(tab) {
- tab.linkedBrowser.sendMessageToActor(
- "Browser:Reload",
- { flags: reloadFlags, handlingUserInput },
- "BrowserTab"
- );
- }
}
// TODO: can we pull getPEMString in from pippki.js instead of
=====================================
docshell/shistory/nsISHistory.idl
=====================================
@@ -268,8 +268,7 @@ interface nsISHistory: nsISupports
[noscript, notxpcom]
void RemoveFrameEntries(in nsISHEntry aEntry);
- [noscript]
- void Reload(in unsigned long aReloadFlags);
+ void reload(in unsigned long aReloadFlags);
[notxpcom] void EnsureCorrectEntryAtCurrIndex(in nsISHEntry aEntry);
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/10897e7173f799863ee5481b6a2b6c313174a548
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/10897e7173f799863ee5481b6a2b6c313174a548
You're receiving this email because of your account on gitlab.torproject.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20241015/3a99936d/attachment-0001.htm>
More information about the tor-commits
mailing list