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

Unified Diff: Source/devtools/front_end/platform/DOMExtension.js

Issue 710033003: [DevTools] Extract part of DevTools into inspector app. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 1 month 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/main/Main.js ('k') | Source/devtools/front_end/toolbox_bootstrap/Toolbox.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/platform/DOMExtension.js
diff --git a/Source/devtools/front_end/platform/DOMExtension.js b/Source/devtools/front_end/platform/DOMExtension.js
index d16df0767c6d9fc5e6d1bbfbc617663cf16e06e4..d05900beebcba75503b0278729a234e2445fc911 100644
--- a/Source/devtools/front_end/platform/DOMExtension.js
+++ b/Source/devtools/front_end/platform/DOMExtension.js
@@ -777,3 +777,24 @@ function consumeEvent(e)
{
e.consume();
}
+
+/**
+ * @param {!function()} callback
+ * @suppressGlobalPropertiesCheck
+ */
+function runOnWindowLoad(callback)
+{
+ /**
+ * @suppressGlobalPropertiesCheck
+ */
+ function windowLoaded()
+ {
+ window.removeEventListener("DOMContentLoaded", windowLoaded, false);
+ callback();
+ }
+
+ if (document.readyState === "complete")
+ callback();
+ else
+ window.addEventListener("DOMContentLoaded", windowLoaded, false);
+}
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/toolbox_bootstrap/Toolbox.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698