Keep origin protocol when converting to feed URI
Avoid downgrading HTTP to HTTPS. Introduces security and privacy risks; plus reduces performance with unnecessary redirects.
This commit is contained in:
parent
b78406073c
commit
4916077fb1
|
@ -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 });
|
||||||
|
|
Loading…
Reference in New Issue