Lines Matching refs:scheme

104 static bool isSchemeWhitelisted(const String& scheme)
110 unsigned length = scheme.length();
112 builder.append(toASCIILower(scheme[i]));
117 static bool verifyCustomHandlerScheme(const String& scheme, ExceptionState& exceptionState)
119 if (!isValidProtocol(scheme)) {
120 exceptionState.throwSecurityError("The scheme '" + scheme + "' is not valid protocol");
124 if (scheme.startsWith("web+")) {
125 // The specification requires that the length of scheme is at least five characteres (including 'web+' prefix).
126 if (scheme.length() >= 5)
129 exceptionState.throwSecurityError("The scheme '" + scheme + "' is less than five characters long.");
133 if (isSchemeWhitelisted(scheme))
136 exceptionState.throwSecurityError("The scheme '" + scheme + "' doesn't belong to the scheme whitelist. Please prefix non-whitelisted schemes with the string 'web+'.");
154 void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptionState)
165 if (!verifyCustomHandlerScheme(scheme, exceptionState))
169 NavigatorContentUtils::from(*navigator.frame()->page())->client()->registerProtocolHandler(scheme, document->completeURL(url), title);
191 String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator, const String& scheme, const String& url, ExceptionState& exceptionState)
206 if (!verifyCustomHandlerScheme(scheme, exceptionState))
210 return customHandlersStateString(NavigatorContentUtils::from(*navigator.frame()->page())->client()->isProtocolHandlerRegistered(scheme, document->completeURL(url)));
213 void NavigatorContentUtils::unregisterProtocolHandler(Navigator& navigator, const String& scheme, const String& url, ExceptionState& exceptionState)
224 if (!verifyCustomHandlerScheme(scheme, exceptionState))
228 NavigatorContentUtils::from(*navigator.frame()->page())->client()->unregisterProtocolHandler(scheme, document->completeURL(url));