zarino/subscribe-with-feedbin

Show actual feed title, rather than <link> element's "title" attribute

Closed this issue · 2 comments

The list of available feeds on any particular page is populated with the title attribute of the <link> elements containing those feeds. This attribute is almost universally useless, as demonstrated on the Guardian site:

screen shot 2013-11-30 at 10 51 25

You wouldn't guess, here, that I'm actually on the /data section of their site, and this feed is, in fact, a feed of just their /data stories.

The <title> element inside the feed XML, however, is much more explicative:

<?xml version='1.0' encoding='UTF-8'?>
<rss version="2.0">
  <channel>
    <title>News: Data | theguardian.com</title>
    <link>http://www.theguardian.com/data</link>
    <description>Articles published by theguardian.com News about: Data</description>
    …

Could inject.js load and parse the feeds it finds on a page, and pull out a more useful title for page_actions.js to use?

On second thoughts, making the ajax requests from inject.js probably isn't the cleanest solution, since it'll mean polluting every page the user ever visits with an install of jQuery.

Maybe getting background.js to do the ajaxing is less antisocial.

Note to self: if background.js adds the new titles to the feeds variable, then it's either going to have to send the modified feeds back to inject.js (from which page_action.js requests them with the "give me feeds" message) or page_action.js is going to have to request its feeds from background.js, which is going to have to keep track of which feeds are associated with which tabs.