From 13b3e214d9efed44a1e1c9a8ef0ca0ad7aea7aa0 Mon Sep 17 00:00:00 2001 From: Joss Crowcroft Date: Mon, 28 Mar 2011 19:49:23 +0800 Subject: [PATCH] 0.1.2, rewrote CSS path-building code; now much cooler --- README.markdown | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.markdown b/README.markdown index 15f5d6f..a6bd520 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,11 @@ Simple JavaScript DOM Inspector v0.1.2 ====================================== -Highlights hovered elements with a 2px red outline, and then logs the element's full -CSS selector path when clicked. It could also display the selected element's XPath, -or do pretty much anything with it in the callback function. +Highlights hovered elements with a 2px red outline, and then logs the element's full CSS selector path when clicked. It could also display the selected element's XPath, or do pretty much anything with it in the callback function. -The CSS selector path-building code tries to be as specific as possible, but can also -build a more optimised CSS selector, stopping at the first parent with a specific ID. +The CSS selector path-building code tries to be as specific as possible, but can also build a more optimised CSS selector, stopping at the first parent with a specific ID. -It also checks to see whether any part of the CSS path matches multiple elements, or if -any element has no ID or CSS class, and adds specific "nth-child" pseudo-selectors -where needed for full CSS paths. +Optionally, it also checks to see whether any part of the CSS path matches multiple elements, or if any element has no ID or CSS class, and adds specific "nth-child" pseudo-selectors where needed for full CSS paths. * Example optimised CSS path: `#content .left p img` * Example full CSS path: `html body #main #content .left p img` @@ -20,8 +15,7 @@ Hit escape key to cancel the inspector. NB: XPath code removed as it didn't really work very well, need to write from scratch. -Started putting in IE support, but won't work in IE just yet, check back next week -for that (so far, tested in FF4, Chrome, Safari, Opera 11.) +Started putting in IE support, but won't work in IE just yet, check back next week for that (so far, tested in FF4, Chrome, Safari, Opera 11.) No warranty; probably won't break the internet. Improvements and linkbacks welcome!