You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The selectors we can currently specify are only scoped selectord. It means that, for any given lvlX element, in order to get its lvl{X-1} and lvl{X-2} parents, we have to check the DOM tree.
It works well for correctly crafted HTML, but fails as soon as the hierarchy is not in the HTML DOM order. This happens often when the hierarchy is in a sidebar, while the content is in the main part of the page. With our current scoped selectors, we cannot build such a hierarchy.
We need to allow global selectors, that instead of looking up the DOM tree will simply try to select an element in the page, wherever it is placed.
A possible API would be to allow passing objects to each selectors instead of strings.
The selectors we can currently specify are only scoped selectord. It means that, for any given
lvlX
element, in order to get itslvl{X-1}
andlvl{X-2}
parents, we have to check the DOM tree.It works well for correctly crafted HTML, but fails as soon as the hierarchy is not in the HTML DOM order. This happens often when the hierarchy is in a sidebar, while the content is in the main part of the page. With our current scoped selectors, we cannot build such a hierarchy.
We need to allow global selectors, that instead of looking up the DOM tree will simply try to select an element in the page, wherever it is placed.
A possible API would be to allow passing objects to each selectors instead of strings.
We keep retrocompatibility by converting simple strings to objects with a
global: false
and aselector
key.Checklist
global: false
as the defaultglobal: true
, will use the result of the first match of the selectorThe text was updated successfully, but these errors were encountered: