Skip to content

Debug the extension

yayuyokitano edited this page Jan 10, 2024 · 29 revisions

Introduction

In case something goes wrong and the extension is not working as you expect it to do, you will be asked for some logs.

First, you should reproduce an issue you're experiencing. It's important to reproduce the issue before copying logs.

The basic actions to get proper logs:

  1. If you have been asked to provide content script logs, click "Enable debug logging" as follows:
Screenshot 2023-01-10 at 21 56 28
  1. Close the browser and launch it again.
  2. If you have been asked to provide background script/service worker logs, open the background script/service worker console as described for your browser below. (This script will be called background script or service worker depending on which browser you use. They are the same thing.)
  3. Reproduce the issue.
  4. Get debug logs and post them.

Make sure not to open other (non-related to the issue) tabs to avoid adding unnecessary information in logs.

If you have an issue related to UI (e.g. you can't sign in to a scrobbling service), check the Logs of the options page section.

Otherwise, please read the Logs of content scripts section.

In all cases please provide logs of the background script. Follow the Logs of the background script section for details.

Providing debug logs

Please do not paste logs in a GitHub comment body directly; use a pastebin service instead (e.g. this one). As an option, you can use details tag to make collapsible code block:

<details>
  <summary>Debug log</summary>
  Here is the content of debug log: ``` Paste debug log here. ```
</details>

Example of collapsible debug log

Debug log Here is the content of debug log:
chrome.storage.Core = {
  "appVersion": "2.16.3"
}
Bind Last.fm scrobbler
Unable to bind Libre.fm
Unable to bind ListenBrainz

Logs of the background script

How to get logs on Chrome

  1. Open the "Extensions" page (chrome://extensions/) in the browser and turn on the "Developer mode".
  2. Look for "Web Scrobbler" and click on the "service worker" or "service worker (inactive)" link.

image

  1. Select the "Console" tab in the opened window. There are debug logs of the extension.

Imgur

How to get logs on Firefox

  1. Click on the hamburger icon and select the "Add-ons" menu item.
  2. Click on the cog icon and select the "Debug Add-ons" item.

Imgur

  1. Look for the "Web Scrobbler" entry, then click on "Inspect" button.

image

How to get logs on Safari

  1. Enable Developer menu (See the first step of Install as unsigned extension if you don't already have it enabled).
  2. Click Develop > Web Extension Background Pages > Web Scrobbler
image

Logs of content scripts

Sometimes there's something wrong with the code that communicates with the web service directly. To understand the problem we also need logs of web page. You can collect them by using the following HOWTO:

  1. Press Ctrl+Shift+I when you're on the web page. (Cmd+Option+I on macOS.)
  2. Select "Console" tab.

Copy all these logs and post them too.

Logs of the options page

If you can't authenticate via the "Sign in" link in the options page, or have issues with the extension options, please provide the options page logs:

  1. Open the options page.
  2. Expand "Accounts" section, sign out and sign in to your account(s).
  3. Press Ctrl+Shift+C combination. (Cmd+Shift+C on macOS.)
  4. Select "Console" tab and copy all logs.