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

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] fixup! Bug 42019: Empty browser's clipboard on browser shutdown



Title: GitLab

ma1 pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 985e28f4
    by hackademix at 2024-10-17T16:25:01+02:00
    fixup! Bug 42019: Empty browser's clipboard on browser shutdown
    
    Bug 43209: Check if any data is available before trying to retrieve it from the clipboard.
    

1 changed file:

Changes:

  • browser/components/BrowserGlue.sys.mjs
    ... ... @@ -189,8 +189,17 @@ const ClipboardPrivacy = {
    189 189
         return trans;
    
    190 190
       },
    
    191 191
       _computeClipboardHash() {
    
    192
    +    const flavors = ["text/x-moz-url", "text/plain"];
    
    193
    +    if (
    
    194
    +      !Services.clipboard.hasDataMatchingFlavors(
    
    195
    +        flavors,
    
    196
    +        Ci.nsIClipboard.kGlobalClipboard
    
    197
    +      )
    
    198
    +    ) {
    
    199
    +      return null;
    
    200
    +    }
    
    192 201
         const trans = this._createTransferable();
    
    193
    -    ["text/x-moz-url", "text/plain"].forEach(trans.addDataFlavor);
    
    202
    +    flavors.forEach(trans.addDataFlavor);
    
    194 203
         try {
    
    195 204
           Services.clipboard.getData(trans, Ci.nsIClipboard.kGlobalClipboard);
    
    196 205
           const clipboardContent = {};
    

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