[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-102.5.0esr-12.5-1] fixup! Bug 16940: After update, load local change notes.

Richard Pospesel (@richard) git at gitlab.torproject.org
Thu Dec 15 14:54:05 UTC 2022



Richard Pospesel pushed to branch tor-browser-102.5.0esr-12.5-1 at The Tor Project / Applications / Tor Browser


Commits:
81c5119b by Pier Angelo Vendrame at 2022-12-13T16:27:53+01:00
fixup! Bug 16940: After update, load local change notes.

Bug 41524: Read changelogs as UTF-8

- - - - -


1 changed file:

- browser/actors/AboutTBUpdateParent.jsm


Changes:

=====================================
browser/actors/AboutTBUpdateParent.jsm
=====================================
@@ -22,9 +22,9 @@ const kRequestUpdateMessageName = "FetchUpdateData";
  * implementation.
  */
 class AboutTBUpdateParent extends JSWindowActorParent {
-  receiveMessage(aMessage) {
+  async receiveMessage(aMessage) {
     if (aMessage.name == kRequestUpdateMessageName) {
-      return this.releaseNoteInfo;
+      return this.getReleaseNoteInfo();
     }
     return undefined;
   }
@@ -51,7 +51,7 @@ class AboutTBUpdateParent extends JSWindowActorParent {
   // On Mac OS, when building with --enable-tor-browser-data-outside-app-dir
   // to support Gatekeeper signing, the ChangeLog.txt file is located in
   // TorBrowser.app/Contents/Resources/TorBrowser/Docs/.
-  get releaseNoteInfo() {
+  async getReleaseNoteInfo() {
     let info = { moreInfoURL: this.moreInfoURL };
 
     try {
@@ -74,12 +74,7 @@ class AboutTBUpdateParent extends JSWindowActorParent {
       f.append("Docs");
       f.append("ChangeLog.txt");
 
-      let fs = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
-        Ci.nsIFileInputStream
-      );
-      fs.init(f, -1, 0, 0);
-      let s = NetUtil.readInputStreamToString(fs, fs.available());
-      fs.close();
+      let s = await IOUtils.readUTF8(f.path);
 
       // Truncate at the first empty line.
       s = s.replace(/[\r\n][\r\n][\s\S]*$/m, "");



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/81c5119bad40f5cb6b9b4cdccadeec229c5a0798

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/81c5119bad40f5cb6b9b4cdccadeec229c5a0798
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/tbb-commits/attachments/20221215/a6f60486/attachment-0001.htm>


More information about the tbb-commits mailing list