Debug Tool for Chrome Extension Notification Window

I created a notification window using the Chrome extension API:

var notification = webkitNotifications.createHTMLNotification("notification.html"); notification.show(); 

There is also an external .js notification for all scripts that I would like to run in the notification window (since the manifest version 2 is discouraged by the built-in javascript). Everything works fine, except that I could not open the developer tools for the notification window to check the page. I can do this for both the background and the pop-up pages, so I’m not sure that I didn’t find it or simply can’t check the notification through the developer tool. I know that I can send messages between the background and the notification so that the outputs are displayed on the console, but it would be nice if I could check directly.

Thanks a lot!

+4
source share
2 answers

Go to chrome://inspect/ and you will see all the pages that can be checked. In the "Extensions" section, you can see your notification page, and you can check it.

Adding this answer for completeness, because @JJin's answer might have worked earlier, but not in Chrome versions 24 and 25.

+5
source

After some experimentation, I accidentally discovered that the developer tool is available for the notification page. Focus in

  • first run the notification window and save it;
  • go to chrome://extensions , and notification.html should appear next to background.html or any other name listed on the background page page,
    as shown in the screenshot:

enter image description here

Make sure the notification window is turned on, otherwise notification.html will disappear.

0
source

Source: https://habr.com/ru/post/1433706/


All Articles