Index: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
index df33faf653a043e35e7e35c781a7440d448ab64e..cf2a34e80b49f23f8d1038e71ed9a21553879863 100644 |
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
@@ -29,6 +29,7 @@ |
#if ENABLE(NAVIGATOR_CONTENT_UTILS) |
+#include "bindings/v8/ExceptionMessages.h" |
#include "bindings/v8/ExceptionState.h" |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
@@ -109,13 +110,16 @@ static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionState& es |
// The specification requires that the length of scheme is at least five characteres (including 'web+' prefix). |
if (scheme.length() >= 5 && isValidProtocol(scheme)) |
return true; |
- es.throwDOMException(SecurityError); |
+ if (scheme.length() < 5) |
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme length (including 'web+') must be at least 5 characters.")); |
+ else |
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme '" + scheme + "' may not be registered.")); |
return false; |
} |
if (isProtocolWhitelisted(scheme)) |
return true; |
- es.throwDOMException(SecurityError); |
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme '" + scheme + "' may not be registered.")); |
return false; |
} |