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 const Ci = Components.interfaces;
6 const Cu = Components.utils;
8 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
9 Cu.import("resource://gre/modules/Services.jsm");
11 function ContentDispatchChooser() {}
13 ContentDispatchChooser.prototype =
14 {
15 classID: Components.ID("5a072a22-1e66-4100-afc1-07aed8b62fc5"),
17 QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentDispatchChooser]),
19 ask: function ask(aHandler, aWindowContext, aURI, aReason) {
20 let window = null;
21 try {
22 if (aWindowContext)
23 window = aWindowContext.getInterface(Ci.nsIDOMWindow);
24 } catch (e) { /* it's OK to not have a window */ }
26 let bundle = Services.strings.createBundle("chrome://mozapps/locale/handling/handling.properties");
28 let title = bundle.GetStringFromName("protocol.title");
29 let message = bundle.GetStringFromName("protocol.description");
31 let open = Services.prompt.confirm(window, title, message);
32 if (open)
33 aHandler.launchWithURI(aURI, aWindowContext);
34 }
35 };
37 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]);