Skip to content Skip to sidebar Skip to footer

Accessing Chrome's Last Inspected Element Being $0 And $1 Via Js

Can Chrome's last inspected elements be access with javascript? Background, trying to integrate this into a Debug.js file to be called onclick. https://stackoverflow.com/a/1259654

Solution 1:

I'm afraid that only Chrome Extensions have access to these variables. There is a sample extension that makes use of $0, it's called 'Chrome Query' and is available on samples page. I took it's code, modified a little and ended up with this extension. The code is available on github. I'm not sure if it's extra useful in current form, but there is a lot of space for improvement. Table instead of a tree should be more readable, I'll try to make it happen next week.

screenshot from CSS Diff extension

Post a Comment for "Accessing Chrome's Last Inspected Element Being $0 And $1 Via Js"