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

Unified Diff: third_party/WebKit/Source/devtools/front_end/inspector.js

Issue 2124203002: DevTools: copy protocol files to front-end to fix hosted mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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
Index: third_party/WebKit/Source/devtools/front_end/inspector.js
diff --git a/third_party/WebKit/Source/devtools/front_end/inspector.js b/third_party/WebKit/Source/devtools/front_end/inspector.js
index 322527dd3615afe7a2f35fb61acc224fbeddf00f..0b71b5b5b64ee16ac0bfe3c9ae899eaca46b03be 100644
--- a/third_party/WebKit/Source/devtools/front_end/inspector.js
+++ b/third_party/WebKit/Source/devtools/front_end/inspector.js
@@ -2,4 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication("inspector");
+// Preload protocol resources for hosted mode.
+if (!/** @type {?Object} */(window.InspectorFrontendHost)) {
+ Promise.all([
+ Runtime.loadResourceIntoCache("./sdk/protocol/browser_protocol.json", false /* appendSourceURL */),
+ Runtime.loadResourceIntoCache("./sdk/protocol/js_protocol.json", false /* appendSourceURL */)
+ ]).then(() => Runtime.startApplication("inspector"));
+} else {
+ Runtime.startApplication("inspector");
+}
+

Powered by Google App Engine
This is Rietveld 408576698