4 ms·
You can use CSS selectors already! https://glide-browser.app/hints#excmds https://glide-browser.app/hints#excmds I've used it to add keymappings so that hints
by probablyrobert 1y ago
You can use CSS selectors already! https://glide-browser.app/hints#excmds https://glide-browser.app/hints#excmds
I've used it to add keymappings so that hints only apply to certain kinds of buttons on a page, e.g. https://github.com/RobertCraigie/dotfiles/blob/ecfd6f66e8a775c80849f7889f297ef99cea7997/glide/glide.ts#L70 https://github.com/RobertCraigie/dotfiles/blob/ecfd6f66e8a77...
- MarsIronPI 1y agoAh, I missed that option, sorry. I was looking at `glide.hints.show'. Are CSS selectors usable with that function? The documentation doesn't say so. Also, would you consider making it return a promise instead of taking a callback? I think that would be more ergonomic.
- probablyrobert 1y agoah yeah sorry about that, the API docs aren't quite complete yet. I'd recommend just looking at the glide.d.ts[0], it should be pretty readable (I hope). Yes the TS API supports it as well with the `selector` property: ``` glide.hints.show({ selector: "..." }); ``` > Also, would you consider making it return a promise instead of taking a callback? I think that would be more ergonomic. The reason it doesn't return a Promise directly is because the hints that are generated are not static, try scrolling while hints are active and you'll see them refresh. So the return type would have to be something else to work well with this functionality imo. [0]: https://github.com/glide-browser/glide/blob/8171c5c2af000b71e76b6b901a089b1a70eb8c3c/src/glide/browser/base/content/glide.d.ts#L379 https://github.com/glide-browser/glide/blob/8171c5c2af000b71...