2000-03-30 12:29:11 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-03-30 12:29:11 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIDocShellLoadInfo interface defines an interface for specifying
|
|
|
|
* setup information used in a nsIDocShell::loadURI call.
|
|
|
|
*/
|
|
|
|
|
|
|
|
interface nsIURI;
|
2001-05-14 02:16:27 +00:00
|
|
|
interface nsIInputStream;
|
2000-06-21 06:40:08 +00:00
|
|
|
interface nsISHEntry;
|
2014-01-13 07:58:16 +00:00
|
|
|
interface nsIDocShell;
|
2016-07-28 07:20:41 +00:00
|
|
|
interface nsIPrincipal;
|
2000-06-21 06:40:08 +00:00
|
|
|
|
2000-06-22 07:22:23 +00:00
|
|
|
typedef long nsDocShellInfoLoadType;
|
2014-11-18 13:46:29 +00:00
|
|
|
typedef unsigned long nsDocShellInfoReferrerPolicy;
|
2000-03-30 12:29:11 +00:00
|
|
|
|
2015-10-05 10:33:00 +00:00
|
|
|
[scriptable, uuid(e7570e5a-f1d6-452d-b4f8-b35fdc63aa03)]
|
2000-03-30 12:29:11 +00:00
|
|
|
interface nsIDocShellLoadInfo : nsISupports
|
|
|
|
{
|
2002-12-12 23:10:59 +00:00
|
|
|
/** This is the referrer for the load. */
|
|
|
|
attribute nsIURI referrer;
|
2000-03-30 12:29:11 +00:00
|
|
|
|
2015-09-30 06:54:39 +00:00
|
|
|
/**
|
|
|
|
* The originalURI to be passed to nsIDocShell.internalLoad. May be null.
|
2015-10-05 10:33:00 +00:00
|
|
|
*/
|
2015-09-30 06:54:39 +00:00
|
|
|
attribute nsIURI originalURI;
|
|
|
|
|
2017-05-30 16:07:59 +00:00
|
|
|
/**
|
|
|
|
* Result principal URL from nsILoadInfo, may be null. Valid only if
|
|
|
|
* the "IsSome" part is true (has the same meaning as isSome()
|
|
|
|
* on mozilla::Maybe.)
|
|
|
|
*
|
|
|
|
* In C++ please use Get/SetMaybeResultPrincipalURI helper functions.
|
|
|
|
*/
|
|
|
|
attribute nsIURI resultPrincipalURI;
|
|
|
|
attribute boolean resultPrincipalURIIsSome;
|
|
|
|
|
2016-06-28 08:03:25 +00:00
|
|
|
/**
|
|
|
|
* loadReplace flag to be passed to nsIDocShell.internalLoad.
|
|
|
|
*/
|
|
|
|
attribute boolean loadReplace;
|
|
|
|
|
2016-07-28 07:20:41 +00:00
|
|
|
/** The principal of the load, that is, the entity responsible for
|
|
|
|
* causing the load to occur. In most cases the referrer and
|
|
|
|
* the triggeringPrincipal's URI will be identical.
|
2002-12-12 23:10:59 +00:00
|
|
|
*/
|
2016-07-28 07:20:41 +00:00
|
|
|
attribute nsIPrincipal triggeringPrincipal;
|
2000-06-21 06:40:08 +00:00
|
|
|
|
2016-07-28 07:20:41 +00:00
|
|
|
/** If this attribute is true and no triggeringPrincipal is specified,
|
|
|
|
* copy the principal from the referring document.
|
2002-12-12 23:10:59 +00:00
|
|
|
*/
|
2016-07-28 07:20:41 +00:00
|
|
|
attribute boolean inheritPrincipal;
|
2000-08-31 05:53:32 +00:00
|
|
|
|
2016-07-28 07:20:41 +00:00
|
|
|
/** If this attribute is true only ever use the principal specified
|
|
|
|
* by the triggeringPrincipal and inheritPrincipal attributes.
|
2009-03-10 06:03:39 +00:00
|
|
|
* If there are security reasons for why this is unsafe, such
|
2016-07-28 07:20:41 +00:00
|
|
|
* as trying to use a systemprincipal as the triggeringPrincipal
|
|
|
|
* for a content docshell the load fails.
|
2009-03-10 06:03:39 +00:00
|
|
|
*/
|
2016-07-28 07:20:41 +00:00
|
|
|
attribute boolean principalIsExplicit;
|
2009-03-10 06:03:39 +00:00
|
|
|
|
2017-11-08 19:01:41 +00:00
|
|
|
/**
|
|
|
|
* If this attribute is true, then a top-level navigation
|
|
|
|
* to a data URI will be allowed.
|
|
|
|
*/
|
|
|
|
attribute boolean forceAllowDataURI;
|
|
|
|
|
2017-11-05 04:06:20 +00:00
|
|
|
/**
|
|
|
|
* If this attribute is true, this load corresponds to a frame
|
|
|
|
* element loading its original src (or srcdoc) attribute.
|
|
|
|
*/
|
|
|
|
attribute boolean originalFrameSrc;
|
|
|
|
|
2000-06-22 07:22:23 +00:00
|
|
|
/* these are load type enums... */
|
2002-12-12 23:10:59 +00:00
|
|
|
const long loadNormal = 0; // Normal Load
|
|
|
|
const long loadNormalReplace = 1; // Normal Load but replaces current history slot
|
|
|
|
const long loadHistory = 2; // Load from history
|
|
|
|
const long loadReloadNormal = 3; // Reload
|
|
|
|
const long loadReloadBypassCache = 4;
|
|
|
|
const long loadReloadBypassProxy = 5;
|
|
|
|
const long loadReloadBypassProxyAndCache = 6;
|
|
|
|
const long loadLink = 7;
|
|
|
|
const long loadRefresh = 8;
|
|
|
|
const long loadReloadCharsetChange = 9;
|
|
|
|
const long loadBypassHistory = 10;
|
2005-01-20 16:57:04 +00:00
|
|
|
const long loadStopContent = 11;
|
|
|
|
const long loadStopContentAndReplace = 12;
|
2005-07-07 09:45:47 +00:00
|
|
|
const long loadNormalExternal = 13;
|
2006-07-08 21:25:08 +00:00
|
|
|
const long loadNormalBypassCache = 14;
|
|
|
|
const long loadNormalBypassProxy = 15;
|
|
|
|
const long loadNormalBypassProxyAndCache = 16;
|
2010-05-02 08:31:07 +00:00
|
|
|
const long loadPushState = 17; // history.pushState or replaceState
|
2012-06-21 17:31:07 +00:00
|
|
|
const long loadReplaceBypassCache = 18;
|
2013-09-05 17:59:13 +00:00
|
|
|
const long loadReloadMixedContent = 19;
|
2013-08-22 22:13:16 +00:00
|
|
|
const long loadNormalAllowMixedContent = 20;
|
2017-07-21 10:15:00 +00:00
|
|
|
const long loadReloadCharsetChangeBypassCache = 21;
|
|
|
|
const long loadReloadCharsetChangeBypassProxyAndCache = 22;
|
2000-06-22 07:22:23 +00:00
|
|
|
|
2002-12-12 23:10:59 +00:00
|
|
|
/** Contains a load type as specified by the load* constants */
|
|
|
|
attribute nsDocShellInfoLoadType loadType;
|
2000-06-22 07:22:23 +00:00
|
|
|
|
2002-12-12 23:10:59 +00:00
|
|
|
/** SHEntry for this page */
|
|
|
|
attribute nsISHEntry SHEntry;
|
2000-09-22 05:04:58 +00:00
|
|
|
|
2002-12-12 23:10:59 +00:00
|
|
|
/** Target for load, like _content, _blank etc. */
|
|
|
|
attribute wstring target;
|
2001-05-14 02:16:27 +00:00
|
|
|
|
2002-12-12 23:10:59 +00:00
|
|
|
/** Post data */
|
2001-05-14 02:16:27 +00:00
|
|
|
attribute nsIInputStream postDataStream;
|
2002-12-12 23:10:59 +00:00
|
|
|
|
|
|
|
/** Additional headers */
|
|
|
|
attribute nsIInputStream headersStream;
|
2005-01-05 06:04:46 +00:00
|
|
|
|
|
|
|
/** True if the referrer should be sent, false if it shouldn't be
|
|
|
|
* sent, even if it's available. This attribute defaults to true.
|
|
|
|
*/
|
|
|
|
attribute boolean sendReferrer;
|
2013-06-29 03:13:22 +00:00
|
|
|
|
2014-11-18 13:46:29 +00:00
|
|
|
/** Referrer policy for the load. This attribute holds one of
|
|
|
|
* the values (REFERRER_POLICY_*) defined in nsIHttpChannel.
|
|
|
|
*/
|
|
|
|
attribute nsDocShellInfoReferrerPolicy referrerPolicy;
|
|
|
|
|
2013-06-29 03:13:22 +00:00
|
|
|
/** True if the docshell has been created to load an iframe where the
|
|
|
|
* srcdoc attribute has been set. Set when srcdocData is specified.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isSrcdocLoad;
|
|
|
|
|
|
|
|
/** When set, the load will be interpreted as a srcdoc load, where contents
|
|
|
|
* of this string will be loaded instead of the URI. Setting srcdocData
|
|
|
|
* sets isSrcdocLoad to true
|
|
|
|
*/
|
|
|
|
attribute AString srcdocData;
|
|
|
|
|
2014-01-13 07:58:16 +00:00
|
|
|
/** When set, this is the Source Browsing Context for the navigation. */
|
|
|
|
attribute nsIDocShell sourceDocShell;
|
2014-02-06 14:46:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for srcdoc loads to give view-source knowledge of the load's base
|
|
|
|
* URI as this information isn't embedded in the load's URI.
|
|
|
|
*/
|
|
|
|
attribute nsIURI baseURI;
|
2000-06-13 23:56:30 +00:00
|
|
|
};
|
2017-05-30 16:07:59 +00:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
|
|
|
#include "mozilla/Maybe.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function allowing convenient work with mozilla::Maybe in C++, hiding
|
|
|
|
* resultPrincipalURI and resultPrincipalURIIsSome attributes from the consumer.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
GetMaybeResultPrincipalURI(nsIDocShellLoadInfo* aLoadInfo, Maybe<nsCOMPtr<nsIURI>>& aRPURI);
|
|
|
|
void
|
|
|
|
SetMaybeResultPrincipalURI(nsIDocShellLoadInfo* aLoadInfo, Maybe<nsCOMPtr<nsIURI>> const& aRPURI);
|
|
|
|
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
%}
|