[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[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....



Title: GitLab

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:

Changes:

  • browser/actors/BrowserTabChild.sys.mjs
    ... ... @@ -3,12 +3,6 @@
    3 3
      * License, v. 2.0. If a copy of the MPL was not distributed with this
    
    4 4
      * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    
    5 5
     
    
    6
    -const lazy = {};
    
    7
    -
    
    8
    -ChromeUtils.defineESModuleGetters(lazy, {
    
    9
    -  E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
    
    10
    -});
    
    11
    -
    
    12 6
     export class BrowserTabChild extends JSWindowActorChild {
    
    13 7
       constructor() {
    
    14 8
         super();
    
    ... ... @@ -19,34 +13,6 @@ export class BrowserTabChild extends JSWindowActorChild {
    19 13
         let docShell = context.docShell;
    
    20 14
     
    
    21 15
         switch (message.name) {
    
    22
    -      // XXX(nika): Should we try to call this in the parent process instead?
    
    23
    -      case "Browser:Reload":
    
    24
    -        /* First, we'll try to use the session history object to reload so
    
    25
    -         * that framesets are handled properly. If we're in a special
    
    26
    -         * window (such as view-source) that has no session history, fall
    
    27
    -         * back on using the web navigation's reload method.
    
    28
    -         */
    
    29
    -        let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
    
    30
    -        try {
    
    31
    -          if (webNav.sessionHistory) {
    
    32
    -            webNav = webNav.sessionHistory;
    
    33
    -          }
    
    34
    -        } catch (e) {}
    
    35
    -
    
    36
    -        let reloadFlags = message.data.flags;
    
    37
    -        if (message.data.handlingUserInput) {
    
    38
    -          reloadFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_USER_ACTIVATION;
    
    39
    -        }
    
    40
    -
    
    41
    -        try {
    
    42
    -          lazy.E10SUtils.wrapHandlingUserInput(
    
    43
    -            this.document.defaultView,
    
    44
    -            message.data.handlingUserInput,
    
    45
    -            () => webNav.reload(reloadFlags)
    
    46
    -          );
    
    47
    -        } catch (e) {}
    
    48
    -        break;
    
    49
    -
    
    50 16
           case "ForceEncodingDetection":
    
    51 17
             docShell.forceEncodingDetection();
    
    52 18
             break;
    

  • browser/base/content/browser.js
    ... ... @@ -3571,17 +3571,29 @@ function BrowserReloadWithFlags(reloadFlags) {
    3571 3571
       gIdentityHandler.hidePopup();
    
    3572 3572
       gPermissionPanel.hidePopup();
    
    3573 3573
     
    
    3574
    -  let handlingUserInput = document.hasValidTransientUserGestureActivation;
    
    3574
    +  if (document.hasValidTransientUserGestureActivation) {
    
    3575
    +    reloadFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_USER_ACTIVATION;
    
    3576
    +  }
    
    3575 3577
     
    
    3576 3578
       for (let tab of unchangedRemoteness) {
    
    3577 3579
         if (tab.linkedPanel) {
    
    3578
    -      sendReloadMessage(tab);
    
    3580
    +      const { browsingContext } = tab.linkedBrowser;
    
    3581
    +      const { sessionHistory } = browsingContext;
    
    3582
    +      if (sessionHistory) {
    
    3583
    +        sessionHistory.reload(reloadFlags);
    
    3584
    +      } else {
    
    3585
    +        browsingContext.reload(reloadFlags);
    
    3586
    +      }
    
    3579 3587
         } else {
    
    3580 3588
           // Shift to fully loaded browser and make
    
    3581 3589
           // sure load handler is instantiated.
    
    3582
    -      tab.addEventListener("SSTabRestoring", () => sendReloadMessage(tab), {
    
    3583
    -        once: true,
    
    3584
    -      });
    
    3590
    +      tab.addEventListener(
    
    3591
    +        "SSTabRestoring",
    
    3592
    +        () => tab.linkedBrowser.browsingContext.reload(reloadFlags),
    
    3593
    +        {
    
    3594
    +          once: true,
    
    3595
    +        }
    
    3596
    +      );
    
    3585 3597
           gBrowser._insertBrowser(tab);
    
    3586 3598
         }
    
    3587 3599
       }
    
    ... ... @@ -3593,13 +3605,6 @@ function BrowserReloadWithFlags(reloadFlags) {
    3593 3605
         });
    
    3594 3606
       }
    
    3595 3607
     
    
    3596
    -  function sendReloadMessage(tab) {
    
    3597
    -    tab.linkedBrowser.sendMessageToActor(
    
    3598
    -      "Browser:Reload",
    
    3599
    -      { flags: reloadFlags, handlingUserInput },
    
    3600
    -      "BrowserTab"
    
    3601
    -    );
    
    3602
    -  }
    
    3603 3608
     }
    
    3604 3609
     
    
    3605 3610
     // TODO: can we pull getPEMString in from pippki.js instead of
    

  • docshell/shistory/nsISHistory.idl
    ... ... @@ -268,8 +268,7 @@ interface nsISHistory: nsISupports
    268 268
       [noscript, notxpcom]
    
    269 269
       void RemoveFrameEntries(in nsISHEntry aEntry);
    
    270 270
     
    
    271
    -  [noscript]
    
    272
    -  void Reload(in unsigned long aReloadFlags);
    
    271
    +  void reload(in unsigned long aReloadFlags);
    
    273 272
     
    
    274 273
       [notxpcom] void EnsureCorrectEntryAtCurrIndex(in nsISHEntry aEntry);
    
    275 274
     
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits