Bug 1297117 - Add documentation to stripAboutReaderUrl r?sebastian
MozReview-Commit-ID: Ibzhnk7LLmh
--- a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
@@ -40,16 +40,22 @@ public class ReaderModeUtils {
return urlFromAboutReader.equals(currentUrl);
}
public static String getAboutReaderForUrl(String url) {
return getAboutReaderForUrl(url, -1);
}
+ /**
+ * Obtain the underlying URL from an about:reader URL.
+ * This will return the input URL if either of the following is true:
+ * 1. the input URL is a non about:reader URL
+ * 2. the input URL is an invalid/unparseable about:reader URL
+ */
public static String stripAboutReaderUrl(String url) {
if (!AboutPages.isAboutReader(url)) {
return url;
}
final String strippedUrl = getUrlFromAboutReader(url);
return strippedUrl != null ? strippedUrl : url;
}