Bug 1263628 - Ignore fragments when comparing URLs during reader view caching r=gijs

This seems to be a common issue with medium.com articles, but affects any page which was
opened using a fragment in the URL (e.g. foo.com/bar#baz is the same page as foo.com/bar,
however our reader view caching code didn't recognise the former as being equivalent to
the latter).

MozReview-Commit-ID: BtRmHq3sD9z

--HG--
extra : rebase_source : ac96a0a5e09c2cc60644a23cdbe8e72e94c1fcc9
extra : amend_source : 37d603820880ce751dbf571da49bbf8dcd7e6d03
extra : source : 7977a317cba8dbd983ac2988d346e01887f94a14
This commit is contained in:
Andrzej Hunt 2016-04-15 11:17:36 -07:00
Родитель f099c53749
Коммит 45f826fa31
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -238,10 +238,10 @@ this.ReaderMode = {
// Convert these to real URIs to make sure the escaping (or lack
// thereof) is identical:
try {
responseURL = Services.io.newURI(responseURL, null, null).spec;
responseURL = Services.io.newURI(responseURL, null, null).specIgnoringRef;
} catch (ex) { /* Ignore errors - we'll use what we had before */ }
try {
givenURL = Services.io.newURI(givenURL, null, null).spec;
givenURL = Services.io.newURI(givenURL, null, null).specIgnoringRef;
} catch (ex) { /* Ignore errors - we'll use what we had before */ }
if (responseURL != givenURL) {