tamper monkey script
Find a file
Forgejo Actions 3f3504bb0b Release v1.14
2026-10-25 21:52:39 +01:00
.forgejo/workflows Fix release workflow dropping beta's meta.js changes 2026-09-17 08:42:45 +02:00
src Release v1.14 2026-10-25 21:52:39 +01:00
.gitattributes Add .gitattributes for consistency with main 2026-09-16 13:19:26 +02:00
build.js Add a DNS History page to the CRM sidebar 2026-10-25 21:00:55 +01:00
README.md Add compact contracts view toggle 2026-09-22 20:26:18 +02:00
script.user.js Release v1.14 2026-10-25 21:52:39 +01:00

crm-helpers

Tampermonkey userscript with small quality-of-life helpers for the OneCRM web app (https://onecrm.g1i.one/*).

Features

  • Click to copy: contract IDs, contract title values (cluster or domain), customer number, customer number + name, email, phone number, mobile number.
  • Auto-linked fields: Business ID Norway links to Brønnøysundregistrene, contract clusters get a button row linking to Platform Tools, and invoice/customer numbers link into PayEx.
  • EFaktura -> EHF: a button that copies the Business ID Norway into the electronic invoice ID field and switches the invoicing type to EHF.
  • Compact contracts view: a toolbar toggle that collapses each contract (including nested add-ons) down to one line, hiding the price/term/start/notes details. Remembered across page reloads.

How to install

  1. Install the Tampermonkey browser extension (or another userscript manager that supports @updateURL/@downloadURL).

  2. Open this URL in your browser:

    https://git.ratlab.xyz/OfficeRat/crm-helpers/raw/branch/main/script.user.js
    

    Tampermonkey will intercept it and show an install prompt — review the script and click Install.

  3. Visit https://onecrm.g1i.one/ and the helpers should be active.

Because @updateURL/@downloadURL point at the main branch, the script checks for and installs updates automatically whenever a new version is released there.

To try the in-development version instead, install from the beta branch URL:

https://git.ratlab.xyz/OfficeRat/crm-helpers/raw/branch/beta/script.user.js

It's named Crm-helpers-beta in the Tampermonkey dashboard, so it can be installed side by side with the release version without conflicting.

Project structure

The deployed script must be a single file, since that's what Tampermonkey fetches. To keep it easy to work on, the source is split one function per file under src/, and build.js (plain Node, no dependencies) concatenates them into script.user.js:

src/
  meta.js          userscript header block
  *.js             one function (or closely related pair) per file
build.js            concatenates src/ into script.user.js

After editing anything in src/, rebuild with:

node build.js

Commit the regenerated script.user.js along with your source changes — it's the file Tampermonkey actually runs.

Branches and releases

  • beta — development branch. The userscript header on this branch is named Crm-helpers-beta, so it can be installed side by side with the release version for testing.
  • main — release branch, named Crm-helpers. This is what @updateURL/@downloadURL point at.

To ship what's on beta, run the Release beta to main workflow (.forgejo/workflows/release.yml) from the Actions tab. It's a manual (workflow_dispatch) workflow that takes a version input and:

  1. Merges beta into main (without deleting or otherwise touching beta).
  2. Renames the userscript from Crm-helpers-beta to Crm-helpers and sets @version to the value you entered.
  3. Rebuilds script.user.js.
  4. Commits, tags (vX.Y.Z), and pushes main.

It runs on a self-hosted runner (label selfhosted) and needs Node available on that runner.