imputnet / cobalt

best way to save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
17.46k stars 1.44k forks source link

cobalt bookmarklet or similar #806

Open muuyo opened 1 month ago

muuyo commented 1 month ago

describe the feature you'd like to see

i've always loved bookmarklets like the asteroids one from many eons ago so Q: how feasible would it be to make a Cobalt based bookmarklet, installable through the about page or similar? being able to be on any tweet or video and instantly pass it through to Cobalt would be terrific, even if just for donwloading memes or something

additional context

No response

squeak9 commented 1 month ago

You can do one right now, related: #234 Here is one that doesn't check which website you're on, it just opens a new window and pastes the link of the current page you're on. Make a new bookmark and give it a good name and then paste this into the URL field:

javascript:void(window.open('https://cobalt.tools/#'+location.href));

If you're on android then you could use https://github.com/TrianguloY/UrlChecker and the pattern checker module by adding this:

  "Try to download using cobalt.tools": {
    "regex1": "^(https?):\/\/(\\S*)$",
    "regex": "^(?!.*(cobalt.))(.*)",
    "replacement": "https:\/\/cobalt.tools\/#$2",
    "enabled": "true"

then any link you open or share into the app could optionally add the cobalt stuff.

KwiatekMiki commented 1 month ago

from cobalt's discord server (link) and updated:

open in new tab version:

javascript:(()=>window.open('https://cobalt.tools/#'+encodeURIComponent(window.location)))()

replace current tab version:

javascript:window.location="https://cobalt.tools/#" + encodeURIComponent(window.location)

This will work on Firefox, but will completely nuke the previous page when you click it