Skip to content

Commit 05e9fd5

Browse files
authored
fix: Set default adb host to 127.0.0.1 to prevent localhost resolution mismatch in nodejs 17 (#2360)
1 parent dbfc038 commit 05e9fd5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension-runners/firefox-android.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ const ignoredParams = {
5151
args: '--args',
5252
};
5353

54+
// Default adbHost to 127.0.0.1 to prevent issues with nodejs 17
55+
// (because if not specified adbkit may default to ipv6 while
56+
// adb may still only be listening on the ipv4 address),
57+
// see https://github.com/mozilla/web-ext/issues/2337.
58+
const DEFAULT_ADB_HOST = '127.0.0.1';
59+
5460
const getIgnoredParamsWarningsMessage = (optionName) => {
5561
return `The Firefox for Android target does not support ${optionName}`;
5662
};
@@ -120,7 +126,7 @@ export class FirefoxAndroidExtensionRunner {
120126
async run(): Promise<void> {
121127
const {
122128
adbBin,
123-
adbHost,
129+
adbHost = DEFAULT_ADB_HOST,
124130
adbPort,
125131
ADBUtils = DefaultADBUtils,
126132
} = this.params;

0 commit comments

Comments
 (0)