[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fetch): Add capacity to change UA string #634

Merged
merged 7 commits into from
May 14, 2023

Conversation

Rojikku
Copy link
@Rojikku Rojikku commented May 13, 2023

Improves on Fetch.ts

  1. Adjusted UA string to my UA string on my Pixel5A running Android 13. User Agents have become more obscured and generic, so having a very specific UA string will start to stand out.
  2. Implemented the capacity to specify a unique user agent string, or remove it entirely. Now done by switching line order and adding comments.

Why, you ask, would I want to remove a user agent string? Because if there's no UA string you can get the page without lazy loading images, which can potentially make or break pulling images. Sure, I can just use a raw fetch, but that doesn't have cloudflare bypass. (Specifically for ReaperScans)
This is the best of both worlds, while still functioning as expected with existing scripts.

Theoretically fixes LNReader/lnreader-plugins#473 but webview crashes my emulator.
Did several test loads to see if I saw any unexpected errors produced by this conversion, but wasn't able to find any.

Good news: Throws proper errors when cloudflare can't be bypassed instead of giving broke chapters
Bad news: I don't think it's getting the cookie for the bypass.

@Rojikku Rojikku marked this pull request as draft May 13, 2023 14:36
@Rojikku Rojikku marked this pull request as ready for review May 13, 2023 15:43
@Rojikku Rojikku marked this pull request as draft May 13, 2023 15:47
@Rojikku Rojikku marked this pull request as ready for review May 13, 2023 16:06
@rajarsheechatterjee rajarsheechatterjee merged commit ea82742 into LNReader:main May 14, 2023
@Rojikku Rojikku deleted the fetch branch May 14, 2023 19:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Enable javascript and cookies to continue" instead of text
2 participants