Skip to content

Search parameters of external links in epubs are stripped #110

@wrCisco

Description

@wrCisco

When clicking on an external link with search parameters inside an epub, say https://www.example.com?attr_a&attr_b=123, the search parameters are stripped and the browser opens the external page without them, which sometimes leads to a wrong page.

It seems to me that only epubs are affected by this: the View's method #handleLinks calls section.resolveHref, which is an epub only feature, that calls resolveURL (in epub.js), which removes the search parameters. Since this has been introduced with a specific commit (d44e8d6) I guess it's the intended behavior, but I'm not sure if it was intended for external links also.

My workaround is to listen to the event 'external-link' and to retrieve again the href from the a element (and then to call event.preventDefault() to avoid the double opening of the external page).

Is this the better approach or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions