cohenerickson / Velocity

Velocity is a fully featured tabbed proxy with a seamless browsing experience.
https://velocity.radon.games
GNU Affero General Public License v3.0
132 stars 301 forks source link

Bookmarklets/favelets #6

Closed luphoria closed 1 year ago

luphoria commented 1 year ago

Here was my implementation in Hypertabs

  if (URL_BAR.value.startsWith("javascript:")) {
    try {
      jsUri = decodeURIComponent(
        URL_BAR.value.substring(11)
      );
    } catch {
      jsUri = URL_BAR.value.substring(11);
    }
    ACTIVE_WINDOW().eval(jsUri);

I will make a pull request for this implementation for Velocity later today.

luphoria commented 1 year ago

Might be important to note that bookmarks themselves would not work in this way, because i'm navigating straight from URL_BAR. not sure what Velocity's implementation is, but regardless, this should be a quick fix from me.

cohenerickson commented 1 year ago

I already have an implementation that is very similar to this, the main limiting factor on bookmarklets right now is the inability to create them from the UI, if you use the JS api new Velocity.Bookmark it should be possible to create them

cohenerickson commented 1 year ago

Here is where it is implemented

https://github.com/cohenerickson/Velocity/blob/main/src/components/Bookmark.tsx#L18

luphoria commented 1 year ago

Thanks makes sense. Closing issue as fixed.