-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hints don't show on some pages #178
Comments
'Mark as Read' button in IRCCloud. This button appears once you have been away from the channel for a while and there has been a fair amount of activity. |
Add to this list: Gmail links to messages (the subject line) in HTML mode. |
Test case for the buildbot.net "fork me on github" banner. <a style="position: relative; left: -1em;" href="http://qutebrowser.org">
link link link
</a> |
The relayrides.com dropdown does not work because there is no link at all, there is just a |
Is issue #292 a duplicate of this one? Another for the ongoing list: The Arch Mirror Status page has sortable headings (Mirror URL, Protocol, Country...) that do not get link hints. |
I don't think so - this is about no hints showing up at all, #292 is about hints being there but nothing happens when activating them. On that page, that's because it's simply a |
'Member Login' on https://www.nearlyfreespeech.net/ |
@rcorre Hmm, that's an interesting one - it actually does get a hint, just a misplaced one. In word hinting mode: Also, it seems the "label" when inspecting it via Chromium is off too: |
Another one: |
I've been talking with @nemanjan00 about this a bit, and we found two possible solutions to catch elements with a JS click handler: Checking for the cursorGet the computed style for all elements, and see where the cursor has been overridden via CSS: :jseval Array.from(document.querySelectorAll("*")).filter(element => {return window.getComputedStyle(element, null).cursor == "pointer"}).forEach(e => e.style.background = "yellow");` This might be a bit of a performance problem though (but it seems to runs faster than I thought it would), and doesn't catch all cases (especially not fake input elements). Checking for addEventListener callsWe should get any element which had |
vimb also shows hints for elements with a |
FWIW Vimperator has an xpath which uses const DEFAULT_HINTTAGS =
util.makeXPath(["input[not(@type='hidden' or @disabled)]", "a", "area", "iframe", "textarea", "button", "select"])
+ " | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link'or @role='button' or @role='checkbox' or @role='combobox' or @role='listbox' or @role='listitem' or @role='menuitem' or @role='menuitemcheckbox' or @role='menuitemradio' or @role='option' or @role='radio' or @role='scrollbar' or @role='slider' or @role='spinbutton' or @role='tab' or @role='textbox' or @role='treeitem' or @tabindex]"
+ (config.name == "Muttator" ?
" | //xhtml:div[@class='wrappedsender']/xhtml:div[contains(@class,'link')]" :
""); |
@The-Compiler re checking for document.addEventListener('click', function onClick(event) {
if (event.target.closest('.click-handler-class')) {
// Handle click on .click-handler-class
}
}, true); |
@olmokramer That makes me wonder how (or whether) other projects handle this. Still I guess it'd be an improvement over what we have now. |
@The-Compiler Well, you could get a lot of false positives, i.e. hints that do nothing. It wasn't really clear from my example, but That said, this problem would of course still exist if you don't wrap the |
FYI Pentadactyl gets elements with |
Some more from #6278:
Those seem to work without JS. It looks like Vimium gives them hints because it looks at
Those look like the usual JS event handler case. |
Thanks for the Pleroma button fix. Those work now. There are some more Pleroma buttons not getting hinted, but you have to be logged in to see them. (they show on the left of every page when logged in) They're for setting post scope (4 options ranging from DM to Public), uploading files, picking an emoji for your post (also a smaller button to do the same for the subject line), or starting a poll. Is there a way I can find out what I'd have to add to my config by investigating the page somehow? |
@Soundtoxin You can use If you have more questions, let's keep that in #6278 though please, as I'd like to keep this one focused on collecting cases which need work. |
Checkboxes on eBay watchlist don't get hints |
https://cookieconsentspeed.run/ doesn't have hints for the cookie toggles: Despite those being checkboxes: |
Another one not involving JS at all is Google's non-JS pages: apparently those links show up as 0x0 elements: which we discard, see #1298 and #1311. With this patch: diff --git i/qutebrowser/browser/webengine/webengineelem.py w/qutebrowser/browser/webengine/webengineelem.py
index 5d4c6ad9a..30f6e2420 100644
--- i/qutebrowser/browser/webengine/webengineelem.py
+++ w/qutebrowser/browser/webengine/webengineelem.py
@@ -179,33 +179,27 @@ def rect_on_view(self, *, elem_geometry: QRect = None,
"""
utils.unused(elem_geometry)
utils.unused(no_js)
- rects = self._js_dict['rects']
- for rect in rects:
- # FIXME:qtwebengine
- # width = rect.get("width", 0)
- # height = rect.get("height", 0)
- width = rect['width']
- height = rect['height']
- left = rect['left']
- top = rect['top']
- if width > 1 and height > 1:
- # Fix coordinates according to zoom level
- # We're not checking for zoom.text_only here as that doesn't
- # exist for QtWebEngine.
- zoom = self._tab.zoom.factor()
- rect = QRect(int(left * zoom), int(top * zoom),
- int(width * zoom), int(height * zoom))
- # FIXME:qtwebengine
- # frame = self._elem.webFrame()
- # while frame is not None:
- # # Translate to parent frames' position (scroll position
- # # is taken care of inside getClientRects)
- # rect.translate(frame.geometry().topLeft())
- # frame = frame.parentFrame()
- return rect
- log.webelem.debug("Couldn't find rectangle for {!r} ({})".format(
- self, rects))
- return QRect()
+
+ rect = self._js_dict['rects'][0]
+ width = rect['width']
+ height = rect['height']
+ left = rect['left']
+ top = rect['top']
+
+ # Fix coordinates according to zoom level
+ # We're not checking for zoom.text_only here as that doesn't
+ # exist for QtWebEngine.
+ zoom = self._tab.zoom.factor()
+ rect = QRect(int(left * zoom), int(top * zoom),
+ int(width * zoom), int(height * zoom))
+ # FIXME:qtwebengine
+ # frame = self._elem.webFrame()
+ # while frame is not None:
+ # # Translate to parent frames' position (scroll position
+ # # is taken care of inside getClientRects)
+ # rect.translate(frame.geometry().topLeft())
+ # frame = frame.parentFrame()
+ return rect
def remove_blank_target(self) -> None:
if self._js_dict['attributes'].get('target') == '_blank':
diff --git i/qutebrowser/browser/webkit/webkitelem.py w/qutebrowser/browser/webkit/webkitelem.py
index 5bf96a610..adec6d776 100644
--- i/qutebrowser/browser/webkit/webkitelem.py
+++ w/qutebrowser/browser/webkit/webkitelem.py
@@ -204,25 +204,25 @@ def _rect_on_view_js(self) -> Optional[QRect]:
rect = rects[str(i)]
width = rect.get("width", 0)
height = rect.get("height", 0)
- if width > 1 and height > 1:
- # fix coordinates according to zoom level
- zoom = self._elem.webFrame().zoomFactor()
- if not config.val.zoom.text_only:
- rect["left"] *= zoom
- rect["top"] *= zoom
- width *= zoom
- height *= zoom
- rect = QRect(int(rect["left"]), int(rect["top"]),
- int(width), int(height))
-
- frame = cast(Optional[QWebFrame], self._elem.webFrame())
- while frame is not None:
- # Translate to parent frames' position (scroll position
- # is taken care of inside getClientRects)
- rect.translate(frame.geometry().topLeft())
- frame = frame.parentFrame()
-
- return rect
+ #if width > 1 and height > 1:
+ # fix coordinates according to zoom level
+ zoom = self._elem.webFrame().zoomFactor()
+ if not config.val.zoom.text_only:
+ rect["left"] *= zoom
+ rect["top"] *= zoom
+ width *= zoom
+ height *= zoom
+ rect = QRect(int(rect["left"]), int(rect["top"]),
+ int(width), int(height))
+
+ frame = cast(Optional[QWebFrame], self._elem.webFrame())
+ while frame is not None:
+ # Translate to parent frames' position (scroll position
+ # is taken care of inside getClientRects)
+ rect.translate(frame.geometry().topLeft())
+ frame = frame.parentFrame()
+
+ return rect
return None
interestingly tests still seem to work fine? I want to understand what's actually going on before pushing that change, though. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Adding
to Is it going to be okay to add |
I'd rather not if possible, as this results in a lot of duplicate hints for normal usages for |
Is |
I spent some time groking the qutebrowser codebase to figure out how linting works. It seems like what we do is provide a list of selectors via This seems like a relatively simple and comprehensive way to get pretty good results for hinting. However, I cross-referenced qutebrowser's implementation with Vimium's and they do more than just a css selector based approach. They actually iterate over every element in the DOM and then perform logic to figure out whether or not a link should be hinted. For example, they do not simply check for all I think if we want to get results as good as vimium we should probably try to figure out how to apply logic to figuring out whether an element should have a hint visible beyond just the logic with CSS selectors. I would love to a stab at an implementation that mimics Vimium's but I need to make sure the contributors would be receptive to such a massive overhaul to how we figure out what elements need hinted. @The-Compiler thoughts? |
I'm not really convinced this is a good idea, but it does warrant some further exploration. A couple of thoughts:
|
I'd be happy to help here. Any ideas on how you'd like to tackle this? |
Sorry for the delay, a lot of stuff going on right now. We already have a couple such test cases here: tests/end2end/data/hints/html. The corresponding test code lives in tests/end2end/test_hints_html.py. If you drop new HTML files in there, they should automatically be picked up, see the README of the directory for details. Perhaps for some JS-heavy stuff the tests need some small adjustments so that it doesn't check for a |
Most buttons on classroom.google.com don't have hinting, they are normal div elements and they appear to have a |
This comment was marked as off-topic.
This comment was marked as off-topic.
@twouters This is due to it being a cross-origin iframe: |
@hakan-demirli Seems to be due to it using shadow roots, so see #3569 / #7617 |
V155
on IRCFacebook input fields with
;t
Items at https://www.uni-bonn.de/studium/im-studium/studienorganisation/termine-und-fristen#einschreibefristen (
<span>
elements with JS click handlers)"Neueste zuerst" at https://www.ebay-kleinanzeigen.de/s-test-/k0 (
<div>
element with JS click handler)Twitter's "what's happening" box (
div
withrole=textbox
)"Keep me signed in" checkbox on https://www.messenger.com/
Contacts on WhatsApp web (except for the pictures):
Article links on tagesschau.de (Articles on tagesschau.de don't get hints #4988)
Searx category headers (There is no hint for searx search categories. #6694)
learnopengl.com menu items (Not all hints shown on certain websites #6864)
DuckDuckGo thems in settings (qutebrowser's hint mode doesn't show all clickable parts in a website #7738)
Pages which seem to work in the meantime:
mobile.de: this page. - It seems they wrap all<a>
-tags in<div>
tags and that maybe trips hint searching up.http://codecore.ca/Google searches (the "gle"/next link - the hint at the top left of that is for page 10)The text was updated successfully, but these errors were encountered: