inital commit
This commit is contained in:
commit
ff15157fc0
3 changed files with 100 additions and 0 deletions
56
flake.nix
Normal file
56
flake.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
description = "Covert Firefox for the firefox-devtools MCP: navigator.webdriver always false";
|
||||
|
||||
inputs.nixpkgs.url = "nixpkgs";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
rec {
|
||||
# Firefox built from source with dom/base/Navigator.cpp patched so
|
||||
# Navigator::Webdriver() never reports automation. Marionette and
|
||||
# WebDriver BiDi keep working; only the JS-visible flag is false.
|
||||
firefox-covert = pkgs.wrapFirefox (
|
||||
pkgs.firefox-unwrapped.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [ ./navigator-webdriver-false.patch ];
|
||||
})
|
||||
) { };
|
||||
default = firefox-covert;
|
||||
}
|
||||
);
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
# Shell where `firefox` is the patched build. The firefox-devtools
|
||||
# MCP auto-detects its browser via PATH, so running it from here
|
||||
# picks up the covert build with no extra flags:
|
||||
# nix develop .#mcp --command npx -y @mozilla/firefox-devtools-mcp@latest --autoProfile
|
||||
mcp = pkgs.mkShellNoCC {
|
||||
packages = [
|
||||
self.packages.${system}.firefox-covert
|
||||
pkgs.nodejs
|
||||
];
|
||||
shellHook = ''
|
||||
echo "firefox-devtools MCP devshell: firefox -> $(command -v firefox)"
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue