diff --git a/content/buffer.js b/content/buffer.js index cf1b1200..996e71a4 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -1292,13 +1292,6 @@ function Buffer() //{{{ return selection; }, - // quick function to get elements inside the document reliably - // argument "args" is something like: @id='myid' or @type='text' (don't forget the quotes around myid) - getElement: function (args, index) - { - return buffer.evaluateXPath("//*[" + (args || "") + "]").snapshotItem(index || 0); - }, - // more advanced than a simple elem.focus() as it also works for iframes // and image maps // TODO: merge with followLink()? diff --git a/content/liberator.js b/content/liberator.js index eb807320..1d2a6194 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -886,9 +886,9 @@ const liberator = (function () //{{{ function jumpToTag(file, tag) { liberator.open("chrome://liberator/locale/" + file, where); - // TODO: it would be better wo wait for pageLoad + // TODO: it would be better to wait for pageLoad setTimeout(function () { - var elem = buffer.getElement('@class="tag" and text()="' + tag + '"'); + let elem = buffer.evaluateXPath("//*[@class='tag' and text()='" + tag + "']").snapshotItem(0); if (elem) window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context else