Age | Commit message (Collapse) | Author |
|
Previously the `choice.npr.org` page wasn't showing up in history. Using
`window` appears to fix this and correctly add the choice page to
browser history.
|
|
In this example:
https://www.npr.org/sections/thesalt/2018/08/20/636845604/beer-drinking-water-and-fish-tiny-plastic-is-everywhere
the article ID isn't in the position we expect it to be, and we instead
get `08` as the `article_id`.
Instead of expecting the article ID to always be in the same spot, look
for it in the second-from-last position.
|
|
|
|
Since the site doesn't provide a function to do this, make a mechanism
to do it automatically.
The text mode version is light and doesn't track visitors.
In order to redirect to the text version of the article, we pull out the
article's ID and use it in the text mode URL.
Thanks to these MDN docs explaining how to parse query string arguments:
- https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams#Example
- https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get#Example
|