Match on the pathname so that it's environment independent

When testing in dev (or other) environments our URLs aren't consistent
with production. Make sure this JS works without requiring us being on
GOV.UK.