max / balanced_breakfast
1 file changed,
+5 insertions,
-1 deletion
| @@ -165,7 +165,11 @@ | |||
| 165 | 165 | if (sources.length === 0) { | |
| 166 | 166 | const emptyLi = document.createElement('li'); | |
| 167 | 167 | emptyLi.className = 'source-item source-item--empty'; | |
| 168 | - | emptyLi.innerHTML = '<div class="source-item-empty-icon">' + BB.ui.emptyStateIcon('feed') + '</div>Add your first feed to get started.<br>Click <strong class="source-item-empty-strong">+ Add Feed</strong> above,<br>or <a href="#" onclick="event.preventDefault(); BB.feeds.importOpml();" class="source-item-empty-link">import an OPML file</a>.'; | |
| 168 | + | emptyLi.innerHTML = '<div class="source-item-empty-icon">' + BB.ui.emptyStateIcon('feed') + '</div>Add your first feed to get started.<br>Click <strong class="source-item-empty-strong">+ Add Feed</strong> above,<br>or <a href="#" class="source-item-empty-link">import an OPML file</a>.'; | |
| 169 | + | // Wired programmatically (not inline onclick) so the CSP script-src | |
| 170 | + | // can stay 'self' with no 'unsafe-inline'. | |
| 171 | + | const importLink = emptyLi.querySelector('.source-item-empty-link'); | |
| 172 | + | if (importLink) importLink.onclick = (e) => { e.preventDefault(); BB.feeds.importOpml(); }; | |
| 169 | 173 | frag.appendChild(emptyLi); | |
| 170 | 174 | } | |
| 171 | 175 |