Fix polluting devtools in some cases.

This commit is contained in:
Cheng Zhao 2014-02-24 13:14:01 +08:00
parent a2ecb554cc
commit 7d93b4a48f

View file

@ -155,12 +155,13 @@ bool AtomRendererClient::ShouldFork(WebKit::WebFrame* frame,
bool AtomRendererClient::IsNodeBindingEnabled(WebKit::WebFrame* frame) { bool AtomRendererClient::IsNodeBindingEnabled(WebKit::WebFrame* frame) {
if (node_integration_ == DISABLE) if (node_integration_ == DISABLE)
return false; return false;
// Do not pollute devtools.
else if (frame != NULL &&
GURL(frame->document().url()).SchemeIs(kChromeDevToolsScheme))
return false;
// Node integration is enabled in main frame unless explictly disabled. // Node integration is enabled in main frame unless explictly disabled.
else if (frame == main_frame_) else if (frame == main_frame_)
return true; return true;
// Do not pollute devtools.
else if (GURL(frame->document().url()).SchemeIs(kChromeDevToolsScheme))
return false;
else if (node_integration_ == MANUAL_ENABLE_IFRAME && else if (node_integration_ == MANUAL_ENABLE_IFRAME &&
frame != NULL && frame != NULL &&
frame->uniqueName().utf8().find(kEnableNodeIntegration) frame->uniqueName().utf8().find(kEnableNodeIntegration)