Convert feed processor to native URLs
This commit is contained in:
parent
be80598c6b
commit
af6029b854
2 changed files with 5 additions and 5 deletions
|
@ -366,7 +366,7 @@ Zotero.FeedReader._getFeedItem = function (feedEntry, feedInfo) {
|
|||
}
|
||||
|
||||
let item = {
|
||||
guid: feedEntry.id || feedEntry.link.spec
|
||||
guid: feedEntry.id || feedEntry.link.href
|
||||
};
|
||||
|
||||
if (feedEntry.title) item.title = Zotero.FeedReader._getRichText(feedEntry.title, 'title');
|
||||
|
@ -386,7 +386,7 @@ Zotero.FeedReader._getFeedItem = function (feedEntry, feedInfo) {
|
|||
}
|
||||
}
|
||||
|
||||
if (feedEntry.link) item.url = feedEntry.link.spec;
|
||||
if (feedEntry.link) item.url = feedEntry.link.href;
|
||||
|
||||
if (feedEntry.rights) item.rights = Zotero.FeedReader._getRichText(feedEntry.rights, 'rights');
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ const RSS090NS = "http://my.netscape.com/rdf/simple/0.9/";
|
|||
|
||||
/** *** Some general utils *****/
|
||||
function strToURI(link, base) {
|
||||
base = base || null;
|
||||
base = base || undefined;
|
||||
try {
|
||||
return Services.io.newURI(link, null, base);
|
||||
return new URL(link, base);
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
|
@ -308,7 +308,7 @@ Feed.prototype = {
|
|||
}
|
||||
var url = this._resolveURI(this.image.url, base);
|
||||
if (url) {
|
||||
this.image.url = url.spec;
|
||||
this.image.url = url.href;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue