Skip to content

Commit 9156832

Browse files
committed
fix: remove init script that blocks react scan from injecting in cli
1 parent 64d2046 commit 9156832

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

packages/scan/src/cli.mts

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -205,26 +205,6 @@ const init = async () => {
205205
const context = await browser.newContext(contextOptions);
206206
await applyStealthScripts(context);
207207

208-
await context.addInitScript({
209-
content: `(() => {
210-
const NO_OP = () => {};
211-
let i = 0;
212-
globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
213-
checkDCE: NO_OP,
214-
supportsFiber: true,
215-
renderers: new Map(),
216-
onScheduleFiberRoot: NO_OP,
217-
onCommitFiberRoot: NO_OP,
218-
onCommitFiberUnmount: NO_OP,
219-
inject(renderer) {
220-
const nextID = ++i;
221-
this.renderers.set(nextID, renderer);
222-
return nextID;
223-
},
224-
};
225-
})();`,
226-
});
227-
228208
const scriptContent = await fs.readFile(
229209
path.resolve(__dirname, './auto.global.js'),
230210
'utf8',
@@ -277,9 +257,9 @@ const init = async () => {
277257
if (interval) clearInterval(interval);
278258
currentURL = url;
279259
const truncatedURL = truncateString(url, 35);
280-
currentSpinner?.stop(`${truncatedURL}${count ? ` (×${count})` : ''}`);
281-
currentSpinner = spinner();
282-
currentSpinner.start(dim(`Scanning: ${truncatedURL}`));
260+
261+
// biome-ignore lint/suspicious/noConsole: <explanation>
262+
console.log(dim(`Scanning: ${truncatedURL}`));
283263
count = 0;
284264

285265
try {
@@ -302,7 +282,8 @@ const init = async () => {
302282
pollReport().catch(() => {});
303283
}, 1000);
304284
} catch {
305-
currentSpinner?.stop(red(`Error: ${truncatedURL}`));
285+
// biome-ignore lint/suspicious/noConsole: <explanation>
286+
console.log(red(`Error: ${truncatedURL}`));
306287
}
307288
};
308289

0 commit comments

Comments
 (0)