# Insert custom script tag into kibana

**URL:** <https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779>\
**Category:** Kibana\
**Created:** [April 25, 2020, 6:38pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779 "2020-04-25T18:38:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Gege](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_gege/32/45595_2.png) [@Paul\_Gege](https://discuss.elastic.co/u/Paul_Gege)\
**Post date:** [April 25, 2020, 6:38pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779/1 "2020-04-25T18:38:50Z")

</div>

Hi, I'd like to find out how I can insert a `<script>` tag into Kibana. I'd like to add event listeners to some HTML elements that are inserted into Kibana through a plugin I'm using. If anyone can direct me to where I can find out how to insert javascript (to do some DOM manipulation) into Kibana, that'd be great.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [April 25, 2020, 8:36pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779/2 "2020-04-25T20:36:04Z")

</div>

When you are using the default plugin generator, it will generate a file `hacks.js`. This file will be executed on every page in Kibana (basically like a custom script tag). You can do anything you want in there (e.g. adding event listeners).

---

<div class="post-metadata">

**Author:** ![Paul\_Gege](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_gege/32/45595_2.png) [@Paul\_Gege](https://discuss.elastic.co/u/Paul_Gege)\
**Post date:** [April 25, 2020, 8:49pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779/3 "2020-04-25T20:49:02Z")

</div>

Can you please point me to where I can read about and get started with the default plugin generator.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [April 25, 2020, 9:12pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779/4 "2020-04-25T21:12:06Z")

</div>

See this link: [https://github.com/elastic/kibana/blob/master/packages/kbn-plugin-generator/README.md](https://github.com/elastic/kibana/blob/master/packages/kbn-plugin-generator/README.md)

Make sure to switch to the branch for the version you want to target.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 23, 2020, 9:12pm UTC](https://discuss.elastic.co/t/insert-custom-script-tag-into-kibana/229779/5 "2020-05-23T21:12:07Z")

</div>

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