Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1445)

Unified Diff: Source/web/WebDevToolsFrontendImpl.cpp

Issue 971703002: DevTools: fix co-existance of multiple DevTools extensions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/extensions/ExtensionAPI.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebDevToolsFrontendImpl.cpp
diff --git a/Source/web/WebDevToolsFrontendImpl.cpp b/Source/web/WebDevToolsFrontendImpl.cpp
index 44dcaee0d6183ebd56c796fe5ab4040d99fa1a8a..7cc3dec68ad527d9f89e144f1907a4423778c4ed 100644
--- a/Source/web/WebDevToolsFrontendImpl.cpp
+++ b/Source/web/WebDevToolsFrontendImpl.cpp
@@ -93,8 +93,15 @@ void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame)
String origin = frame->securityOrigin().toString();
String script = m_injectedScriptForOrigin.get(origin);
- if (!script.isEmpty())
- frame->frame()->script().executeScriptInMainWorld(script + "()");
+ if (script.isEmpty())
+ return;
+ static int s_lastScriptId = 0;
+ StringBuilder scriptWithId;
+ scriptWithId.append(script);
+ scriptWithId.append('(');
+ scriptWithId.appendNumber(++s_lastScriptId);
+ scriptWithId.append(')');
+ frame->frame()->script().executeScriptInMainWorld(scriptWithId.toString());
}
void WebDevToolsFrontendImpl::sendMessageToBackend(const String& message)
« no previous file with comments | « Source/devtools/front_end/extensions/ExtensionAPI.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698