# Prevent extension pages from closing when extension is updated

**URL:** <https://discourse.mozilla.org/t/prevent-extension-pages-from-closing-when-extension-is-updated/35087>\
**Category:** Development\
**Created:** [January 14, 2019, 9:07pm UTC](https://discourse.mozilla.org/t/prevent-extension-pages-from-closing-when-extension-is-updated/35087 "2019-01-14T21:07:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspenguin](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jspenguin/32/30634_2.png) [@jspenguin](https://discourse.mozilla.org/u/jspenguin)\
**Post date:** [January 14, 2019, 9:07pm UTC](https://discourse.mozilla.org/t/prevent-extension-pages-from-closing-when-extension-is-updated/35087/1 "2019-01-14T21:07:53Z")

</div>

When I update an extension (by opening the XPI in Developer Edition), any tabs that are currently showing extension pages (moz-extension:///) for that extension get closed, and I have to re-open them with “Recently closed tabs”. I would rather those tabs just get reloaded instead. Is there any way to prevent these tabs from closing? I could host a blank page externally and inject a content script into it instead of using an extension page, but I don’t want an external dependency.

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [January 18, 2019, 6:09pm UTC](https://discourse.mozilla.org/t/prevent-extension-pages-from-closing-when-extension-is-updated/35087/2 "2019-01-18T18:09:47Z")

</div>

Yeah, that was always something that annoyed me as well, so I just spent 2,5 hours creating this: [https://gist.github.com/NiklasGollenstede/63a6099d97e82ffe0cc064d4d4d82b62#file-readme-md](https://gist.github.com/NiklasGollenstede/63a6099d97e82ffe0cc064d4d4d82b62#file-readme-md)

It isn’t quite what you were asking for (as the README explains that doesn’t work), but it comes close and so far works pretty well for me.
