Skip to content
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

Show title attribute tooltips command #5406

Open
bjoern-tantau opened this issue May 3, 2020 · 5 comments
Open

Show title attribute tooltips command #5406

bjoern-tantau opened this issue May 3, 2020 · 5 comments
Labels
language: javascript Issues which require knowing JavaScript. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.

Comments

@bjoern-tantau
Copy link

I am very successfully using qutebrowser on my Pinephone. It seems like it is very well suited for touchscreen (or more precisely, lack of mouse) support.

But I would like the ability to watch tooltips done through the title attribute. Either by treating a touch like hovering with the mouse over an element or through a command showing all title attributes.

I guess the latter would be more in the spirit of qutebrowser.

@toofar
Copy link
Member

toofar commented May 3, 2020

There is a hover hint target, "hint all hover" is bound to ;h by default, does that do that you want?

What OS are you using on it that has a good enough keyboard to not make it painful? Or did you rebind everything?

@bjoern-tantau
Copy link
Author

I tried it out on xkcd.com to see the text from the image but it did not work.

I'm using debian phosh with my own terminal key layout. But it should work for me more or less with any layout. I just bound b to back and comma and period to zoom in and out. Works quite well although I miss pinch to zoom.

@The-Compiler The-Compiler added language: javascript Issues which require knowing JavaScript. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible. labels May 7, 2020
@The-Compiler
Copy link
Member

I suppose it would be possible to extract title attributes and show them similar to how hints are being shown.

@Ingvix
Copy link

Ingvix commented Sep 25, 2020

Is it not possible to make the hint target hover to activate the title box like the real mouse cursor hover does?

For what it's worth, I created this shell userscript to use with :hint to show the title as an info message:

#!/bin/sh

# Set how long you want the message to show.
titleTimeout="10000"
# Set your value for messages.timeout here so the script can restore it.
defaultTimeout="4000"

restTime="$(echo "scale=3;(${titleTimeout}-${defaultTimeout})/1000" | bc)"

title="$(echo "$QUTE_SELECTED_HTML" |
	grep -Po '(?<=title=")(.*?)(?=")' |
	php -R 'echo html_entity_decode($argn);' |
	sed 's/"/\\"/g')"

([ -z "$title" ] &&
	echo "message-error 'No title to show.'" ||
	(
	echo "set messages.timeout $titleTimeout" &&
	echo "message-info \"$title\"" &&
	sleep "$restTime" &&
	echo "set messages.timeout $defaultTimeout")
) > "$QUTE_FIFO"

Also a simpler version if you don't mind having the same timeout as all the other messages:

#!/bin/sh

restTime="$(echo "scale=3;(${titleTimeout}-${defaultTimeout})/1000" | bc)"

title="$(echo "$QUTE_SELECTED_HTML" |
	grep -Po '(?<=title=")(.*?)(?=")' |
	php -R 'echo html_entity_decode($argn);' |
	sed 's/"/\\"/g')"

([ -z "$title" ] &&
	echo "message-error 'No title to show.'" ||
	echo "message-info \"$title\""
) > "$QUTE_FIFO"

@The-Compiler
Copy link
Member

Is it not possible to make the hint target hover to activate the title box like the real mouse cursor hover does?

It seems to do that sometimes? No idea why it doesn't always work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: javascript Issues which require knowing JavaScript. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.
Projects
None yet
Development

No branches or pull requests

4 participants