Bug 1541199 - Avoid reloading the page on triggering permalink twice
Bug 1541199 - Avoid reloading the page on triggering permalink twice

Currently if we hit 'y' or click on the link to generate a permalink,
and then do it again, the page will reload because on the second attempt
pushPermalink will return false and we won't preventDefault() the input
event. This is undesirable, so this patch modifies the check to be
more robust: if the current URL matches that of the destination permalink,
then we just return true right away.

As an intentional side-effect, this also avoids reloading the page if
you navigate directly to a permalink URL and then trigger the pushPermalink()
function. Currently this doesn't happen because permalink URL navigations
are handled by the rust web-server and the generated page doesn't allow
the user any affordance to trigger pushPermalink(). But the next patch
will change this so that HEAD-revision permalinks are served directly
from nginx using the generated files, and this will allow the user to
trigger pushPermalink() on these pages.

bill-mccloskey/searchfox,bill-mccloskey/searchfox,bill-mccloskey/searchfox,bill-mccloskey/searchfox,bill-mccloskey/searchfox,bill-mccloskey/searchfox