channel-worker 1.6.9 → 1.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/nst-manager.js +7 -5
- package/package.json +1 -1
package/lib/nst-manager.js
CHANGED
|
@@ -126,10 +126,11 @@ class NstManager {
|
|
|
126
126
|
profileId = await this.ensureProfile(profileIdOrName);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// If already running,
|
|
129
|
+
// If already running, stop first then relaunch
|
|
130
130
|
if (await this.isProfileRunning(profileId)) {
|
|
131
|
-
console.log(`[nst] Profile ${profileId} already running —
|
|
132
|
-
|
|
131
|
+
console.log(`[nst] Profile ${profileId} already running — stopping first`);
|
|
132
|
+
await this.stopProfile(profileId);
|
|
133
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
// Update profile language to en-US (Custom) before launch
|
|
@@ -161,7 +162,8 @@ class NstManager {
|
|
|
161
162
|
// Pass proxy as URL string in connect config (Nstbrowser API format)
|
|
162
163
|
if (options.proxy) {
|
|
163
164
|
connectConfig.proxy = options.proxy;
|
|
164
|
-
|
|
165
|
+
connectConfig.args['--proxy-bypass-list'] = 'api.channel.tunasm.art,localhost,127.0.0.1';
|
|
166
|
+
console.log(`[nst] Proxy: ${options.proxy} (bypass: api.channel.tunasm.art)`);
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
if (options.extensionPath) {
|
|
@@ -189,7 +191,7 @@ class NstManager {
|
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
console.log(`[nst] Stopping browser for profile: ${profileId}`);
|
|
192
|
-
await this.api(`/browsers/${profileId}
|
|
194
|
+
await this.api(`/browsers/${profileId}`, { method: 'DELETE' });
|
|
193
195
|
console.log(`[nst] Browser stopped`);
|
|
194
196
|
}
|
|
195
197
|
|