Skip to content

Commit

Permalink
protect spaces in native code signature from script compression
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dick committed Jun 7, 2024
1 parent 05f0325 commit f57b6d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Firefox/Marionette/Extension/Stealth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ _JS_

sub _native_code_body {
my ( $class, $to_browser_type ) = @_;
my $native_code_body = q[{] . q[\\] . 'n [native code]' . q[\\] . q[n}];
my $native_code_body =
q[{] . q[\\] . 'n\\x20\\x20\\x20\\x20[native code]' . q[\\] . q[n}];
if ( ( defined $to_browser_type ) && ( $to_browser_type eq 'chrome' ) ) {
$native_code_body = q[{ [native code] }];
}
Expand Down
2 changes: 1 addition & 1 deletion t/04-botd.t
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SKIP: {
if ($agent =~ /Chrome/smx) {
$correct_value = qq[function $property() { [native code] }];
} else {
$correct_value = qq[function $property() {\\n [native code]\\n}];
$correct_value = qq[function $property() {\\n [native code]\\n}];
}
ok($actual_values{$property}{$descriptor} eq $correct_value, "navigator.$property ($descriptor) = $correct_value:$actual_values{$property}{$descriptor}");
}
Expand Down

0 comments on commit f57b6d2

Please sign in to comment.