Skip to content
  • Categories
  • Recent
  • Popular
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB-ActivityPub Bridge Test Instance

  1. Home
  2. Categories
  3. General Discussion
  4. AP Test (community.nodebb.org)
  5. Signalling "open in app" behaviour for AP content

Signalling "open in app" behaviour for AP content

Scheduled Pinned Locked Moved AP Test (community.nodebb.org)
activitypub
29 Posts 11 Posters 415 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • julian@community.nodebb.orgJ julian@community.nodebb.org

    Does anyone know what the most broadly implemented standard is for signalling that a web page has an alternative ActivityPub endpoint?

    What I found online (and with @evan@cosocial.ca and @silverpill@mitra.social's input) was to deliver a Link header and set a <link> tag, but it doesn't seem to work (at least with Megalodon)...

    mauve@mastodon.mauve.moeM This user is from outside of this forum
    mauve@mastodon.mauve.moeM This user is from outside of this forum
    mauve@mastodon.mauve.moe
    wrote on last edited by
    #2

    @julian @evan @silverpill I found Link tag to suffice. Do you also have webfinger implemented?

    julian@community.nodebb.orgJ 1 Reply Last reply
    0
    • mauve@mastodon.mauve.moeM mauve@mastodon.mauve.moe

      @julian @evan @silverpill I found Link tag to suffice. Do you also have webfinger implemented?

      julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.org
      wrote on last edited by
      #3

      @mauve@mastodon.mauve.moe thanks for the response. While I implemented the link tag for all user, post, topic, and category routes (basically, anything that had a corresponding AP endpoint), I only checked a link to a post, which should have returned a Note object.

      I didn't check a link to a user profile, so maybe that's it.

      AIUI, webfinger wouldn't apply for other object types.

      @evan@cosocial.ca @silverpill@mitra.social

      mauve@mastodon.mauve.moeM 1 Reply Last reply
      0
      • julian@community.nodebb.orgJ julian@community.nodebb.org

        @mauve@mastodon.mauve.moe thanks for the response. While I implemented the link tag for all user, post, topic, and category routes (basically, anything that had a corresponding AP endpoint), I only checked a link to a post, which should have returned a Note object.

        I didn't check a link to a user profile, so maybe that's it.

        AIUI, webfinger wouldn't apply for other object types.

        @evan@cosocial.ca @silverpill@mitra.social

        mauve@mastodon.mauve.moeM This user is from outside of this forum
        mauve@mastodon.mauve.moeM This user is from outside of this forum
        mauve@mastodon.mauve.moe
        wrote on last edited by
        #4

        @julian @evan @silverpill Cool mind sending a link to the post json-ld and maybe the source code? I'd love to test it against my implementations and see what's up.

        julian@community.nodebb.orgJ 1 Reply Last reply
        0
        • mauve@mastodon.mauve.moeM mauve@mastodon.mauve.moe

          @julian @evan @silverpill Cool mind sending a link to the post json-ld and maybe the source code? I'd love to test it against my implementations and see what's up.

          julian@community.nodebb.orgJ This user is from outside of this forum
          julian@community.nodebb.orgJ This user is from outside of this forum
          julian@community.nodebb.org
          wrote on last edited by
          #5

          @mauve@mastodon.mauve.moe Yeah, sure thing! This is the source code for one of them, it adds the link header when loading a topic.

          You can try viewing the source of https://community.nodebb.org/post/99307 or making a HEAD call against it to see the meta tag and Link header, respectively.

          julian@community.nodebb.orgJ 1 Reply Last reply
          0
          • julian@community.nodebb.orgJ julian@community.nodebb.org

            @mauve@mastodon.mauve.moe Yeah, sure thing! This is the source code for one of them, it adds the link header when loading a topic.

            You can try viewing the source of https://community.nodebb.org/post/99307 or making a HEAD call against it to see the meta tag and Link header, respectively.

            julian@community.nodebb.orgJ This user is from outside of this forum
            julian@community.nodebb.orgJ This user is from outside of this forum
            julian@community.nodebb.org
            wrote on last edited by
            #6

            @mauve@mastodon.mauve.moe Also tested a user link, and that also didn't work — shrug maybe it'll work in yours?

            1 Reply Last reply
            0
            • julian@community.nodebb.orgJ julian@community.nodebb.org

              Does anyone know what the most broadly implemented standard is for signalling that a web page has an alternative ActivityPub endpoint?

              What I found online (and with @evan@cosocial.ca and @silverpill@mitra.social's input) was to deliver a Link header and set a <link> tag, but it doesn't seem to work (at least with Megalodon)...

              silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.social
              wrote on last edited by
              #7

              @julian @evan @evan Normally you send a GET request where Accept header contains the AP media type. The server checks the value of Accept header and returns either HTML page or AP object (or redirects to AP object)
              I've heard about <link> tag but I don't know if any applications actually support it

              julian@community.nodebb.orgJ evan@cosocial.caE 2 Replies Last reply
              0
              • soniex2@socialhub.activitypub.rocksS This user is from outside of this forum
                soniex2@socialhub.activitypub.rocksS This user is from outside of this forum
                soniex2@socialhub.activitypub.rocks
                wrote on last edited by
                #8
                fedilinks web+ap is probably the most widely supported, depending on how you count.
                1 Reply Last reply
                0
                • silverpill@mitra.socialS silverpill@mitra.social

                  @julian @evan @evan Normally you send a GET request where Accept header contains the AP media type. The server checks the value of Accept header and returns either HTML page or AP object (or redirects to AP object)
                  I've heard about <link> tag but I don't know if any applications actually support it

                  julian@community.nodebb.orgJ This user is from outside of this forum
                  julian@community.nodebb.orgJ This user is from outside of this forum
                  julian@community.nodebb.org
                  wrote on last edited by
                  #9

                  Thanks @silverpill@mitra.social, in my case while making the call is definitely an option, I was hoping for something I could do pre-flight (e.g. an opportunistic HEAD call).

                  This issue provides some good guidance (with comments from @mauve@mastodon.mauve.moe and @snarfed.org@fed.brid.gy too!), so I'll have to see.

                  Perhaps it's just the app I'm using and it'll work fine via the web app for Mastodon.

                  NodeBB will implement a pre-flight HEAD call I think, although we don't yet.

                  silverpill@mitra.socialS 1 Reply Last reply
                  0
                  • julian@community.nodebb.orgJ julian@community.nodebb.org

                    Thanks @silverpill@mitra.social, in my case while making the call is definitely an option, I was hoping for something I could do pre-flight (e.g. an opportunistic HEAD call).

                    This issue provides some good guidance (with comments from @mauve@mastodon.mauve.moe and @snarfed.org@fed.brid.gy too!), so I'll have to see.

                    Perhaps it's just the app I'm using and it'll work fine via the web app for Mastodon.

                    NodeBB will implement a pre-flight HEAD call I think, although we don't yet.

                    silverpill@mitra.socialS This user is from outside of this forum
                    silverpill@mitra.socialS This user is from outside of this forum
                    silverpill@mitra.social
                    wrote on last edited by
                    #10

                    @julian @mauve @snarfed.org Content negotiation is a standard procedure described in the ActivityPub spec. Supporting other discovery methods might be a good idea (and a good topic for a FEP), but I don't recommend relying on them exclusively.

                    1 Reply Last reply
                    0
                    • silverpill@mitra.socialS silverpill@mitra.social

                      @julian @evan @evan Normally you send a GET request where Accept header contains the AP media type. The server checks the value of Accept header and returns either HTML page or AP object (or redirects to AP object)
                      I've heard about <link> tag but I don't know if any applications actually support it

                      evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.ca
                      wrote on last edited by
                      #11

                      @silverpill @julian @evan@community.nodebb.org I don't think content negotiation can be the be-all end-all. The <link> element and Link: HTTP headers are good to use. Julian, I will write it up and we'll see where it lands.

                      nightpool@socialhub.activitypub.rocksN julian@community.nodebb.orgJ 2 Replies Last reply
                      0
                      • evan@cosocial.caE evan@cosocial.ca

                        @silverpill @julian @evan@community.nodebb.org I don't think content negotiation can be the be-all end-all. The <link> element and Link: HTTP headers are good to use. Julian, I will write it up and we'll see where it lands.

                        nightpool@socialhub.activitypub.rocksN This user is from outside of this forum
                        nightpool@socialhub.activitypub.rocksN This user is from outside of this forum
                        nightpool@socialhub.activitypub.rocks
                        wrote on last edited by
                        #12
                        @evan1 I agree in theory but in this specific instance I'm not sure I understand where the Link header or meta tag would be helpful (I can definitely see where it'd be helpful for the case of e.g. a browser extension though)
                        1 Reply Last reply
                        0
                        • evan@cosocial.caE evan@cosocial.ca

                          @silverpill @julian @evan@community.nodebb.org I don't think content negotiation can be the be-all end-all. The <link> element and Link: HTTP headers are good to use. Julian, I will write it up and we'll see where it lands.

                          julian@community.nodebb.orgJ This user is from outside of this forum
                          julian@community.nodebb.orgJ This user is from outside of this forum
                          julian@community.nodebb.org
                          wrote on last edited by
                          #13

                          Thanks @evan@cosocial.ca — that'd be appreciated!

                          @nightpool@socialhub.activitypub.rocks, this would be helpful in NodeBB's case where we have a web app, so rendering a link to something is just an anchor.

                          I could theoretically override the anchor click handler to do a backend round-trip to check whether we could load the content in-app, otherwise fall back to a regular browser behaviour (a page navigation).

                          For example, let's say I link out to Evan's profile here. If NodeBB knew that this link had an alternative AP endpoint, then we could redirect the user instead to the local representation of his profile

                          evan@cosocial.caE scott@authorship.studioS 2 Replies Last reply
                          0
                          • julian@community.nodebb.orgJ julian@community.nodebb.org

                            Thanks @evan@cosocial.ca — that'd be appreciated!

                            @nightpool@socialhub.activitypub.rocks, this would be helpful in NodeBB's case where we have a web app, so rendering a link to something is just an anchor.

                            I could theoretically override the anchor click handler to do a backend round-trip to check whether we could load the content in-app, otherwise fall back to a regular browser behaviour (a page navigation).

                            For example, let's say I link out to Evan's profile here. If NodeBB knew that this link had an alternative AP endpoint, then we could redirect the user instead to the local representation of his profile

                            evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.ca
                            wrote on last edited by
                            #14

                            @julian @nightpool agreed. That's positive behaviour.

                            blaine@mastodon.socialB 1 Reply Last reply
                            0
                            • nightpool@socialhub.activitypub.rocksN This user is from outside of this forum
                              nightpool@socialhub.activitypub.rocksN This user is from outside of this forum
                              nightpool@socialhub.activitypub.rocks
                              wrote on last edited by
                              #15
                              julian: Thanks @silverpill@mitra.social, in my case while making the call is definitely an option, I was hoping for something I could do pre-flight (e.g. an opportunistic HEAD call). Can you explain what you mean by this? Making a GET or HEAD request with Accept: activity+json as the highest priority and HTML as the fallback should work fine and wouldn't require any extra round trips (like a preflight or Link header would)
                              1 Reply Last reply
                              0
                              • trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                                trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                                trwnh@socialhub.activitypub.rocks
                                wrote on last edited by
                                #16
                                julian: I could theoretically override the anchor click handler to do a backend round-trip to check whether we could load the content in-app, otherwise fall back to a regular browser behaviour (a page navigation). i believe this is what mastodon does, but it's also worth mentioning fep-e232 Object Links as a way to tag a given Link with the appropriate mediaType used for content negotiation: { "@context": "https://www.w3.org/ns/activitystreams", "content": "

                                This is an object link.

                                ", "tag": { "type": "Link", "name": "object link", "href": "https://example.com/some-object", "mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" } }
                                1 Reply Last reply
                                0
                                • evan@cosocial.caE evan@cosocial.ca

                                  @julian @nightpool agreed. That's positive behaviour.

                                  blaine@mastodon.socialB This user is from outside of this forum
                                  blaine@mastodon.socialB This user is from outside of this forum
                                  blaine@mastodon.social
                                  wrote on last edited by
                                  #17

                                  @evan @julian @nightpool for what it's worth, webfinger should be (re: is) able to do this, even if the implementations in the wild don't. The intent at the time was for webfinger to be the "DNS records" for "social addresses", and the main reasons we didn't just use DNS was because (1) DNS doesn't support anything but bare domain names, (2) management of DNS records at scale is hard, and (3) it wasn't possible to query DNS via the web.

                                  blaine@mastodon.socialB 1 Reply Last reply
                                  0
                                  • blaine@mastodon.socialB blaine@mastodon.social

                                    @evan @julian @nightpool for what it's worth, webfinger should be (re: is) able to do this, even if the implementations in the wild don't. The intent at the time was for webfinger to be the "DNS records" for "social addresses", and the main reasons we didn't just use DNS was because (1) DNS doesn't support anything but bare domain names, (2) management of DNS records at scale is hard, and (3) it wasn't possible to query DNS via the web.

                                    blaine@mastodon.socialB This user is from outside of this forum
                                    blaine@mastodon.socialB This user is from outside of this forum
                                    blaine@mastodon.social
                                    wrote on last edited by
                                    #18

                                    @evan @julian @nightpool lots of folks advocated to support any URI scheme in a webfinger lookup, and that's why we have the "acct" scheme at all - so that email-style addresses could be used alongside http etc URIs!

                                    The <Link> approach definitely works, but feels a bit reinventing-webfinger/creating more complexity in lookups (on the client side).

                                    Hope the context is helpful! 😊

                                    evan@cosocial.caE 1 Reply Last reply
                                    0
                                    • blaine@mastodon.socialB blaine@mastodon.social

                                      @evan @julian @nightpool lots of folks advocated to support any URI scheme in a webfinger lookup, and that's why we have the "acct" scheme at all - so that email-style addresses could be used alongside http etc URIs!

                                      The <Link> approach definitely works, but feels a bit reinventing-webfinger/creating more complexity in lookups (on the client side).

                                      Hope the context is helpful! 😊

                                      evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.ca
                                      wrote on last edited by
                                      #19

                                      @blaine @julian @nightpool

                                      So, for finding the AP equivalent of an URL that I think is a Web page, I'd take these steps:

                                      - Link header: HEAD and look for the Link: header (easy, fast)
                                      - Webfinger: Webfinger the URL (a little more complicated)
                                      - Content negotiation: GET with Accept header set to AS2 type
                                      - Parsing: GET and look for Link: header or <link> element

                                      For finding the HTML page for an AP object:

                                      - Link header: HEAD and look for Link:
                                      - AS2: GET and look for `url` at top level

                                      evan@cosocial.caE blaine@mastodon.socialB 2 Replies Last reply
                                      0
                                      • evan@cosocial.caE evan@cosocial.ca

                                        @blaine @julian @nightpool

                                        So, for finding the AP equivalent of an URL that I think is a Web page, I'd take these steps:

                                        - Link header: HEAD and look for the Link: header (easy, fast)
                                        - Webfinger: Webfinger the URL (a little more complicated)
                                        - Content negotiation: GET with Accept header set to AS2 type
                                        - Parsing: GET and look for Link: header or <link> element

                                        For finding the HTML page for an AP object:

                                        - Link header: HEAD and look for Link:
                                        - AS2: GET and look for `url` at top level

                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.ca
                                        wrote on last edited by
                                        #20

                                        @blaine @julian @nightpool

                                        For finding the HTML page for an AP object:

                                        - Link header: HEAD and look for Link:
                                        - Content negotiation: HEAD with Accept: set to text/html
                                        - AS2: GET and look for `url` at top level

                                        1 Reply Last reply
                                        0
                                        • evan@cosocial.caE evan@cosocial.ca

                                          @blaine @julian @nightpool

                                          So, for finding the AP equivalent of an URL that I think is a Web page, I'd take these steps:

                                          - Link header: HEAD and look for the Link: header (easy, fast)
                                          - Webfinger: Webfinger the URL (a little more complicated)
                                          - Content negotiation: GET with Accept header set to AS2 type
                                          - Parsing: GET and look for Link: header or <link> element

                                          For finding the HTML page for an AP object:

                                          - Link header: HEAD and look for Link:
                                          - AS2: GET and look for `url` at top level

                                          blaine@mastodon.socialB This user is from outside of this forum
                                          blaine@mastodon.socialB This user is from outside of this forum
                                          blaine@mastodon.social
                                          wrote on last edited by
                                          #21

                                          @evan @julian @nightpool in the Postel sense, though, it's too bad that a client implementor needs to maintain (at least) four discovery pathways, and may require four separate requests to validate the information. Similarly, an ap host doesn't know which spots a client will check, so needs to implement all four. I'm well out of the standards game, but I'd very much advocate for "pick one and stick with it" 😊

                                          evan@cosocial.caE 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Popular