| Summary: | Web Inspector: run a customizable bootstrap function after the UI has fully loaded | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brian Burg <burg> | ||||
| Component: | Web Inspector | Assignee: | Brian Burg <burg> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Brian Burg
2015-04-23 15:03:29 PDT
Created attachment 251503 [details]
Patch
Comment on attachment 251503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251503&action=review > Source/WebInspectorUI/UserInterface/Main.html:539 > + <script src="Base/Bootstrap.js"></script> Should this file be skipped when combining for Release/Production? (In reply to comment #3) > Comment on attachment 251503 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=251503&action=review > > > Source/WebInspectorUI/UserInterface/Main.html:539 > > + <script src="Base/Bootstrap.js"></script> > > Should this file be skipped when combining for Release/Production? I suppose that's possible, though I don't think we do that anywhere else? It would require blacklisting in inline-and-minify-stylesheets-and-scripts.py, and maybe other parts to avoid copying the resource. I wasn't planning to have anything in the function body on trunk; developers can revert or exclude their little scripts from patches. Reusable snippets can live in comments in Bootstrap.js (to be stripped out) or on the wiki. Comment on attachment 251503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251503&action=review Seems fine to me. Do you have an example of a bootstrap you might use? > Source/WebInspectorUI/UserInterface/Base/Main.js:361 > + if (this.runBootstrapOperations && typeof this.runBootstrapOperations === "function") > + this.runBootstrapOperations(); No need to if-check? It is guaranteed right now. >>> Source/WebInspectorUI/UserInterface/Main.html:539 >>> + <script src="Base/Bootstrap.js"></script> >> >> Should this file be skipped when combining for Release/Production? > > I suppose that's possible, though I don't think we do that anywhere else? It would require blacklisting in inline-and-minify-stylesheets-and-scripts.py, and maybe other parts to avoid copying the resource. > > I wasn't planning to have anything in the function body on trunk; developers can revert or exclude their little scripts from patches. Reusable snippets can live in comments in Bootstrap.js (to be stripped out) or on the wiki. This should minify down to: WebInspector.runBootstrapOperations=function(){}; So it may be fine to leave in. Committed r183238: <http://trac.webkit.org/changeset/183238> (In reply to comment #5) > Comment on attachment 251503 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=251503&action=review > > Seems fine to me. Do you have an example of a bootstrap you might use? Something I did over and over when doing element tracking feature is to load a page, select the same element in the DOM, and invoke "Start Tracking". This could have been automated by doing querySelector to get the node, then passing it to DOMTracingManager.startTracking(). Further work on specific screens could have been automated by programmatically changing the content browser's represented object. I'll update the wiki page (https://trac.webkit.org/wiki/WebInspectorDebugging) as I make use of this feature to help share some useful snippets. Comment on attachment 251503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251503&action=review >>>> Source/WebInspectorUI/UserInterface/Main.html:539 >>>> + <script src="Base/Bootstrap.js"></script> >>> >>> Should this file be skipped when combining for Release/Production? >> >> I suppose that's possible, though I don't think we do that anywhere else? It would require blacklisting in inline-and-minify-stylesheets-and-scripts.py, and maybe other parts to avoid copying the resource. >> >> I wasn't planning to have anything in the function body on trunk; developers can revert or exclude their little scripts from patches. Reusable snippets can live in comments in Bootstrap.js (to be stripped out) or on the wiki. > > This should minify down to: > WebInspector.runBootstrapOperations=function(){}; > > So it may be fine to leave in. We skip combining (or combine separately) files in External/*. |