Use Bookmarklets on Chrome on Android (2020)

(paul.kinlan.me)

38 points | by danuker 58 days ago

10 comments

  • rektide 58 days ago
    Alas, many sites have Content-Security Policies, which doesn't block bookmarklets outright, but keeps them from functioning in basic ways: often CSP prevents contact with other sites.

    So you can modify the page, yes. But you can't submit content to other domains. You can't load more code. This double-dooms kick-ass awesome extensions like Hypothes.is[1], the brilliant Web Annotation tool/bookmarklet: the bookmarklet can't load the rest of the code needed to launch the experience, and the bookmarklet can't send those annotations the user makes to the user's destination.

    I've seen very little interest when issues are raised about doing anything to help Bookmarklets[1]. Browsers seemingly don't care about these users & are fine with Bookmarklets being left to rot away. Meanwhile Chrome on Android still has no other means for users to extend/augment/enhance their own web experience, as Chrome has said repeatedly Extensions will not be supported on mobile, leaving users with nothing.

    [1] https://web.hypothes.is/help/installing-the-bookmarklet/

    [2] https://github.com/w3c/webappsec-csp/issues/444

    • jaden 58 days ago
      This is doubly frustrating when the spec explicitly says CSP shouldn't interfere with bookmarklets.

      > Policy enforced on a resource SHOULD NOT interfere with the operation of user-agent features like addons, extensions, or bookmarklets.

      https://www.w3.org/TR/CSP/#extensions

      • danuker 58 days ago
        The user-agent not doing what the user wants is not a user-agent.

        I recently wanted to edit a Firefox theme to highlight the active tab more strongly.

        Surprise! To install extensions not signed by Mozilla, you need Firefox Developer Edition.

        Because a configuration option would make it too easy.

  • 627467 58 days ago
    I feel bookmarklets are so underrated. I get that apps and extensions - when available - can provide a better experience but bookmarklets work to avoid having to install yet another app/extension.
  • russellbeattie 58 days ago
    This is awesome! I wish I had seen it years ago.

    I also wish the Chrome team would finally do something about the miserable bookmarking functionality in all versions of Chrome. There's no reason for it to be so featureless. Just adding some simple tweaks would make it so much more useful:

    Sortable table:

      - Name
      - Summary (Same as presented in a search)
      - Date added, 
      - Last date visited, 
      - Domain
      - Path, 
      - Thumbnail / favicon
      - Meta data: published, author, opengraph/Twitter info metadata, feed.
      - Editable Notes
    
    Additional basic features:

      - Quick list of most recent bookmarks
      - Quick List of most used bookmarks
      - Duplication detection
      - Embedded videos for YouTube vids
      - Online access for editing and management, sharing and broken/dead link detection.
    
    Throw some ads in there as well if that's what Google is worried about. It's just a huge oversight on their part to ignore such a fundamental feature for over a decade. Same for Mozilla.

    There's already so much data stored about your browsing activity, this is just a matter of UI, not any major internal dev effort.

    Interesting internal pages:

      - chrome://site-engagement/
      - chrome://media-engagement/
      - chrome://offline-internals/
      - chrome://snippets-internals/
    • andirk 58 days ago
      Every time i see someone's bookmarks, its a huge unending unsorted list. Have we all given up on bookmarks? And what's Pocket?
      • kragen 58 days ago
        My bookmark file has hashtags, dates, and summaries, so I can grep it (or isearch it in Emacs). That's enough to be extremely useful.
    • 1vuio0pswjnm7 58 days ago

         - chrome://accessibility
         - chrome://dino 
         - chrome://discards
  • Groxx 58 days ago
    While I love this trick: this is yet another reason that I use Firefox on Android, and am so baffled and enraged that they broke extensions so badly. This seems like it may be mere inches away from a bugfix getting rid of it.

    Modifying websites is one of the absolute best things about websites. You don't have to put up with sites' nonsense.

    • causality0 58 days ago
      Performance and stability are still godawful on Firefox Android though.
  • kinlan 58 days ago
    Author here. Hello.

    Bookmarklets are a massively under used feature. I love them :)

  • danuker 58 days ago
    I was surprised to find out that Kill-sticky works with this method.

    It was recently featured on HN: https://news.ycombinator.com/item?id=32998091

  • nmstoker 58 days ago
    You used to be able to use a Chrome Mobile bookmarklet to trigger view source, which was kind of handy, but it got broken several years back unfortunately.
  • kgbcia 58 days ago
    add this page as a bookmark then click edit to change to JavaScript url. try squarefree.com for some bookmarklets better than manifest v3.
  • andirk 58 days ago
    Is a bookmarklet the same as pasting Javascript in to the browser console?
    • kinlan 58 days ago
      Pretty much
      • kragen 58 days ago
        Does Chrome on Android have a browser console?
  • w_for_wumbo 58 days ago
    This seems convenient, but now I worry scammers will use this as another way of getting people to run arbitrary JavaScript on the client's device. 'Instructions' on how to do {x}, but it's also siphoning cookies off to an undisclosed backend.
    • kinlan 58 days ago
      This is the worry a lot of people have. The only real saving grace is that copying in JS to the address bar doesn't execute the code, and it's a bit of a pain to get bookmarklets bookmarked.