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 <noreply@anthropic.com>
This commit is contained in:
parent
9d5a2b43f1
commit
099ff8a093
1 changed files with 11 additions and 0 deletions
|
|
@ -23,5 +23,16 @@
|
||||||
|
|
||||||
# Make the claude CLI available in code-server's integrated terminal.
|
# Make the claude CLI available in code-server's integrated terminal.
|
||||||
environment.systemPackages = [ pkgs.claude-code ];
|
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|<link href="${q}" rel="stylesheet">|<link href="${q}" rel="stylesheet" crossorigin="anonymous">|' \
|
||||||
|
"$f"
|
||||||
|
done
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue