Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/accessibility-element-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class AccessibilityElementView extends SelectableView {

render () {
this.selectorPath.textContent = this.path

// Add a click-handler that will select the element
this.selectorPath.onclick = (evt) => {
evt.preventDefault()
chrome.devtools.inspectedWindow.eval(
"inspect($$(\"" + this.path.replace('"', '\\"') + "\")[0])",
function(result, isException) { }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a internal helper that is promise-based instead of callback-based you might want to use here.

https://github.com/electron/devtron/blob/master/lib/eval.js#L4

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I missed that 😊 . Fixed

);
}
}

filter (searchText) {
Expand Down
7 changes: 7 additions & 0 deletions static/devtron.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ tbody:focus,
padding-left: 45px;
}

.row-element-path a {
cursor: pointer;
}
tr.active .row-element-path a {
color: white;
}

.active .sidebar-icon {
background-color: white;
}
Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<td></td>
<td></td>
<td class="row-element-path">
<span data-field="selectorPath"></span>
<a data-field="selectorPath" href="#"></a>
</td>
</tr>
</template>
Expand Down