HNHacker News
TopNewBestAskShowJobs

probablyrobert

202 karma · joined October 25, 2021

Creator of https://glide-browser.app
submissionscomments
probablyrobert··on Twelve Days of Shell
Shameless shill - I found Tridactyl and Vimium to be frustratingly limited due to the security restrictions imposed on web extensions, so I've been working on https://glide-browser.app/ for a while; It's a fork of Firefox with (some) vim motions and a TypeScript based config.
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Thank you! I just implemented the ones I use the most, e.g. diw, but the motions system is still in very early stages and there are lots of motions I haven't implemented yet.

I do plan on implementing as many motions as is feasible, but there are some intentional differences, e.g. `f` is used for hints instead of jump-to-char.

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
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.

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
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?

[0]: https://github.com/pomdtr/tweety

[1]: https://glide-browser.app/security

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Ah not yet sadly - https://github.com/glide-browser/glide/discussions/3

I personally prefer non-smooth scrolling as it feels faster.

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
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.

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
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...

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
oh that is very helpful, thanks for sharing :)
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
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...

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Oh wow this is very cool, thank you for sharing!!
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
You can't configure extensions yet but you can set prefs! https://glide-browser.app/api#glide.prefs.set
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Yes! All standard input elements have vim motions support but fair warning that a lot of the standard motions aren't implemented yet.
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
It's implemented as a set of patches + new files for net new files I add myself, then to build it, the firefox source is downloaded and patched automatically - so bumping the underlying firefox version is generally very easy.

I'm currently actually tracking the firefox beta channel because the frequent small updates are so easy to do.

probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Author here - happy to answer any questions :)
probablyrobert··on Show HN: Glide, an extensible, keyboard-focused web browser
Currently the easiest way to pull over settings I'm aware of is to use Firefox Sync[0]. I haven't looked into other settings import solutions yet.

[0]: https://www.firefox.com/en-GB/features/sync/

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
The most obvious way would be to simply annotate the fields, e.g.

  class Book(MonDoc):
    title: str = StrField()
    yearPublished: int = IntField()
If this means too much redundant information for you then you could try defining the fields to return the corresponding python type e.g.

  def IntField() -> int:
    ...
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Thanks for the suggestion, I've created an issue to track this as I do agree that `ANY` conveys the operation more clearly.

https://github.com/RobertCraigie/prisma-client-py/issues/293

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
If you're wanting to automatically generate the Prisma Schema then all you have to do is create the schema file, define the datasource connection and then run `prisma db pull`
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
I am not very familiar with EdgeDB but it is quite different to Prisma. EdgeDB is a database while Prisma is a database client. EdgeDB do provide their own clients to interface with the EdgeDB database but with Prisma you can connect to many different databases, e.g. PostgreSQL, SQLite, MongoDB etc
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Ah sorry I misread your comment, I thought you were agreeing and saying that filtering by a relational field is also unacceptable DSL.

Thank you :)

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
I find the relational API very easy and intuitive to work with. What do you not like about it?
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
How do you suggest to improve it?
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Unfortunately this is a solo project, however I am in communication with the Prisma team and the core engine that Prisma Python uses is backed by Prisma.
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Yes I had heard about that but due to the nature of Python typing, they can't actually type the query API properly without falling back to Any, negating the benefits of type checking.
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Use whatever works for you! I personally felt the same until I learned of Prisma. The main benefits for me are type checking and autocomplete.

Autocomplete is the big one as it lessens the learning curve immensely. You no longer have to search through documentation to find a relevant method, you simply have to trigger autocomplete and it'll show you what you can do!

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
My understanding of SQLModel is that it brings the benefits of both Pydantic and SQLAlchemy. The benefit of merging Pydantic with SQLAlchemy is that you can then use the database models directly in FastAPI route definitions.
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Thank you for sharing! It is much appreciated!
probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
No need to worry, the current behaviour will be preserved :)

The method used to interface with the internal engine will be able to be configured in the schema: https://www.prisma.io/docs/reference/api-reference/prisma-sc...

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Yes mapped types is a good example, Pick is also a good example:

https://www.typescriptlang.org/docs/handbook/utility-types.h...

probablyrobert··on Show HN: Prisma Python – A fully typed ORM for Python
Yeah, sharing the same database between two backends would not be a good idea. That said you do not have to use the TypeScript client at the same time as the Python client, they are independent of each other.
Page 1 of 2Next →