Retrieving the last post title from Beamer
The
window.Beamer
object exposes the ajax
method, used by Beamer to request data from its backend: this method is used, among other things, to retrieve the last post title and display it in the aforementioned tooltip. One can use that to their own advantage, and override the method as follows:let lastPostTitle;
const ajax = window.Beamer.ajax; // keep a reference to the original method...
window.Beamer.ajax = (url, callback) => {
ajax(url, response => { // ...and call it ourselves
try {
// Grab the info for later use if it is available
lastPostTitle = JSON.parse(response).lastPostTitle || "";
} catch (e) {} // fail silently otherwise
callback(response);
});
};
Finally, we can make sure the tooltip is never shown by replacing the method displaying it with a no-op function:
window.Beamer.showLastPostTitle = () => {};