Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug popup.html of a Chrome Extension?

I'm making a Chrome Extension and need to view the HTML/CSS/JS of the popup.html.

I can't right click to inspect elements. Is there another way? I need to make sure CSS and JavaScript is being inserted correctly. How to debug a problem in that popup file?

like image 937
Skizit Avatar asked Feb 18 '11 09:02

Skizit


People also ask

How do I see Chrome extension errors?

If you navigate back to chrome://extensions/ , you should see errors have popped up for the extension locally.


2 Answers

Right click the extension's button, then 'Inspect Popup'

like image 131
TimCodes.NET Avatar answered Oct 04 '22 17:10

TimCodes.NET


Inspect Popup has gone away with the latest build.

Here's how I debug Chrome Extension Popups.

  1. Click your popup button to see the webpage (the popup window itself).
  2. Right-click in the window and select Inspect element
  3. The Chrome Debugger window comes up with the right context, but you've already missed your breakpoints and debugger statements.
  4. HERE'S THE TRICK. Click on the Console part of the debugger and type: location.reload(true) and press enter.

Now your breakpoints are hit! Great way to reload changed scripts without revisiting the Extension page.

like image 26
Tom N Avatar answered Oct 04 '22 15:10

Tom N