Comment by probablyrobert
Comment by probablyrobert 3 days ago
Author here - happy to answer any questions :)
Comment by probablyrobert 3 days ago
Author here - happy to answer any questions :)
You can use CSS selectors already! 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/ecfd6f66e8a77...
Ah, 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.
ah 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/8171c5c2af000b71...
Does this support DRM? Like playing Netflix and other commercial streaming-sites. I remember this being a big problem with Firefox-forks. What about Firefox Sync?
Is RPC from external processes possible with this? For example, calling the URL of the open tab, or a list of open tabs and their URLs and/or content? Or remote control a tab, navigating to other URLs, etc? This would be interesting for integrating it with other apps and scripts, and Firefox is somewhat lacking in that field.
How secure is this?
DRM is not possible to support unfortunately: https://glide-browser.app/faq#why-can't-i-play-drm-content
Firefox Sync does work!
RPC is not currently supported but I agree it would be pretty interesting, tweety[0] was recently shared with me and that looks like it'd be quite nice, although I haven't tried it yet.
So far the only divergence from Firefox that could impact security is evaluating the config file, so I've described how that is sandboxed in the security[1] docs but I'm not super happy with the contents of that docs page; anything else you'd like to see mentioned?
I've seen in the docs that the config does not support imports and also uses a special function for including config from other files. Will it stay this way? And does also prevent code from loading&eval via network? Maybe flesh this out more explicitly in the security-doc. It's not quite obvious from being in-between the docs.
Also, what about 3rd-partys? Can other webextensions access glides functions? Or even worse, websites? I guess this is prevented by Firefox itself, but explaining this more explicitly might be also an enhancement for the security-doc.
I'm not entirely sure what is going to happen with imports to be honest. My current thinking is that they'll be supported eventually but that imported modules should not have access to glide APIs. For anything that does need to use glide APIs, I would support that through a separate API.
Yes eval is blocked, and extensions / websites cannot access glide APIs.
Thanks that is very helpful! Agree those things should be mentioned in the security doc.
I'm not very familiar with Helix keybindings myself but if there are vim equivalents (and if they're actually implemented, a fair amount of mappings are missing right now) then you should be able to! There's a `motion` excmd you can use in your mappings.
I don't think it'll be possible to implement multi-cursor support through the config though unfortunately.
You can't configure extensions yet but you can set prefs! https://glide-browser.app/api#glide.prefs.set
I've never managed to figure out how to configure extensions through the Firefox JS APIs, but installing an add-on using the internal APIs isn't too hard. I do it in my VimFX config.js[0]. Hope this is useful.
0: https://ba.ln.ea.cx/src/marsironpi/dotfiles/tree/common/.vim...
No problem, thanks for making Glide. I'm looking forward to trying it. Also, feel free to take inspiration from anything else you might stumble upon in my configs.
Yes! All standard input elements have vim motions support but fair warning that a lot of the standard motions aren't implemented yet.
I like the hints API, especially that it can hint on browser elements. However, power users may find it desirable to be able to use the hints system to select arbitrary kinds of elements. Perhaps you could extend the hint functionality to allow callers to pass a CSS selector that determines what elements get hinted? One use case is to write a command that lets the user choose an element and copy its text.