mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
Fix devtools not working
This commit is contained in:
@@ -109,7 +109,6 @@ DevToolsDelegate::~DevToolsDelegate() {
|
||||
}
|
||||
|
||||
std::string DevToolsDelegate::GetDiscoveryPageHTML() {
|
||||
LOG(WARNING) << IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE;
|
||||
return ResourceBundle::GetSharedInstance().GetRawDataResource(
|
||||
IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
|
||||
}
|
||||
|
||||
@@ -251,10 +251,6 @@ void InspectableWebContentsImpl::ShowDevTools() {
|
||||
devtools_web_contents_->SetDelegate(this);
|
||||
|
||||
agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get());
|
||||
frontend_host_.reset(content::DevToolsFrontendHost::Create(
|
||||
web_contents_->GetMainFrame(),
|
||||
base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend,
|
||||
base::Unretained(this))));
|
||||
agent_host_->AttachClient(this);
|
||||
|
||||
GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL,
|
||||
@@ -634,6 +630,16 @@ void InspectableWebContentsImpl::OnWebContentsFocused() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::DidStartNavigationToPendingEntry(
|
||||
const GURL& url,
|
||||
content::NavigationController::ReloadType reload_type) {
|
||||
frontend_host_.reset(
|
||||
content::DevToolsFrontendHost::Create(
|
||||
web_contents()->GetMainFrame(),
|
||||
base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend,
|
||||
base::Unretained(this))));
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::OnURLFetchComplete(const net::URLFetcher* source) {
|
||||
DCHECK(source);
|
||||
PendingRequestsMap::iterator it = pending_requests_.find(source);
|
||||
|
||||
@@ -130,6 +130,9 @@ class InspectableWebContentsImpl :
|
||||
content::RenderFrameHost* new_host) override;
|
||||
void WebContentsDestroyed() override;
|
||||
void OnWebContentsFocused() override;
|
||||
void DidStartNavigationToPendingEntry(
|
||||
const GURL& url,
|
||||
content::NavigationController::ReloadType reload_type) override;
|
||||
|
||||
// content::WebContentsDelegate:
|
||||
bool AddMessageToConsole(content::WebContents* source,
|
||||
|
||||
Reference in New Issue
Block a user