feat(stealth): embeddable evasion init script with apply hints

This commit is contained in:
2026-06-07 13:20:55 +01:00
parent 6a70f6c9d5
commit d269c87b82
3 changed files with 89 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package stealth
import (
"strings"
"testing"
)
func TestStealthScript(t *testing.T) {
res := StealthScript(ScriptParams{Engine: "playwright"})
if res.Script == "" {
t.Fatal("empty script")
}
for _, want := range []string{"navigator.webdriver", "languages", "WebGL", "chrome"} {
if !strings.Contains(res.Script, want) {
t.Fatalf("script missing %q", want)
}
}
if res.Apply.How == "" || len(res.IncludedEvasions) == 0 {
t.Fatalf("missing apply metadata: %+v", res)
}
}