jacobobryant / hallway

Find relevant discussions.
MIT License
43 stars 2 forks source link

Deal with non-canonical URLs #7

Open jacobobryant opened 3 years ago

jacobobryant commented 3 years ago

Sites often add query parameters to URLs (e.g. ?fbclid=...), which will make Hallway not show any discussions. If the target page provides a canonical URL, we should use that instead. If not, maybe we can still do something about the query parameters. The trouble is we don't necessarily know if the query parameter is necessary to view the correct page (usually it's not, but it is in some cases). Perhaps load discussions for the URL with query parameters first, and if none are found, remove the query parameters and search again.

jacobobryant commented 3 years ago

I just realized we could also update the bookmarklet to check for a canonical link on the current page. That might be sufficient. (and if you're copying the link manually instead of using the bookmarklet, then just make sure you leave off any irrelevant query params).