Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get Firefox debugger watch's target element?
    primarykey
    data
    text
    <p>I've been trying to add the highlighting feature to the Firefox DevTools debugger, so it will highlight the element instead of only showing [HTMLAnchorElement] or similar. I know it's possible, since you can set <code>someElement.style.border='1px solid blue'</code> or similar as a watch, and it hightlights the element. So why not let it store current border, and show it on mouseover using <code>element.style.border='1px solid blue'</code>, and restore it on mouseout? <img src="https://i.stack.imgur.com/HBE4t.png" alt="Cannot inspect where the document of these elements in the watch expressions are."></p> <p>While debugging in Firefox devtools, I noticed the element in the right watch panel has rows with the variable names, which are actually given odd ids like "46439", under parent element with "document.getelementsbytagname('a')36" id. What do these ids signify? Can they map a display element to its target element in the page? I tried <code>window.DebuggerView.WatchExpressions.getItemForElement</code> from Venkman but it returns null. Is there another function from <a href="https://hg.mozilla.org/mozilla-central/file/34a9d08a82c4/browser/devtools/debugger/debugger-panes.js" rel="nofollow noreferrer">this source file</a> that will give the target element of debugger watch?</p> <p>Ideally, I should be able to 'watch' items such as <code>document.getElementsByTagName('a')</code>, or local variable in the debug context, and highlight the items in the page like Chromium/Firebug. Yet I'm not sure how to add this feature from a Firefox extension.</p> <p><strong>Update</strong>:</p> <p>After further work, it would seem to be possible to use the <code>DebuggerView.StackFrames.evaluate</code> to run code while stopped at a breakpoint, like what <code>chrome://browser/content/devtools/debugger-controller.js</code> is doing with watches. Unfortunately when stopped at a breakpoint I run this code, and <code>DebuggerView.StackFrames.evaluate</code> is <code>[void] void</code> in Venkman. Is this evaluate command hidden or private somehow, or not initialized?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload