From 099ff8a09302f6490e30c21cc3cd1bd2ef8f5947 Mon Sep 17 00:00:00 2001 From: rope Date: Sat, 16 May 2026 12:10:05 +0100 Subject: [PATCH] code-server: patch Claude Code extension for Firefox CORS fix Adds a NixOS activation script that patches the crossorigin attribute onto the Claude Code extension's stylesheet link, fixing broken CSS in Firefox due to stricter CORS handling than Chrome. Co-Authored-By: Claude Sonnet 4.6 --- services/code-server.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/code-server.nix b/services/code-server.nix index 3dea158..37f64e3 100644 --- a/services/code-server.nix +++ b/services/code-server.nix @@ -23,5 +23,16 @@ # Make the claude CLI available in code-server's integrated terminal. environment.systemPackages = [ pkgs.claude-code ]; + + # Patch the Claude Code extension to add crossorigin="anonymous" to its + # stylesheet link — required for Firefox due to stricter CORS handling. + # Idempotent: sed won't match after the first apply. + system.activationScripts.claude-code-firefox-fix.text = '' + for f in /home/fred/.local/share/code-server/extensions/anthropic.claude-code-*/extension.js; do + [ -f "$f" ] && ${pkgs.gnused}/bin/sed -i \ + 's|||' \ + "$f" + done + ''; }; }