diff --git a/src/torbrowser-launcher b/src/torbrowser-launcher index 7f6623b..8c127e3 100755 --- a/src/torbrowser-launcher +++ b/src/torbrowser-launcher @@ -385,8 +385,8 @@ const TorBrowserLauncher = new Lang.Class({ let bytes_so_far = 0; // open the file - let file = Gio.file_new_for_path(path); - let fstream = file.replace(null, false, Gio.FileCreateFlags.NONE, null); + var f = Gio.file_new_for_path(String(path)); + var data_out = new Gio.DataOutputStream({base_stream:f.replace(null, false, Gio.FileCreateFlags.NONE, null)}); // create an http message let request = Soup.Message.new('GET', url); @@ -398,10 +398,11 @@ const TorBrowserLauncher = new Lang.Class({ // update progress bar with each chunk request.connect('got_chunk', Lang.bind(this, function(message, chunk){ - print(chunk[0]); - print('== start =='); - fstream.write(chunk, chunk.length, null); - print('== finish =='); + // write chunk to file + let data = chunk.get_data(); + for(let i=0; i