Loading dom/bindings/Bindings.conf +5 −0 Original line number Diff line number Diff line Loading @@ -1687,6 +1687,11 @@ DOMInterfaces = { 'nativeType': 'mozilla::extensions::ExtensionMockAPI', }, 'ExtensionDns': { 'headerFile': 'mozilla/extensions/ExtensionDns.h', 'nativeType': 'mozilla::extensions::ExtensionDns', }, 'ExtensionEventManager': { 'headerFile': 'mozilla/extensions/ExtensionEventManager.h', 'nativeType': 'mozilla::extensions::ExtensionEventManager', Loading dom/webidl/ExtensionBrowser.webidl +5 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ interface ExtensionBrowser { Func="mozilla::extensions::ExtensionAlarms::IsAllowed"] readonly attribute ExtensionAlarms alarms; // `browser.dns` API namespace [Replaceable, SameObject, BinaryName="GetExtensionDns", Func="mozilla::extensions::ExtensionDns::IsAllowed"] readonly attribute ExtensionDns dns; // `browser.runtime` API namespace [Replaceable, SameObject, BinaryName="GetExtensionRuntime", Func="mozilla::extensions::ExtensionRuntime::IsAllowed"] Loading dom/webidl/ExtensionDns.webidl 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT * * The content of this file has been generated based on the WebExtensions API * JSONSchema using the following command: * * export SCRIPT_DIR="toolkit/components/extensions/webidl-api" * mach python $SCRIPT_DIR/GenerateWebIDLBindings.py -- dns * * More info about generating webidl API bindings for WebExtensions API at: * * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html */ /* 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/. * * You are granted a license to use, reproduce and create derivative works of * this document. */ // WebIDL definition for the "dns" WebExtensions API [Exposed=(ServiceWorker), LegacyNoInterfaceObject] interface ExtensionDns { // API methods. [Throws, WebExtensionStub="AsyncAmbiguous"] any resolve(any... args); }; dom/webidl/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,7 @@ WEBIDL_FILES += [ WEBIDL_FILES += [ "ExtensionAlarms.webidl", "ExtensionBrowser.webidl", "ExtensionDns.webidl", "ExtensionEventManager.webidl", # ExtensionMockAPI is not a real WebExtensions API, and it is only enabled in tests. "ExtensionMockAPI.webidl", Loading toolkit/components/extensions/test/xpcshell/test_ext_dns.js +13 −4 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ add_task(async function startup() { await AddonTestUtils.promiseStartupManager(); }); add_task(async function test_dns_resolve() { async function test_dns_resolve() { let extension = getExtension(); await extension.startup(); await extension.awaitMessage("ready"); Loading Loading @@ -137,9 +137,9 @@ add_task(async function test_dns_resolve() { } await extension.unload(); }); } add_task(async function test_dns_resolve_socks() { async function test_dns_resolve_socks() { let extension = getExtension(); await extension.startup(); await extension.awaitMessage("ready"); Loading Loading @@ -173,4 +173,13 @@ add_task(async function test_dns_resolve_socks() { `expected error ${result.message}` ); await extension.unload(); }); } add_task(test_dns_resolve); add_task( { // TODO(Bug 1748313): remove the skip_if once we have introduced the proxy API namespace. skip_if: () => ExtensionTestUtils.isInBackgroundServiceWorkerTests(), }, test_dns_resolve_socks ); Loading
dom/bindings/Bindings.conf +5 −0 Original line number Diff line number Diff line Loading @@ -1687,6 +1687,11 @@ DOMInterfaces = { 'nativeType': 'mozilla::extensions::ExtensionMockAPI', }, 'ExtensionDns': { 'headerFile': 'mozilla/extensions/ExtensionDns.h', 'nativeType': 'mozilla::extensions::ExtensionDns', }, 'ExtensionEventManager': { 'headerFile': 'mozilla/extensions/ExtensionEventManager.h', 'nativeType': 'mozilla::extensions::ExtensionEventManager', Loading
dom/webidl/ExtensionBrowser.webidl +5 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ interface ExtensionBrowser { Func="mozilla::extensions::ExtensionAlarms::IsAllowed"] readonly attribute ExtensionAlarms alarms; // `browser.dns` API namespace [Replaceable, SameObject, BinaryName="GetExtensionDns", Func="mozilla::extensions::ExtensionDns::IsAllowed"] readonly attribute ExtensionDns dns; // `browser.runtime` API namespace [Replaceable, SameObject, BinaryName="GetExtensionRuntime", Func="mozilla::extensions::ExtensionRuntime::IsAllowed"] Loading
dom/webidl/ExtensionDns.webidl 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT * * The content of this file has been generated based on the WebExtensions API * JSONSchema using the following command: * * export SCRIPT_DIR="toolkit/components/extensions/webidl-api" * mach python $SCRIPT_DIR/GenerateWebIDLBindings.py -- dns * * More info about generating webidl API bindings for WebExtensions API at: * * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html */ /* 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/. * * You are granted a license to use, reproduce and create derivative works of * this document. */ // WebIDL definition for the "dns" WebExtensions API [Exposed=(ServiceWorker), LegacyNoInterfaceObject] interface ExtensionDns { // API methods. [Throws, WebExtensionStub="AsyncAmbiguous"] any resolve(any... args); };
dom/webidl/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,7 @@ WEBIDL_FILES += [ WEBIDL_FILES += [ "ExtensionAlarms.webidl", "ExtensionBrowser.webidl", "ExtensionDns.webidl", "ExtensionEventManager.webidl", # ExtensionMockAPI is not a real WebExtensions API, and it is only enabled in tests. "ExtensionMockAPI.webidl", Loading
toolkit/components/extensions/test/xpcshell/test_ext_dns.js +13 −4 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ add_task(async function startup() { await AddonTestUtils.promiseStartupManager(); }); add_task(async function test_dns_resolve() { async function test_dns_resolve() { let extension = getExtension(); await extension.startup(); await extension.awaitMessage("ready"); Loading Loading @@ -137,9 +137,9 @@ add_task(async function test_dns_resolve() { } await extension.unload(); }); } add_task(async function test_dns_resolve_socks() { async function test_dns_resolve_socks() { let extension = getExtension(); await extension.startup(); await extension.awaitMessage("ready"); Loading Loading @@ -173,4 +173,13 @@ add_task(async function test_dns_resolve_socks() { `expected error ${result.message}` ); await extension.unload(); }); } add_task(test_dns_resolve); add_task( { // TODO(Bug 1748313): remove the skip_if once we have introduced the proxy API namespace. skip_if: () => ExtensionTestUtils.isInBackgroundServiceWorkerTests(), }, test_dns_resolve_socks );