mirror of
https://github.com/lukaszraczylo/mcp-captcharesolver.git
synced 2026-10-14 00:57:55 +00:00
feat(stealth): embeddable evasion init script with apply hints
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user