2008-11-24 18:32:04 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin
|
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/. */
|
2008-11-24 18:32:04 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
interface mozIDOMWindowProxy;
|
2018-04-27 03:37:29 +00:00
|
|
|
|
|
|
|
webidl Element;
|
2008-11-24 18:32:04 +00:00
|
|
|
|
2017-03-18 20:08:12 +00:00
|
|
|
[ref] native OriginAttributes(mozilla::OriginAttributes);
|
|
|
|
|
2015-09-23 08:10:21 +00:00
|
|
|
%{C++
|
|
|
|
#ifdef MOZILLA_INTERNAL_API
|
2017-01-12 16:38:48 +00:00
|
|
|
#include "mozilla/BasePrincipal.h" // for OriginAttributes
|
2015-09-23 08:10:21 +00:00
|
|
|
#endif
|
|
|
|
%}
|
|
|
|
|
2008-11-24 18:32:04 +00:00
|
|
|
/**
|
|
|
|
* An nsILoadContext represents the context of a load. This interface
|
|
|
|
* can be queried for various information about where the load is
|
|
|
|
* happening.
|
|
|
|
*/
|
2017-03-18 20:08:12 +00:00
|
|
|
[builtinclass, scriptable, uuid(2813a7a3-d084-4d00-acd0-f76620315c02)]
|
2008-11-24 18:32:04 +00:00
|
|
|
interface nsILoadContext : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* associatedWindow is the window with which the load is associated, if any.
|
|
|
|
* Note that the load may be triggered by a document which is different from
|
|
|
|
* the document in associatedWindow, and in fact the source of the load need
|
|
|
|
* not be same-origin with the document in associatedWindow. This attribute
|
|
|
|
* may be null if there is no associated window.
|
|
|
|
*/
|
2016-01-30 17:05:36 +00:00
|
|
|
readonly attribute mozIDOMWindowProxy associatedWindow;
|
2008-11-24 18:32:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* topWindow is the top window which is of same type as associatedWindow.
|
|
|
|
* This is equivalent to associatedWindow.top, but is provided here as a
|
|
|
|
* convenience. All the same caveats as associatedWindow of apply, of
|
|
|
|
* course. This attribute may be null if there is no associated window.
|
|
|
|
*/
|
2016-01-30 17:05:36 +00:00
|
|
|
readonly attribute mozIDOMWindowProxy topWindow;
|
2008-11-24 18:32:04 +00:00
|
|
|
|
2012-08-22 06:47:23 +00:00
|
|
|
/**
|
2015-01-22 00:19:07 +00:00
|
|
|
* topFrameElement is the <iframe>, <frame>, or <browser> element which
|
|
|
|
* contains the topWindow with which the load is associated.
|
2012-08-22 06:47:23 +00:00
|
|
|
*
|
|
|
|
* Note that we may have a topFrameElement even when we don't have an
|
|
|
|
* associatedWindow, if the topFrameElement's content lives out of process.
|
2015-01-22 00:19:07 +00:00
|
|
|
* topFrameElement is available in single-process and multiprocess contexts.
|
|
|
|
* Note that topFrameElement may be in chrome even when the nsILoadContext is
|
|
|
|
* associated with content.
|
2012-08-22 06:47:23 +00:00
|
|
|
*/
|
2018-04-27 03:37:29 +00:00
|
|
|
readonly attribute Element topFrameElement;
|
2012-08-22 06:47:23 +00:00
|
|
|
|
2014-06-11 05:44:36 +00:00
|
|
|
/**
|
|
|
|
* If this LoadContext corresponds to a nested remote iframe, we don't have
|
|
|
|
* access to the topFrameElement. Instead, we must use this id to send
|
|
|
|
* messages. A return value of 0 signifies that this load context is not for
|
|
|
|
* a nested frame.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long nestedFrameId;
|
|
|
|
|
2008-11-24 18:32:04 +00:00
|
|
|
/**
|
|
|
|
* True if the load context is content (as opposed to chrome). This is
|
|
|
|
* determined based on the type of window the load is performed in, NOT based
|
|
|
|
* on any URIs that might be around.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isContent;
|
2012-02-02 19:03:46 +00:00
|
|
|
|
|
|
|
/*
|
2016-12-18 23:07:08 +00:00
|
|
|
* Attribute that determines if private browsing should be used. May not be
|
|
|
|
* changed after a document has been loaded in this context.
|
2012-02-02 19:03:46 +00:00
|
|
|
*/
|
|
|
|
attribute boolean usePrivateBrowsing;
|
2012-02-21 17:08:22 +00:00
|
|
|
|
2014-02-11 17:00:54 +00:00
|
|
|
/**
|
|
|
|
* Attribute that determines if remote (out-of-process) tabs should be used.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean useRemoteTabs;
|
|
|
|
|
2019-04-17 00:53:22 +00:00
|
|
|
/**
|
|
|
|
* Determines if out-of-process iframes should be used.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean useRemoteSubframes;
|
|
|
|
|
2017-02-14 14:53:21 +00:00
|
|
|
/*
|
|
|
|
* Attribute that determines if tracking protection should be used. May not be
|
|
|
|
* changed after a document has been loaded in this context.
|
|
|
|
*/
|
|
|
|
attribute boolean useTrackingProtection;
|
|
|
|
|
2012-02-21 17:08:22 +00:00
|
|
|
%{C++
|
|
|
|
/**
|
|
|
|
* De-XPCOMed getter to make call-sites cleaner.
|
|
|
|
*/
|
2017-02-15 22:06:25 +00:00
|
|
|
bool UsePrivateBrowsing()
|
|
|
|
{
|
|
|
|
bool usingPB = false;
|
2012-02-21 17:08:22 +00:00
|
|
|
GetUsePrivateBrowsing(&usingPB);
|
|
|
|
return usingPB;
|
|
|
|
}
|
2014-02-11 17:00:54 +00:00
|
|
|
|
2017-02-15 22:06:25 +00:00
|
|
|
bool UseRemoteTabs()
|
|
|
|
{
|
|
|
|
bool usingRT = false;
|
2014-02-11 17:00:54 +00:00
|
|
|
GetUseRemoteTabs(&usingRT);
|
|
|
|
return usingRT;
|
|
|
|
}
|
2017-02-14 14:53:21 +00:00
|
|
|
|
2019-04-17 00:53:22 +00:00
|
|
|
bool UseRemoteSubframes()
|
|
|
|
{
|
|
|
|
bool usingRSF = false;
|
|
|
|
GetUseRemoteSubframes(&usingRSF);
|
|
|
|
return usingRSF;
|
|
|
|
}
|
|
|
|
|
2017-02-15 22:06:25 +00:00
|
|
|
bool UseTrackingProtection()
|
|
|
|
{
|
|
|
|
bool usingTP = false;
|
2017-02-14 14:53:21 +00:00
|
|
|
GetUseTrackingProtection(&usingTP);
|
|
|
|
return usingTP;
|
|
|
|
}
|
2012-02-21 17:08:22 +00:00
|
|
|
%}
|
2012-07-20 18:38:43 +00:00
|
|
|
|
2012-10-31 04:15:24 +00:00
|
|
|
/**
|
|
|
|
* Set the private browsing state of the load context, meant to be used internally.
|
|
|
|
*/
|
|
|
|
[noscript] void SetPrivateBrowsing(in boolean aInPrivateBrowsing);
|
|
|
|
|
2014-02-11 17:00:54 +00:00
|
|
|
/**
|
|
|
|
* Set the remote tabs state of the load context, meant to be used internally.
|
|
|
|
*/
|
|
|
|
[noscript] void SetRemoteTabs(in boolean aUseRemoteTabs);
|
|
|
|
|
2019-04-17 00:53:22 +00:00
|
|
|
/**
|
|
|
|
* Set the remote subframes bit of this load context. Exclusively meant to be used internally.
|
|
|
|
*/
|
|
|
|
[noscript] void SetRemoteSubframes(in boolean aUseRemoteSubframes);
|
|
|
|
|
2015-09-23 08:10:21 +00:00
|
|
|
/**
|
|
|
|
* A dictionary of the non-default origin attributes associated with this
|
|
|
|
* nsILoadContext.
|
|
|
|
*/
|
2018-10-09 18:28:17 +00:00
|
|
|
[binaryname(ScriptableOriginAttributes), implicit_jscontext]
|
2015-09-23 08:10:21 +00:00
|
|
|
readonly attribute jsval originAttributes;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The C++ getter for origin attributes.
|
|
|
|
*/
|
2017-03-18 20:08:12 +00:00
|
|
|
[noscript, notxpcom] void GetOriginAttributes(out OriginAttributes aAttrs);
|
2008-11-24 18:32:04 +00:00
|
|
|
};
|