Use baseNode over anchorNode in follow-selected

baseNode isn't documented anywhere that I can find, but it seems to be
getting us what anchorNode used to get us.
This commit is contained in:
Jay Kamat 2018-02-22 16:42:07 -05:00
parent ada15510a7
commit 7ecbae765d
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -331,13 +331,13 @@ window._qutebrowser.webelem = (function() {
// Function for returning a selection to python (so we can click it)
funcs.find_selected_link = () => {
const elem = window.getSelection().anchorNode;
const elem = window.getSelection().baseNode;
if (elem) {
return serialize_elem(elem.parentNode);
}
const serialized_frame_elem = run_frames((frame) => {
const node = frame.window.getSelection().anchorNode;
const node = frame.window.getSelection().baseNode;
if (node) {
return serialize_elem(node.parentNode, frame);
}