mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Fix URL rewrite on new tab navigation (see issue #2969)
This fixes an `Unhandled chrome.send("getApps");` error when creating a new tab. Creating a new tab initially loads chrome://newtab which should then be rewritten to chrome://new-tab-page for normal profiles in HandleNewTabURLRewrite. Failure to rewrite the URL results in the loading of NewTabUI instead of the expected NewTabPageUI. NewTabUI loads different resources for normal vs incognito/guest profiles (new_tab.js vs incognito_tab.js), and new_tab.js calls chrome.send("getApps") via page_list_view.js. This then fails in WebUIImpl::ProcessWebUIMessage because the message is unhandled.
This commit is contained in:
@ -632,11 +632,16 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
|
||||
}
|
||||
|
||||
static void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) {
|
||||
// Handler to rewrite chrome://about and chrome://sync URLs.
|
||||
handler->AddHandlerPair(&HandleChromeAboutAndChromeSyncRewrite,
|
||||
content::BrowserURLHandler::null_handler());
|
||||
// For Chrome runtime this is registered in
|
||||
// ChromeContentBrowserClient::BrowserURLHandlerCreated().
|
||||
if (cef::IsAlloyRuntimeEnabled()) {
|
||||
// Handler to rewrite chrome://about and chrome://sync URLs.
|
||||
handler->AddHandlerPair(&HandleChromeAboutAndChromeSyncRewrite,
|
||||
content::BrowserURLHandler::null_handler());
|
||||
}
|
||||
|
||||
// chrome: & friends.
|
||||
// chrome: & friends. For Chrome runtime the default registration is
|
||||
// disabled is ChromeContentBrowserClient::BrowserURLHandlerCreated().
|
||||
handler->AddHandlerPair(&HandleWebUI, &HandleWebUIReverse);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user