When Do Plugin Hacks Trigger

When on a dashboard my hacks will trigger the first time. If I click the breadcrumbs to go back to dashboard and click on other dashboards hacks.js will not trigger again until I click another app and the page reloads.

Is that by design? It kind of kills my plugin I am working on if hacks don't trigger on every single page that is clicked on.

hacks.js is triggered once when Kibana loads on the initial page load. When navigating between dashboards, Kibana is handling this navigation internally without reloading the whole page, so hacks are not triggered again.

In your hacks file you could listen for the hash change event and trigger your logic based on that.

Thanks. I will give that a shot.

Here's what I came up with if anyone else needs it.

import $ from "jquery";

window.onhashchange = locationHashChanged;

$(document).ready(function () {
  console.log("On Ready");
  initHack();
});

function locationHashChanged() {
  console.log("On Change");
  initHack();
}
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.