huggingface / chat-ui

Open source codebase powering the HuggingChat app
https://huggingface.co/chat
Apache License 2.0
6.73k stars 940 forks source link

Option to turn on/off playwright (adblocker). #1298

Open calycekr opened 1 week ago

calycekr commented 1 week ago

There are many problems due to playwright in offline environment. I have to wait for playwright fetch timeout before the application is fully loaded.

ERROR (1399872): Failed to initialize PlaywrightBlocker from prebuilt lists

I need an option to turn it on and off. Please add an option to turn it off, not to deal with errors.

nsarrazin commented 1 week ago

Makes a lot of sense to me! Let me know if someone wants to tackle this, I think putting an env variable PLAYWRIGHT_ADBLOCK=true by default in the .env which could be set to false should work.

krakenftw commented 1 week ago

can i work on this? @nsarrazin

nsarrazin commented 5 days ago

Sure thing @krakenftw

krakenftw commented 5 days ago

Just the confirm we need to be able toggle the playwright-adblocker?

nsarrazin commented 5 days ago

Just using an env variable in .env yes

calycekr commented 2 days ago

@krakenftw const blocker = await PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch) at 13 line The part that causes unnecessary timeouts is here.

krakenftw commented 1 day ago

@calycekr Yeah, i did add a boolean env, and disabling blocker based on that env. It has'nt been merged yet tho. Hoping a response from @nsarrazin