Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource URL rewritten by the client #311

Open
kael opened this issue Mar 2, 2022 · 2 comments
Open

Resource URL rewritten by the client #311

kael opened this issue Mar 2, 2022 · 2 comments

Comments

@kael
Copy link

kael commented Mar 2, 2022

Steps to reproduce

  1. Bookmark a GitHub page, e.g. : https://via.hypothes.is/https://github.com/pedroslopez/whatsapp-web.js
  2. The bookmarked resource URI is https://github.com/pedroslopez/whatsapp-web.js/sponsors_list?block_button=false&current_repository=whatsapp-web.js.

Notice also https://github.com/pedroslopez/whatsapp-web.js/overview_actions/main.

Also, I'm wondering if this is correct in the payload: "href": "https://viahtml.hypothes.is/proxy/https://github.com/pedroslopez/whatsapp-web.js?via.client.ignoreOtherConfiguration=1&via.client.openSidebar=1&via.external_link_mode=new-tab".

Payload sent (from Chrome console):

{
    "created": "2022-03-02T11:41:29.812Z",
    "group": "__world__",
    "permissions": {
        "read": [
            "group:__world__"
        ],
        "update": [
            "acct:[email protected]"
        ],
        "delete": [
            "acct:[email protected]"
        ]
    },
    "tags": [
        "foo"
    ],
    "text": "",
    "updated": "2022-03-02T11:41:29.812Z",
    "user": "acct:[email protected]",
    "user_info": {
        "display_name": "kael"
    },
    "hidden": false,
    "links": {},
    "document": {
        "title": "GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app",
        "link": [
            {
                "href": "https://viahtml.hypothes.is/proxy/https://github.com/pedroslopez/whatsapp-web.js?via.client.ignoreOtherConfiguration=1&via.client.openSidebar=1&via.external_link_mode=new-tab"
            },
            {
                "href": "https://github.com/pedroslopez/whatsapp-web.js",
                "rel": "canonical",
                "type": ""
            },
            {
                "href": "https://github.com/pedroslopez/whatsapp-web.js",
                "rel": "canonical",
                "type": ""
            },
            {
                "href": "https://github.com/pedroslopez/whatsapp-web.js/overview_actions/main",
                "rel": "canonical",
                "type": ""
            },
            {
                "href": "https://github.com/pedroslopez/whatsapp-web.js/sponsors_list?block_button=false&current_repository=whatsapp-web.js",
                "rel": "canonical",
                "type": ""
            }
        ],
        "dc": {},
        "eprints": {},
        "facebook": {
            "image": [
                "https://repository-images.githubusercontent.com/171072967/f0240000-b107-11ea-8c2e-02755c9b1505"
            ],
            "image:alt": [
                "A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app - GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsA..."
            ],
            "site_name": [
                "GitHub"
            ],
            "type": [
                "object"
            ],
            "title": [
                "GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app"
            ],
            "url": [
                "https://github.com/pedroslopez/whatsapp-web.js"
            ],
            "description": [
                "A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app - GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsA..."
            ]
        },
        "highwire": {},
        "prism": {},
        "twitter": {
            "image:src": [
                "https://repository-images.githubusercontent.com/171072967/f0240000-b107-11ea-8c2e-02755c9b1505"
            ],
            "site": [
                "@github"
            ],
            "card": [
                "summary_large_image"
            ],
            "title": [
                "GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app"
            ],
            "description": [
                "A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app - GitHub - pedroslopez/whatsapp-web.js: A WhatsApp client library for NodeJS that connects through the WhatsA..."
            ]
        },
        "favicon": "https://github.githubassets.com/favicons/favicon.svg"
    },
    "uri": "https://github.com/pedroslopez/whatsapp-web.js/sponsors_list?block_button=false&current_repository=whatsapp-web.js",
    "target": []
}

I've had noticed the same with that URL https://assistance.free.fr/articles/freewifi_secure-informations-avancees-943 which then turned into https://assistance.free.fr/articles/freewifi_secure-informations-avancees-943?search-text=

Addendum: It's not possible to delete the wrongly linked annotation then, as the URLs don't match and the user is not sent back to the wrong URL.

@robertknight
Copy link
Member

This looks like an issue with Via. When visiting the page directly and executing document.querySelectorAll('link[rel=canonical]') in the browser console, only one element is returned with the correct URL. In Via however I saw 4, with different URLs:

Duplicate rel-canonical

@kael
Copy link
Author

kael commented Mar 2, 2022

This looks like an issue with Via.

Indeed.

I've just re-tested with the bookmarklet for that link https://assistance.free.fr/articles/freewifi_secure-informations-avancees-943 and it got correctly bookmarked - I can't use the bookmarklet with GitHub, probably because of interacting installed Firefox extensions (NoScript, etc).

@robertknight robertknight transferred this issue from hypothesis/client Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants