inital commit
This commit is contained in:
commit
ff15157fc0
3 changed files with 100 additions and 0 deletions
24
flake.lock
generated
Normal file
24
flake.lock
generated
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1790769526,
|
||||
"narHash": "sha256-6j4yqqBUvIbBn29k0y/2jqlv/YJd8CRkTBYhfm5Z/8c=",
|
||||
"rev": "c9fe7d12cd78d1adcd12dd15e24432dde5b155a0",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1082837.c9fe7d12cd78/nixexprs.tar.zst"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
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)"
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
20
navigator-webdriver-false.patch
Normal file
20
navigator-webdriver-false.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
--- a/dom/base/Navigator.cpp
|
||||
+++ b/dom/base/Navigator.cpp
|
||||
@@ -2356,7 +2356,7 @@
|
||||
bool isBrowserAutomationRunning = false;
|
||||
marionette->GetIsBrowserAutomationRunning(&isBrowserAutomationRunning);
|
||||
if (isBrowserAutomationRunning) {
|
||||
- return true;
|
||||
+ return false; // firefox-covert: never report automation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2365,7 +2365,7 @@
|
||||
bool isBrowserAutomationRunning = false;
|
||||
agent->GetIsBrowserAutomationRunning(&isBrowserAutomationRunning);
|
||||
if (isBrowserAutomationRunning) {
|
||||
- return true;
|
||||
+ return false; // firefox-covert: never report automation
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue