diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index c6e3e16f4e49..8fa619d79a97 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -985,7 +985,6 @@ void Navigator::CheckProtocolHandlerAllowed(const nsAString& aScheme, void Navigator::RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURI, - const nsAString& aTitle, ErrorResult& aRv) { if (!mWindow || !mWindow->GetOuterWindow() || !mWindow->GetDocShell() || !mWindow->GetDoc()) { @@ -1014,9 +1013,13 @@ void Navigator::RegisterProtocolHandler(const nsAString& aScheme, return; } + // Determine a title from the document URI. + nsAutoCString docDisplayHostPort; + docURI->GetDisplayHostPort(docDisplayHostPort); + NS_ConvertASCIItoUTF16 title(docDisplayHostPort); + if (XRE_IsContentProcess()) { nsAutoString scheme(aScheme); - nsAutoString title(aTitle); RefPtr browserChild = BrowserChild::GetFrom(mWindow); browserChild->SendRegisterProtocolHandler(scheme, handlerURI, title, docURI); @@ -1026,8 +1029,8 @@ void Navigator::RegisterProtocolHandler(const nsAString& aScheme, nsCOMPtr registrar = do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID); if (registrar) { - aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, aTitle, - docURI, mWindow->GetOuterWindow()); + aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, title, docURI, + mWindow->GetOuterWindow()); } } diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 9e898052f8ee..043fa07e152c 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -123,7 +123,7 @@ class Navigator final : public nsISupports, public nsWrapperCache { nsIURI* aHandlerURI, nsIURI* aDocumentURI, ErrorResult& aRv); void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL, - const nsAString& aTitle, ErrorResult& aRv); + ErrorResult& aRv); nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv); nsPluginArray* GetPlugins(ErrorResult& aRv); Permissions* GetPermissions(ErrorResult& aRv); diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl index 1bf3cf7e843e..5382bc56c8c6 100644 --- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -84,7 +84,7 @@ interface mixin NavigatorContentUtils { [Throws, ChromeOnly] void checkProtocolHandlerAllowed(DOMString scheme, URI handlerURI, URI documentURI); [Throws, SecureContext] - void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title); + void registerProtocolHandler(DOMString scheme, DOMString url); // NOT IMPLEMENTED //void unregisterProtocolHandler(DOMString scheme, DOMString url); }; diff --git a/testing/web-platform/meta/html/dom/idlharness.https.html.ini b/testing/web-platform/meta/html/dom/idlharness.https.html.ini index a44aac102fa3..936536f61e5a 100644 --- a/testing/web-platform/meta/html/dom/idlharness.https.html.ini +++ b/testing/web-platform/meta/html/dom/idlharness.https.html.ini @@ -711,9 +711,6 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu [OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)] expected: FAIL - [Navigator interface: operation registerProtocolHandler(DOMString, USVString)] - expected: FAIL - [ElementInternals interface: operation setValidity(optional ValidityStateFlags, optional DOMString, optional HTMLElement)] expected: FAIL diff --git a/testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/historical.https.window.js.ini b/testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/historical.https.window.js.ini deleted file mode 100644 index 28f62390271f..000000000000 --- a/testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/historical.https.window.js.ini +++ /dev/null @@ -1,4 +0,0 @@ -[historical.https.window.html] - [registerProtocolHandler has no third argument] - expected: FAIL -