diff --git a/README.md b/README.md index 25c7ab0..ac3d7bf 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,10 @@ EAF is an extensible framework, one can develop any Qt5 application and integrat sudo pip3 install dbus-python python-xlib pyqt5 pyqtwebengine pymupdf grip qrcode feedparser pyinotify markdown ``` - If you use Arch Linux, we recommend you install dependencies with below command: +If you use **Arch Linux**, it is recommended to install dependencies using `pacman` and `yay` instead. ```Bash -sudo pacman -S python-pyqt5 python-pyqt5-sip python-pyqtwebengine python-xlib python-qrcode python-feedparser -python-dbus python-pyinotify python-markdown +sudo pacman -S python-pyqt5 python-pyqt5-sip python-pyqtwebengine python-xlib python-qrcode python-feedparser python-dbus python-pyinotify python-markdown yay -S python-pymupdf python-grip ``` diff --git a/core/js/get_markers.js b/core/js/get_markers.js index ff0e50b..16cd561 100644 --- a/core/js/get_markers.js +++ b/core/js/get_markers.js @@ -1,25 +1,11 @@ (function() { function cssSelector(el) { - let path = []; - while (el.nodeType === Node.ELEMENT_NODE) { - let selector = el.nodeName.toLowerCase(); - if (el.id) { - selector += '#' + el.id; - path.unshift(selector); - break; - } else { - let sib = el, nth = 1; - while (sib = sib.previousElementSibling) { - if (sib.nodeName.toLowerCase() == selector) - nth++; - } - if (nth != 1) - selector += ":nth-of-type("+nth+")"; - } - path.unshift(selector); - el = el.parentNode; + let path = [], parent; + while (parent = el.parentNode) { + path.unshift(`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el)+1})`); + el = parent; } - return path.join(" > "); + return `${path.join(' > ')}`.toLowerCase(); } function getCoords(link){