Mercurial > addons > firefox-addons > feed-preview
comparison js/feed-preview.js @ 31:76e23b361e92
Allow feed reader addons to subscribe to the currently viewed feed
Add a link element to the feed preview that points to the currently viewed feed
in order to allow feed reader addons to subscribe to it.
author | Guido Berhoerster <guido+feed-preview@berhoerster.name> |
---|---|
date | Tue, 22 Jan 2019 14:40:06 +0100 |
parents | 688d75e554e0 |
children | 4492db3b277e |
comparison
equal
deleted
inserted
replaced
30:b9dc94ce2eeb | 31:76e23b361e92 |
---|---|
18 `type="application/xslt+xml" href="${xslFilename}"`); | 18 `type="application/xslt+xml" href="${xslFilename}"`); |
19 feedPreviewDocument.firstChild.after(xmlStylesheetNode); | 19 feedPreviewDocument.firstChild.after(xmlStylesheetNode); |
20 | 20 |
21 feedPreviewDocument.querySelector('#default-stylesheet').href = | 21 feedPreviewDocument.querySelector('#default-stylesheet').href = |
22 browser.runtime.getURL('web_resources/style/feed-preview.css'); | 22 browser.runtime.getURL('web_resources/style/feed-preview.css'); |
23 | |
24 // link to the currently viewed feed in order to allow feed reader addons | |
25 // to subscribe to it | |
26 let feedLinkElement = feedPreviewDocument.querySelector('#feed-link'); | |
27 feedLinkElement.href = feed.url; | |
28 feedLinkElement.type = feed.type; | |
23 | 29 |
24 feedPreviewDocument.querySelector('title').textContent = feed.title; | 30 feedPreviewDocument.querySelector('title').textContent = feed.title; |
25 | 31 |
26 feedPreviewDocument.querySelector('label[for="feed-reader-selection"]') | 32 feedPreviewDocument.querySelector('label[for="feed-reader-selection"]') |
27 .textContent = browser.i18n.getMessage('feedReaderSelectionLabel'); | 33 .textContent = browser.i18n.getMessage('feedReaderSelectionLabel'); |