manugarg/pagenotes-issues

Option to Ignore URL fragments

Opened this issue · 1 comments

Feature Request: An option that allows Pagenotes to ignore the #fragement part of URL when looking for an existing note for a page.

Proglem: Pagenotes treats identical URL paths with different fragments as different pages, with different notes. For example, Google Docs adds fragments such as "#heading=h.aarfmbbsf9q3" to allow linking to specific sections of the doc, but page notes treats each different header as a different link.

Steps to reproduce:

  1. Create a new Google Doc, add a tittle and add an H1
  2. Click the title, then click Pagenotes and add a note
  3. Click the H1 element

Expected result:

The Pagenotes widget icon is a yellow flag, and my previous note is there

Actual result:

The Pagenote widget icon is unset, and I can add a new, independent note

Potential Solutions:

  • A checkbox (similar to "Apply to all pages of this site.") that has Pagenotes always ignore the fragment, with a setting that toggles whether this is default.
  • A section in the settings that allows one or more regular expressions that pull what should be the canonical part of a URL (e.g. "docs.google.com/[^#]+") when looking up notes for a given URL.