ulixee / unblocked

A suite of tools for protecting the web's open knowledge.
MIT License
130 stars 12 forks source link

Requests fail because browser emulator changes accept-language #57

Closed soundofspace closed 1 year ago

soundofspace commented 1 year ago

Unblocked changes accept-language, because headless chrome doesn't always fill this in correctly. This breaks some websites where they manually overwrite this header with something custom/they expect.

To fix this there are multiple options:

  1. Remove this overwrite. Seems like chrome is doing it correctly now, and Unblocked is not following chrome behaviour.
  2. Only overwrite this when needed. How to detect?
  3. Only overwrite if request !isXhr. Info is there but is that enough?
Data to suggest that chrome is doing it correctly now, tested using chrome 109: Locale set Hero with overwrite Headful Hero Headless Hero Native Chrome
nothing en-US,en;q=0.9 en-US,en;q=0.9 en-US,en;q=0.9 en-US,en;q=0.9
bg_BG bg_BG;q=0.9 bg_BG bg_BG bg
en-US en-US;q=0.9 en-US en-US en-US
en-US,en en-US,en;q=0.9 en-US,en;q=0.9 en-US,en;q=0.9 en-US,en;q=0.9