fix: chrome://accessibility not loading (#24437)
This commit is contained in:
parent
24fb498fd3
commit
3f37ff87d2
11 changed files with 668 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "content/public/browser/web_contents.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "shell/browser/ui/devtools_ui.h"
|
||||
#include "shell/browser/ui/webui/accessibility_ui.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -25,7 +26,8 @@ ElectronWebUIControllerFactory::~ElectronWebUIControllerFactory() = default;
|
|||
content::WebUI::TypeID ElectronWebUIControllerFactory::GetWebUIType(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) {
|
||||
if (url.host() == chrome::kChromeUIDevToolsHost) {
|
||||
if (url.host() == chrome::kChromeUIDevToolsHost ||
|
||||
url.host() == chrome::kChromeUIAccessibilityHost) {
|
||||
return const_cast<ElectronWebUIControllerFactory*>(this);
|
||||
}
|
||||
|
||||
|
@ -51,7 +53,10 @@ ElectronWebUIControllerFactory::CreateWebUIControllerForURL(
|
|||
if (url.host() == chrome::kChromeUIDevToolsHost) {
|
||||
auto* browser_context = web_ui->GetWebContents()->GetBrowserContext();
|
||||
return std::make_unique<DevToolsUI>(browser_context, web_ui);
|
||||
} else if (url.host() == chrome::kChromeUIAccessibilityHost) {
|
||||
return std::make_unique<ElectronAccessibilityUI>(web_ui);
|
||||
}
|
||||
|
||||
return std::unique_ptr<content::WebUIController>();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue