Compare Revisions

Adding feed readers to Firefox

Revision 306609:

Revision 306609 by trevorh on

Revision 379191:

Revision 379191 by kmaglione on

Title:
Adding feed readers to Firefox
Adding feed readers to Firefox
Slug:
Adding_feed_readers_to_Firefox
Adding_feed_readers_to_Firefox
Tags:
"Configuration management"
"Configuration management"
Content:

Revision 306609
Revision 379191
nn13    <h3 id="Adding_a_feed_reader_from_a_web_application" name="Ad
 >ding_a_feed_reader_from_a_web_application">
14      Adding a feed reader from a web application
15    </h3>
16    <p>
17      JavaScript code on the web can add a feed reader easily, us
 >ing the <code>navigator.registerContentHandler()</code> function,
 > like this:
18    </p>
19    <pre class="brush: js">
20navigator.registerContentHandler("application/vnd.mozilla.maybe.f
 >eed",
21                                 "https://www.example.com/?feed-f
 >eed=%s",
22                                 "My Feed Reader");
23</pre>
24    <p>
25      Note that web content is limited to adding handler URLs whi
 >ch have the same origin as the page performing the call.
26    </p>
27    <h3>
28      Adding a feed reader from an extension
29    </h3>
30    <p>
31      Extensions wishing to register feed readers should do so us
 >ing the privileged API, which bypasses user confirmation and does
 > not restrict the handler URI to the same origin as the caller.
32    </p>
33    <pre class="brush: js">
34Cc["@mozilla.org/embeddor.implemented/web-content-handler-registr
 >ar;1"]
35    .getService(Ci.nsIWebContentHandlerRegistrar)
36    .registerContentHandler("application/vnd.mozilla.maybe.feed",
37                            "chrome://example/content/feed.xul?fe
 >ed-url=%s",
38                            "My Feed Reader",
39                            null /* Source window. Leave null whe
 >n the request originates in privileged code */);
40</pre>
41    <h3>
42      Adding a new feed reader manually
43    </h3>
t53    <h3 id="Adding_a_feed_reader_from_a_web_application" name="Adt
>ding_a_feed_reader_from_a_web_application"> 
54      Adding a feed reader from a web application
55    </h3>
56    <p>
57      JavaScript code on the web can add a feed reader easily, us
>ing the <code>navigator.registerContentHandler()</code> function, 
> like this: 
58    </p>
59    <pre>
60navigator.registerContentHandler("application/vnd.mozilla.maybe.f
>eed", 
61                                 "http://www.theeasyreaderurl.com
>?feed=%s", 
62                                 "Easy Reader");
63</pre>

Back to History