Merge pull request #428 from da2x/patch-1

Keep origin protocol when converting to feed URI
This commit is contained in:
Brent Simmons 2018-09-04 13:27:31 -07:00 committed by GitHub
commit b762aba891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -65,13 +65,9 @@ function subscribeToFeed(theFeed) {
// in the PageLoadEnd.js so we can be more confident it's a // in the PageLoadEnd.js so we can be more confident it's a
// good feed: URL. // good feed: URL.
var feedURL = theFeed.href; var feedURL = theFeed.href;
if (feedURL.match(/^http[s]?:\/\//)) if (!feedURL.startsWith('feed:'))
{ {
feedURL = feedURL.replace(/^http[s]?:\/\//, "feed://"); feedURL = 'feed:' + feedURL;
}
else if (feedURL.match(/^feed:/) == false)
{
feedURL = "feed:" + feedURL;
} }
safari.extension.dispatchMessage("subscribeToFeed", { "url": feedURL }); safari.extension.dispatchMessage("subscribeToFeed", { "url": feedURL });