Skip to content
5 changes: 5 additions & 0 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,11 @@ function handleMessageChannelByLibzim (event) {
messagePort.postMessage({ action: 'giveContent', title: title, content: '' });
return;
}
// Update appstate for HTML content to ensure popovers work correctly
if (/\bx?html/i.test(ret.mimetype)) {
appstate.baseUrl = encodeURI(title.replace(/[^/]+$/, ''));
appstate.expectedArticleURLToBeDisplayed = title;
}
// Let's send the content to the ServiceWorker
const message = { action: 'giveContent', title: title, content: ret.content, mimetype: ret.mimetype };
messagePort.postMessage(message);
Expand Down