nsIRemotePermissionService.idl (1695B)
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 5 #include "nsISupports.idl" 6 7 interface nsIPrincipal; 8 9 /** 10 * Service to import default permissions from Remote Settings. Will be 11 * initialized by permission manager after it itself has completed its 12 * initialization, and will then import default permissions from Remote Settings 13 * asynchronously. This also means default permissions aren't guranteed to be 14 * available directly after startup. 15 */ 16 [scriptable, uuid(a4b1b3b1-b68a-4129-aa2f-eb086162a8c7)] 17 interface nsIRemotePermissionService : nsISupports { 18 /** 19 * Asynchonously import all default permissions from remote settings into 20 * the permission manager. Also, if not already done, set up remote settings 21 * event listener to keep remote permissions in sync. 22 */ 23 void init(); 24 /** 25 * Promise that is resolved when the remote permission service has been 26 * fully initialized, meaning all intial permissions have been imported and 27 * the remote settings sync event listener has been set up. If any errors 28 * are encountered during inizialization, this promise will be rejected. 29 */ 30 readonly attribute Promise isInitialized; 31 /** 32 * Allowed permission types and values to be set through remote settings. 33 * See RemotePermissionService.sys.mjs for further documentation. Exposed 34 * only for testing purposes. 35 */ 36 attribute jsval testAllowedPermissionValues; 37 }; 38 39 %{C++ 40 #define NS_REMOTEPERMISSIONSERVICE_CONTRACTID "@mozilla.org/remote-permission-service;1" 41 %}