Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 Components.utils.import("resource://gre/modules/Services.jsm");
7 const Cc = Components.classes;
8 const Ci = Components.interfaces;
9 const Cr = Components.results;
11 do_get_profile();
13 do_register_cleanup(function() {
14 Services.obs.notifyObservers(null, "quit-application", null);
15 });
17 var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
18 getService(Ci.nsIProperties);
20 function importDatabaseFile(aFName)
21 {
22 var file = do_get_file(aFName);
23 var newFile = dirSvc.get("ProfD", Ci.nsIFile);
24 file.copyTo(newFile, "downloads.sqlite");
25 }
27 function cleanup()
28 {
29 // removing database
30 var dbFile = dirSvc.get("ProfD", Ci.nsIFile);
31 dbFile.append("downloads.sqlite");
32 if (dbFile.exists())
33 try { dbFile.remove(true); } catch(e) { /* stupid windows box */ }
34 }
36 cleanup();