• How To Teach Toggl To Find Issue Trackers at Custom URLs

    A burgundy desk clock beside a blue home server in a sunlit office

    Current documentation: custom domains and Toggl Track browser extension support.

    There is a wonderful service called Toggl that lets you track time across different issue trackers, or without any trackers at all. Unfortunately, the Google Chrome extension that adds automatic buttons to tracker issues does not work everywhere you would like. For example, it will work if you buy Jira in the cloud (*.atlassian.net), but it will not lift a finger if you have Jira on your own server (jira.*.com). No matter, there is a way out, and it is quite simple.

    bash
    git clone https://github.com/toggl/toggl-button
    cd toggl-button
    nano src/manifest.json

    In the old manifest, add the domains to permissions and content_scripts (fragment; ... marks omitted sections):

    json
    ...
    "permissions": [
        "tabs",
        ...
        "*://myawesomeredmine.com/*",
        "*://jira.myawesomesite.com/*"
      ],
    ...
    "content_scripts": [
        {
          "matches": [
            ...
            "*://myawesomeredmine.com/*",
            "*://jira.myawesomesite.com/*"
          ],
          ...
        },
        ...
        {
          "matches": ["*://myawesomeredmine.com/*"],
          "js": ["scripts/content/redmine.js"]
        },
        {
          "matches": ["*://jira.myawesomesite.com/*"],
          "js": ["scripts/content/jira.js"]
        }
      ]
    ...

    That is enough. The resulting version can be installed directly unpacked, in developer mode, or packed and installed in the usual way.