Feed abstract: Add <base>
Fixes broken relative (or protocol-relative) images.
This commit is contained in:
parent
c32a352ecc
commit
4fe7d6fa0e
2 changed files with 9 additions and 5 deletions
|
@ -10,10 +10,13 @@ class FeedAbstractChild extends JSWindowActorChild {
|
|||
this._stylesheetPromise = this.sendQuery('getStylesheet');
|
||||
}
|
||||
|
||||
async receiveMessage({ name, data }) {
|
||||
async receiveMessage({ name, data: { url, html } }) {
|
||||
switch (name) {
|
||||
case "setContent": {
|
||||
this.document.documentElement.innerHTML = data;
|
||||
let base = this.document.createElement("base");
|
||||
base.href = url;
|
||||
this.document.head.replaceChildren(base);
|
||||
this.document.body.innerHTML = html;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,13 +126,14 @@
|
|||
}
|
||||
|
||||
async _renderFeedItem() {
|
||||
let abstract = this.item.getField('abstractNote');
|
||||
let url = this.item.library.url;
|
||||
let html = this.item.getField('abstractNote');
|
||||
this._abstractField.hidden = true;
|
||||
this._feedAbstractBrowser.hidden = false;
|
||||
this._section.summary = Zotero.Utilities.cleanTags(abstract);
|
||||
this._section.summary = Zotero.Utilities.cleanTags(html);
|
||||
|
||||
let actor = this._feedAbstractBrowser.browsingContext.currentWindowGlobal.getActor('FeedAbstract');
|
||||
await actor.sendQuery('setContent', abstract);
|
||||
await actor.sendQuery('setContent', { url, html });
|
||||
}
|
||||
|
||||
_renderRegularItem() {
|
||||
|
|
Loading…
Reference in a new issue