# Is there any event for open/close devtools from a webextension

**URL:** <https://discourse.mozilla.org/t/is-there-any-event-for-open-close-devtools-from-a-webextension/20194>\
**Category:** Development\
**Created:** [October 8, 2017, 8:16pm UTC](https://discourse.mozilla.org/t/is-there-any-event-for-open-close-devtools-from-a-webextension/20194 "2017-10-08T20:16:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorrete](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jorrete/32/30824_2.png) [@jorrete](https://discourse.mozilla.org/u/jorrete)\
**Post date:** [October 8, 2017, 8:16pm UTC](https://discourse.mozilla.org/t/is-there-any-event-for-open-close-devtools-from-a-webextension/20194/1 "2017-10-08T20:16:50Z")

</div>

Hi,  
Is there any event to know when the devtools are opened and closed in a webextension?  
Thanks.

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [October 8, 2017, 11:25pm UTC](https://discourse.mozilla.org/t/is-there-any-event-for-open-close-devtools-from-a-webextension/20194/2 "2017-10-08T23:25:36Z")

</div>

No. You could check for your dev tools page existing though. You’d create a port as soon as the page loads and then wait for the disconnect of the port to know when the page was closed.
