# Git Time Logger – GitLab Plugin This JavaScript plugin is **injected into GitLab pages via reverse proxy** to add a "Log work" button for timesheet logging against an ERP system. ## How it works The reverse proxy serves `plugin.js` and `plugin.css` alongside GitLab's HTML. The script detects work item pages (issues, boards, merge requests) and renders a floating button that opens a modal for logging time entries. ## GitLab DOM dependency This plugin relies on specific GitLab DOM selectors and `data-*` attributes. **GitLab updates may break detection at any time.** When selectors break, the plugin logs warnings to the browser console: - `❌ GTL:` — critical: expected DOM structure missing - `⚠️ GTL:` — fallback used or selector not found Open DevTools (F12 → Console) and filter for `GTL:` to diagnose issues after a GitLab upgrade. ### Key selectors (as of GitLab 18.10) | Selector | Purpose | |---|---| | `body[data-page]` | Page type detection | | `body[data-project-full-path]` | Project path extraction | | `[data-testid="work-item-drawer-ref-link"]` | Work item drawer detection (boards/lists) | | URL pattern `/(work_items\|issues)/\d+` | Detail page detection |