PWA with share_target and shortcuts

Hi all,

I’m running TW via Bob in Termux, so accessing it on localhost on Android.
Following the instructions in this post, I was able to make TW a PWA installed on my phone (so that I don’t even have to use Tiddloid).
I could not however figure out how to enable share_target and shortcuts, which are pretty essential to speed up my workflow on Android (for example to quickly add a webpage URL or a picture into a new tiddler, or to open an existing tiddler in the PWA from a shortcut button on my homescreen).

My $:/manifest.json looks like this currently (I’ve hardcoded the URLs for now because I did not spend enough time figuring out a better way):

`{
  "name": "`{{$:/SiteTitle}}`",
  "short_name": "`{{$:/SiteTitle}}`",
  "description": "tiddlywiki PWA de zig",
  "theme_color": "#4682B4",
  "background_color": "#4682B4",
  "display": "standalone",
  "orientation": "portrait",
  "scope": "http://localhost:8005/",
  "start_url": "http://localhost:8005",
  "icons": [
    {
      "src": "`<<datauri "icon-192x192.png">>`",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "`<<datauri "icon-512x512.png">>`",
      "sizes": "512x512",
      "type": "image/png"
    }
  ],
  "share_target":
    {
      "action": "http://localhost:8005/",
      "method": "GET",
      "enctype": "application/x-www-form-urlencoded",
      "params":
        {
          "action": "createtid",
          "name": "NewNote",
          "title": "title",
          "text": "text",
          "url": "url"
        }
  },
  "shortcuts": [
    {
      "name": "Groceries",
      "url": "http://localhost:8005/#Groceries",
      "icons": [{
          "src": "`<<datauri "icon-96x96.png">>`",
          "sizes": "96x96",
          "type": "image/png"
          }]
    }
  ]
}`

The PWA does not appear in the list of targets when sharing, or in the menu to add a shortcut to the homescreen.
I don’t know much (at all) about PWAs or JavaScript - not sure if a service worker is actually required for share_target or shortcuts?


Maybe you will like this

Thanks for your answer @oeyoews, but I’m not sure I understand what you’re suggesting.

Indeed Tiddlywiki.com can apparently be installed as a PWA, which I didn’t know.
However I also can’t find any related share targets or shortcuts.
I also can’t find the manifest.json - in fact even the browser’s devtools can’t detect a manifest, which makes me wonder how Tiddlywiki.com can even be “installed”…

Am I missing something from your answer?

No need to be curious, this should be a feature added to the browser in the past two years, all web pages can be installed

Well, after 3 days of intensive research, I finally found this old StackOverflow comment from 2020 which highlighted a pre-requisite that I never saw before in order to install PWAs on Android… being logged into a Google account!
Once I was, easy peasy, Tiddlywiki is installed as a PWA, I can share content with it, and I can have my Groceries shortcut on the home page.
Hoping that this comment helps someone one day !

2 Likes