2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2018-08-29 05:00:00 +03: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/. */
|
|
|
|
|
2018-10-18 09:52:30 +03:00
|
|
|
interface nsIDocShell;
|
2020-05-27 03:28:59 +03:00
|
|
|
interface nsISecureBrowserUI;
|
2020-06-17 05:59:29 +03:00
|
|
|
interface nsIWebProgress;
|
2018-10-18 09:52:30 +03:00
|
|
|
|
2020-04-26 03:53:01 +03:00
|
|
|
interface mixin LoadContextMixin {
|
|
|
|
readonly attribute WindowProxy? associatedWindow;
|
|
|
|
|
|
|
|
readonly attribute WindowProxy? topWindow;
|
|
|
|
|
|
|
|
readonly attribute Element? topFrameElement;
|
|
|
|
|
|
|
|
readonly attribute boolean isContent;
|
2020-05-04 17:26:34 +03:00
|
|
|
|
|
|
|
[SetterThrows]
|
2020-04-26 03:53:01 +03:00
|
|
|
attribute boolean usePrivateBrowsing;
|
|
|
|
|
|
|
|
readonly attribute boolean useRemoteTabs;
|
|
|
|
|
|
|
|
readonly attribute boolean useRemoteSubframes;
|
|
|
|
|
2020-07-31 16:37:13 +03:00
|
|
|
[BinaryName="useTrackingProtectionWebIDL", SetterThrows]
|
2020-04-26 03:53:01 +03:00
|
|
|
attribute boolean useTrackingProtection;
|
|
|
|
|
|
|
|
[NewObject, Throws]
|
|
|
|
readonly attribute any originAttributes;
|
|
|
|
};
|
|
|
|
|
2020-10-09 20:31:59 +03:00
|
|
|
/**
|
|
|
|
* Allowed CSS display modes. This needs to be kept in
|
|
|
|
* sync with similar values in ServoStyleConsts.h
|
|
|
|
*/
|
|
|
|
enum DisplayMode {
|
|
|
|
"browser",
|
|
|
|
"minimal-ui",
|
|
|
|
"standalone",
|
|
|
|
"fullscreen",
|
|
|
|
};
|
|
|
|
|
2018-10-21 03:02:53 +03:00
|
|
|
[Exposed=Window, ChromeOnly]
|
2018-08-29 05:00:00 +03:00
|
|
|
interface BrowsingContext {
|
2019-01-30 19:07:21 +03:00
|
|
|
static BrowsingContext? get(unsigned long long aId);
|
|
|
|
|
2019-06-19 23:06:32 +03:00
|
|
|
static BrowsingContext? getFromWindow(WindowProxy window);
|
|
|
|
|
2020-07-30 00:10:36 +03:00
|
|
|
sequence<BrowsingContext> getAllBrowsingContextsInSubtree();
|
|
|
|
|
2019-07-31 03:30:55 +03:00
|
|
|
BrowsingContext? findChildWithName(DOMString name, BrowsingContext accessor);
|
2019-10-24 17:53:07 +03:00
|
|
|
BrowsingContext? findWithName(DOMString name);
|
2019-02-15 12:59:21 +03:00
|
|
|
|
|
|
|
readonly attribute DOMString name;
|
|
|
|
|
2018-08-29 05:00:00 +03:00
|
|
|
readonly attribute BrowsingContext? parent;
|
|
|
|
|
2019-04-09 09:19:24 +03:00
|
|
|
readonly attribute BrowsingContext top;
|
|
|
|
|
2020-02-26 01:33:53 +03:00
|
|
|
[Cached, Frozen, Pure]
|
|
|
|
readonly attribute sequence<BrowsingContext> children;
|
2018-08-29 05:00:00 +03:00
|
|
|
|
2018-10-18 09:52:30 +03:00
|
|
|
readonly attribute nsIDocShell? docShell;
|
|
|
|
|
2019-04-17 03:51:36 +03:00
|
|
|
readonly attribute Element? embedderElement;
|
|
|
|
|
2018-08-29 05:00:00 +03:00
|
|
|
readonly attribute unsigned long long id;
|
2018-11-09 11:53:53 +03:00
|
|
|
|
|
|
|
readonly attribute BrowsingContext? opener;
|
2019-01-30 19:07:21 +03:00
|
|
|
|
|
|
|
readonly attribute BrowsingContextGroup group;
|
2019-10-05 00:50:34 +03:00
|
|
|
|
|
|
|
readonly attribute WindowProxy? window;
|
2019-10-11 05:27:14 +03:00
|
|
|
|
2020-04-01 15:54:28 +03:00
|
|
|
readonly attribute WindowContext? currentWindowContext;
|
|
|
|
|
2020-05-04 17:26:34 +03:00
|
|
|
readonly attribute WindowContext? parentWindowContext;
|
|
|
|
|
|
|
|
readonly attribute WindowContext? topWindowContext;
|
|
|
|
|
2020-09-22 01:40:42 +03:00
|
|
|
readonly attribute boolean ancestorsAreCurrent;
|
|
|
|
|
2020-07-31 16:37:13 +03:00
|
|
|
[SetterThrows] attribute [TreatNullAs=EmptyString] DOMString customPlatform;
|
2020-06-26 17:17:08 +03:00
|
|
|
|
2020-07-31 16:37:13 +03:00
|
|
|
[SetterThrows] attribute [TreatNullAs=EmptyString] DOMString customUserAgent;
|
2020-02-24 05:15:03 +03:00
|
|
|
|
2020-06-27 07:10:48 +03:00
|
|
|
readonly attribute DOMString embedderElementType;
|
|
|
|
|
2019-10-28 14:48:30 +03:00
|
|
|
/**
|
|
|
|
* The sandbox flags on the browsing context. These reflect the value of the
|
|
|
|
* sandbox attribute of the associated IFRAME or CSP-protectable content, if
|
|
|
|
* existent. See the HTML5 spec for more details.
|
|
|
|
* These flags on the browsing context reflect the current state of the
|
|
|
|
* sandbox attribute, which is modifiable. They are only used when loading new
|
|
|
|
* content, sandbox flags are also immutably set on the document when it is
|
|
|
|
* loaded.
|
|
|
|
* The sandbox flags of a document depend on the sandbox flags on its
|
|
|
|
* browsing context and of its parent document, if any.
|
|
|
|
* See nsSandboxFlags.h for the possible flags.
|
|
|
|
*/
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute unsigned long sandboxFlags;
|
2019-11-15 01:54:56 +03:00
|
|
|
|
|
|
|
// The inRDMPane flag indicates whether or not Responsive Design Mode is
|
|
|
|
// active for the browsing context.
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute boolean inRDMPane;
|
2019-12-04 03:44:27 +03:00
|
|
|
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute float fullZoom;
|
2020-04-22 22:32:52 +03:00
|
|
|
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute float textZoom;
|
2020-04-22 22:32:52 +03:00
|
|
|
|
2020-10-04 06:25:16 +03:00
|
|
|
// Default value for nsIContentViewer::authorStyleDisabled in any new
|
|
|
|
// browsing contexts created as a descendant of this one.
|
|
|
|
//
|
|
|
|
// Valid only for top browsing contexts.
|
|
|
|
[SetterThrows] attribute boolean authorStyleDisabledDefault;
|
|
|
|
|
2020-05-08 06:28:44 +03:00
|
|
|
/**
|
|
|
|
* Whether this docshell should save entries in global history.
|
|
|
|
*/
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute boolean useGlobalHistory;
|
2020-05-08 06:28:44 +03:00
|
|
|
|
2019-12-04 03:44:27 +03:00
|
|
|
// Extension to give chrome JS the ability to set the window screen
|
|
|
|
// orientation while in RDM.
|
2020-07-31 16:37:13 +03:00
|
|
|
[Throws] void setRDMPaneOrientation(OrientationType type, float rotationAngle);
|
2020-04-14 16:41:33 +03:00
|
|
|
|
|
|
|
// Extension to give chrome JS the ability to set a maxTouchPoints override
|
|
|
|
// while in RDM.
|
2020-07-31 16:37:13 +03:00
|
|
|
[Throws] void setRDMPaneMaxTouchPoints(octet maxTouchPoints);
|
2020-05-12 12:18:26 +03:00
|
|
|
|
2020-06-09 03:39:22 +03:00
|
|
|
// The watchedByDevTools flag indicates whether or not DevTools are currently
|
|
|
|
// debugging this browsing context.
|
|
|
|
[SetterThrows] attribute boolean watchedByDevTools;
|
2020-06-16 21:12:46 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A unique identifier for the browser element that is hosting this
|
|
|
|
* BrowsingContext tree. Every BrowsingContext in the element's tree will
|
|
|
|
* return the same ID in all processes and it will remain stable regardless of
|
|
|
|
* process changes. When a browser element's frameloader is switched to
|
|
|
|
* another browser element this ID will remain the same but hosted under the
|
|
|
|
* under the new browser element.
|
|
|
|
*/
|
2020-07-31 16:36:45 +03:00
|
|
|
[SetterThrows] attribute unsigned long long browserId;
|
2020-09-16 17:51:01 +03:00
|
|
|
|
2020-10-09 20:31:59 +03:00
|
|
|
[SetterThrows] attribute DisplayMode displayMode;
|
|
|
|
|
2020-10-23 13:07:09 +03:00
|
|
|
/**
|
|
|
|
* The nsID of the browsing context in the session history.
|
|
|
|
*/
|
|
|
|
[NewObject, Throws]
|
|
|
|
readonly attribute any historyID;
|
|
|
|
|
2020-09-16 17:51:01 +03:00
|
|
|
readonly attribute ChildSHistory? childSessionHistory;
|
2020-09-21 14:54:50 +03:00
|
|
|
|
|
|
|
// Resets the location change rate limit. Used for testing.
|
|
|
|
void resetLocationChangeRateLimit();
|
2018-08-29 05:00:00 +03:00
|
|
|
};
|
2018-10-20 02:02:56 +03:00
|
|
|
|
2020-04-26 03:53:01 +03:00
|
|
|
BrowsingContext includes LoadContextMixin;
|
|
|
|
|
2018-10-20 02:02:56 +03:00
|
|
|
[Exposed=Window, ChromeOnly]
|
2019-01-29 20:32:28 +03:00
|
|
|
interface CanonicalBrowsingContext : BrowsingContext {
|
2018-10-20 02:02:56 +03:00
|
|
|
sequence<WindowGlobalParent> getWindowGlobals();
|
2018-11-27 23:03:05 +03:00
|
|
|
|
|
|
|
readonly attribute WindowGlobalParent? currentWindowGlobal;
|
2019-03-20 06:15:36 +03:00
|
|
|
|
2020-06-17 20:17:09 +03:00
|
|
|
readonly attribute WindowProxy? topChromeWindow;
|
|
|
|
|
2019-04-08 19:29:08 +03:00
|
|
|
// XXX(nika): This feels kinda hacky, but will do for now while we don't
|
|
|
|
// synchronously create WindowGlobalParent. It can throw if somehow the
|
|
|
|
// content process has died.
|
|
|
|
[Throws]
|
2020-07-08 23:15:59 +03:00
|
|
|
readonly attribute UTF8String? currentRemoteType;
|
2019-04-08 19:29:08 +03:00
|
|
|
|
2019-04-17 03:51:36 +03:00
|
|
|
readonly attribute WindowGlobalParent? embedderWindowGlobal;
|
|
|
|
|
2019-03-20 06:15:36 +03:00
|
|
|
void notifyStartDelayedAutoplayMedia();
|
2020-07-31 16:37:13 +03:00
|
|
|
[Throws] void notifyMediaMutedChanged(boolean muted);
|
2019-10-15 19:19:16 +03:00
|
|
|
|
2020-05-27 03:28:59 +03:00
|
|
|
readonly attribute nsISecureBrowserUI? secureBrowserUI;
|
|
|
|
|
2020-06-17 05:59:29 +03:00
|
|
|
/**
|
|
|
|
* Returns an nsIWebProgress object for this BrowsingContext, if this
|
|
|
|
* is a top-level content BC.
|
|
|
|
*
|
|
|
|
* Progress listeners attached to this will get notifications filtered by
|
|
|
|
* nsBrowserStatusFilter, and don't get any notifications from sub frames.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIWebProgress? webProgress;
|
|
|
|
|
2019-12-06 02:13:24 +03:00
|
|
|
static unsigned long countSiteOrigins(sequence<BrowsingContext> roots);
|
|
|
|
|
2019-11-04 18:05:47 +03:00
|
|
|
/**
|
|
|
|
* Loads a given URI. This will give priority to loading the requested URI
|
|
|
|
* in the object implementing this interface. If it can't be loaded here
|
|
|
|
* however, the URI dispatcher will go through its normal process of content
|
|
|
|
* loading.
|
|
|
|
*
|
|
|
|
* @param aURI
|
|
|
|
* The URI string to load. For HTTP and FTP URLs and possibly others,
|
|
|
|
* characters above U+007F will be converted to UTF-8 and then URL-
|
|
|
|
* escaped per the rules of RFC 2396.
|
|
|
|
* @param aLoadURIOptions
|
|
|
|
* A JSObject defined in LoadURIOptions.webidl holding info like e.g.
|
|
|
|
* the triggeringPrincipal, the referrer info.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void loadURI(DOMString aURI, optional LoadURIOptions aOptions = {});
|
|
|
|
|
2020-06-30 04:18:47 +03:00
|
|
|
/**
|
|
|
|
* These methods implement the nsIWebNavigation methods of the same names
|
|
|
|
*/
|
|
|
|
void goBack(optional long aCancelContentJSEpoch, optional boolean aRequireUserInteraction = false);
|
|
|
|
void goForward(optional long aCancelContentJSEpoch, optional boolean aRequireUserInteraction = false);
|
|
|
|
void goToIndex(long aIndex, optional long aCancelContentJSEpoch);
|
|
|
|
void reload(unsigned long aReloadFlags);
|
|
|
|
void stop(unsigned long aStopFlags);
|
|
|
|
|
2019-06-19 22:09:28 +03:00
|
|
|
readonly attribute nsISHistory? sessionHistory;
|
2020-06-08 21:51:12 +03:00
|
|
|
|
|
|
|
readonly attribute MediaController? mediaController;
|
2018-10-20 02:02:56 +03:00
|
|
|
};
|
2019-01-30 19:07:21 +03:00
|
|
|
|
|
|
|
[Exposed=Window, ChromeOnly]
|
|
|
|
interface BrowsingContextGroup {
|
|
|
|
sequence<BrowsingContext> getToplevels();
|
2020-07-06 22:45:41 +03:00
|
|
|
|
|
|
|
readonly attribute unsigned long long id;
|
2019-01-30 19:07:21 +03:00
|
|
|
};
|