Wednesday, February 04, 2015

Update: Show constructor definition - Chrome Devtools Enhancement

Call to action: If you like this functionality then please * the issue 453801.

Based on the feedback on the review on issue 453801 I have made some changes to the implementation.

The functionality is now split into the following actions:

For function objects
  •  Show function documentation
For object objects
  •  Show constructor definition
  •  Show constructor documentation
The Show constructor definition works similar to the existing Show function definition, except that it shows the definition of the 'constructor' property.

To turn on the following actions:
  • Show function documentation
  • Show constructor documentation
You have to enable it on the experiments tab by selecting the Show function documentation checkbox and entering the url for APIs like this:


That way the API URLs do not have to be hard coded into the code and you can add additional URLs. The {api} token will be replaced by the API name.

The URLs are (for easy copy/paste):

https://developer.mozilla.org/en-US/docs/Web/API/{api}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{api}
https://developer.mozilla.org/de/docs/DOM/window.{api}

or alternatively

https://docs.webplatform.org/wiki/javascript/{api}
https://docs.webplatform.org/wiki/dom/{api}
https://docs.webplatform.org/wiki/dom/Window/{api}
https://docs.webplatform.org/wiki/svg/objects/{api}
https://docs.webplatform.org/wiki/apis/webaudio/{api}

To try this you can use DevTools App and enter the url:

http://chrome-developer-tools.googlecode.com/git-history/issue453801/devtools-frontend/Source/devtools/front_end/inspector.html

Make sure that Enable experiments is checked.

Feedback welcome!



No comments: