mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 773556 - Check URI scheme for readability. r=mfinkle
This commit is contained in:
parent
359d98077a
commit
08d57c6379
@ -6302,6 +6302,13 @@ let Reader = {
|
||||
|
||||
let tab = BrowserApp.getTabForId(tabId);
|
||||
let url = tab.browser.contentWindow.location.href;
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
|
||||
if (!(uri.schemeIs("http") || uri.schemeIs("https") || uri.schemeIs("file"))) {
|
||||
this.log("Not parsing URI scheme: " + uri.scheme);
|
||||
callback(null);
|
||||
return;
|
||||
}
|
||||
|
||||
// First, try to find a cached parsed article in the DB
|
||||
this.getArticleFromCache(url, function(article) {
|
||||
@ -6315,7 +6322,6 @@ let Reader = {
|
||||
// changes the document object in several ways to find the article
|
||||
// in it.
|
||||
let doc = tab.browser.contentWindow.document.cloneNode(true);
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
|
||||
let readability = new Readability(uri, doc);
|
||||
article = readability.parse();
|
||||
|
Loading…
Reference in New Issue
Block a user