grunt-html-inspector
grunt-html-inspector copied to clipboard
Allow for configuration of HTML Inspector by Grunt Parameters
- Currently you have to modify the bridge or create your own to have a custom configuration.
- HTML Inspector now (as of v.0.3.0) supports a
setConfig
function which can be invoked before a call toinspect
Could you elaborate how the bridge works? I can't seem to figure it out.
@Skinner927 The bridge.js
file is the default bridge. The way it works is after the page has loaded, the JavaScript file is injected into the currently loaded page, parsed, and executed. The default bridge is pretty simple. There are two functions _parseError
which handles formatting error messages from HTMLInspector and sendMessage
which really is just a wrapper around native alert
. Since PhantomJS is headless webkit, alert will not actually display any UI, right? So instead alert
is used for passing messages back to the the grunt task running PhantomJS. The other fragment of the file is just the call to start HTMLInspector.