nsIBrowser.idl (6392B)
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/. */ 4 #include "nsISupports.idl" 5 6 interface nsIContentSecurityPolicy; 7 interface nsIPolicyContainer; 8 interface nsIPrincipal; 9 interface nsITransportSecurityInfo; 10 interface nsIURI; 11 interface nsIWebProgress; 12 interface nsIReferrerInfo; 13 interface nsIOpenWindowInfo; 14 15 [scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)] 16 interface nsIBrowser : nsISupports 17 { 18 /* 19 * Called by the child to inform the parent that links are dropped into 20 * content area. 21 * 22 * @param links a flat array of url, name, and type for each link 23 * @param triggeringPrincipal a principal that initiated loading 24 * of the dropped links 25 */ 26 void dropLinks(in Array<AString> links, 27 in nsIPrincipal triggeringPrincipal); 28 29 /** 30 * Swapping of frameloaders are usually initiated from a frameloader owner 31 * or other components operating on frameloader owners. This is done by calling 32 * swapFrameLoaders at MozFrameLoaderOwner webidl interface. 33 * 34 * This function aimed to provide the other way around - 35 * if the swapping is initiated from frameloader itself or other platform level 36 * components, it uses this interface to delegate the swapping request to 37 * frameloader owners and ask them to re-initiate frameloader swapping, so that 38 * frameloader owners such as <xul:browser> can setup their properties and / 39 * or listeners properly on swapping. 40 */ 41 void swapBrowsers(in nsIBrowser aOtherBrowser); 42 43 /** 44 * Close the browser (usually means to remove a tab). 45 */ 46 void closeBrowser(); 47 48 /** 49 * A browser can change from remote to non-remote and vice versa. 50 * For example, when navigating from an in-process chrome page to 51 * a web page, this value would change from false to true. 52 */ 53 readonly attribute boolean isRemoteBrowser; 54 55 /** 56 * The browser's permanent key. This was added temporarily for Session Store, 57 * and will be removed in bug 1716788. 58 */ 59 readonly attribute jsval permanentKey; 60 61 readonly attribute nsIPrincipal contentPrincipal; 62 readonly attribute nsIPrincipal contentPartitionedPrincipal; 63 readonly attribute nsIPolicyContainer policyContainer; 64 readonly attribute nsIReferrerInfo referrerInfo; 65 66 /** 67 * Whether or not the browser is in the process of an nsIWebNavigation 68 * navigation method. 69 */ 70 attribute boolean isNavigating; 71 72 /** 73 * Whether or not the character encoding menu may be enabled. 74 */ 75 attribute boolean mayEnableCharacterEncodingMenu; 76 77 /** 78 * Called by Gecko to update the browser when its state changes. 79 * 80 * @param aCharset the new character set of the document 81 * @param aDocumentURI the URI of the current document 82 * @param aContentType the content type of the document 83 */ 84 void updateForStateChange(in AString aCharset, 85 in nsIURI aDocumentURI, 86 in AString aContentType); 87 88 /** 89 * Called by Gecko to update the nsIWebNavigation when a location change occurs. 90 * 91 * @param aCanGoBack whether or not the nsIWebNavigation can go backwards in 92 * history 93 * @param aCanGoBackIgnoringUserInteraction whether or not the nsIWebNavigation 94 * can go backwards in history regardless 95 * of user interactions 96 * @param aCanGoForward whether or not the nsIWebNavigation can go 97 * forward in history 98 */ 99 void updateWebNavigationForLocationChange(in boolean aCanGoBack, 100 in boolean aCanGoBackIgnoringUserInteraction, 101 in boolean aCanGoForward); 102 103 /** 104 * Called by Gecko to update the browser when a location change occurs. 105 * 106 * @param aLocation the new location 107 * @param aCharset the character set of the document 108 * @param aMayEnableCharacterEncodingMenu whether or not the content encoding 109 * menu may be enabled 110 * @param aDocumentURI the URI of the new document 111 * @param aTitle the title of the new doucment 112 * @param aContentPrincipal the security principal of the new document 113 * @param aContentPartitionedPrincipal the security principal for the new 114 * document's storage 115 * @param aCSP the content security policy of the new document 116 * @param aReferrerInfo the referrer info of the new document 117 * @param aIsSynthetic whether or not the document is synthetic 118 * @param aHasRequestContextID whether or not the the request context has a 119 * value (true) or null should be used (false) 120 * @param aRequestContextID the request context ID 121 * @param aContentType the content type of the document 122 */ 123 void updateForLocationChange(in nsIURI aLocation, 124 in AString aCharset, 125 in boolean aMayEnableCharacterEncodingMenu, 126 in nsIURI aDocumentURI, 127 in AString aTitle, 128 in nsIPrincipal aContentPrincipal, 129 in nsIPrincipal aContentPartitionedPrincipal, 130 in nsIPolicyContainer aPolicyContainer, 131 in nsIReferrerInfo aReferrerInfo, 132 in boolean aIsSynthetic, 133 in boolean aHasRequestContextID, 134 in uint64_t aRequestContextID, 135 in AString aContentType); 136 137 /** 138 * Called to perform any async tasks which must be completed before changing 139 * remoteness. Gecko will wait for the returned promise to resolve before 140 * performing the process switch. 141 */ 142 Promise prepareToChangeRemoteness(); 143 144 /** Called immediately before changing remoteness */ 145 void beforeChangeRemoteness(); 146 147 /** 148 * Called immediately after changing remoteness. 149 * 150 * If this method returns `true`, Gecko will assume frontend handled resuming 151 * the load, and will not attempt to resume the load itself. 152 */ 153 boolean finishChangeRemoteness(in uint64_t aPendingSwitchId); 154 };