bodacydo
bodacydo

Reputation: 79339

Is there any way to keep Developer Tools open when debugging a Chrome Extension?

I'm trying to debug a Chrome Extension but every time I refresh it, the developer tools window that is associated with the extension closes. Does anyone know if there is a way to keep it open?

Here's what I'm doing: I click the extension button, which opens a popup window. I then right click it and click "Inspect". That opens the Developer Tools. Now if I click the extension button again to refresh it (when I update code), the Developer Tools closes. :(

Upvotes: 34

Views: 12233

Answers (2)

null
null

Reputation: 2150

There are two ways to accomplish this.

  • Click on the Dev Tools popup so the window is focused and then press F5. This will reload the popup and Dev Tools, and will not cause the Dev Tools window to close.
  • If that doesn't work for you, go to chrome-extension://extensionid/path/to/popup.html on a separate tab on Chrome. From there, you can inspect element, and refreshing the file will not cause Dev Tools to close.

Upvotes: 67

Pawel Uchida-Psztyc
Pawel Uchida-Psztyc

Reputation: 3838

Dev Tools are closing because hosted page is closing (the popup). The view and it's logic stops working if you close the popup so there's nothing to inspect.

If you'd like to debug background page it will not close with the popup since it is running in background. That's all you can do.

Upvotes: 0

Related Questions