1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/about/nsIAboutModule.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIURI; 1.12 +interface nsIChannel; 1.13 + 1.14 +[scriptable, uuid(9575693c-60d9-4332-b6b8-6c29289339cb)] 1.15 +interface nsIAboutModule : nsISupports 1.16 +{ 1.17 + /** 1.18 + * Constructs a new channel for the about protocol module. 1.19 + * 1.20 + * @param aURI the uri of the new channel 1.21 + */ 1.22 + nsIChannel newChannel(in nsIURI aURI); 1.23 + 1.24 + /** 1.25 + * A flag that indicates whether a URI is safe for untrusted 1.26 + * content. If it is, web pages and so forth will be allowed to 1.27 + * link to this about: URI, and the about: protocol handler will 1.28 + * enforce that the principal of channels created for it be based 1.29 + * on their originalURI or URI (depending on the channel flags), 1.30 + * by setting their "owner" to null. 1.31 + * Otherwise, only chrome will be able to link to it. 1.32 + */ 1.33 + const unsigned long URI_SAFE_FOR_UNTRUSTED_CONTENT = (1 << 0); 1.34 + 1.35 + /** 1.36 + * A flag that indicates whether script should be enabled for the 1.37 + * given about: URI even if it's disabled in general. 1.38 + */ 1.39 + const unsigned long ALLOW_SCRIPT = (1 << 1); 1.40 + 1.41 + /** 1.42 + * A flag that indicates whether this about: URI doesn't want to be listed 1.43 + * in about:about, especially if it's not useful without a query string. 1.44 + */ 1.45 + const unsigned long HIDE_FROM_ABOUTABOUT = (1 << 2); 1.46 + 1.47 + /** 1.48 + * A method to get the flags that apply to a given about: URI. The URI 1.49 + * passed in is guaranteed to be one of the URIs that this module 1.50 + * registered to deal with. 1.51 + */ 1.52 + unsigned long getURIFlags(in nsIURI aURI); 1.53 +}; 1.54 + 1.55 +%{C++ 1.56 + 1.57 +#define NS_ABOUT_MODULE_CONTRACTID "@mozilla.org/network/protocol/about;1" 1.58 +#define NS_ABOUT_MODULE_CONTRACTID_PREFIX NS_ABOUT_MODULE_CONTRACTID "?what=" 1.59 +#define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49 // strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX) 1.60 + 1.61 +%}