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 share PDF download when redirect shows captcha #868

Merged

Conversation

mvasilak
Copy link
Contributor

@mvasilak mvasilak commented Mar 5, 2024

Solves zotero/zotero#3526 for iOS

@mvasilak mvasilak self-assigned this Mar 5, 2024
@mvasilak mvasilak requested a review from michalrentka March 5, 2024 15:03
@michalrentka
Copy link
Contributor

@mvasilak is this completed? You're pretty much showing webview for all redirects. Based on zotero/zotero#3526 there are conditions to meet before we show the web view?

@mvasilak
Copy link
Contributor Author

mvasilak commented Mar 6, 2024

There is a guard just before to limit it for sciencedirect, which in zotero/zotero#3526 takes place in https://github.com/zotero/zotero/blob/ba86e9b4c92aea8818e50d96b04f905721f66162/chrome/content/zotero/xpcom/browserDownload.js#L178

The workflow is a bit different, as in iOS we handle a successful download where the file is not the expected PDF, while desktop handles an exception, but the end result is the same.

You are right though, we can improve by not showing the web view, even momentarily, when the redirect could work, as the cookie may be cached from a previous save. I'll make this improvement.

Is there any other point that you have noticed missing?

@michalrentka
Copy link
Contributor

Original ticket also mentions Matches the HiddenBrowser loaded HTML page for a captcha element., so I'd probably add that too so that we're on the same page.

@mvasilak mvasilak requested review from michalrentka and removed request for michalrentka March 6, 2024 13:34
@mvasilak
Copy link
Contributor Author

mvasilak commented Mar 6, 2024

@michalrentka ready for another look

@mvasilak mvasilak force-pushed the add-share-support-for-sciencedirect-captcha branch from 443ab05 to 9b028cc Compare March 8, 2024 00:40
@mvasilak mvasilak requested a review from michalrentka March 8, 2024 00:41
@mvasilak mvasilak merged commit 5eca99c into zotero:master Mar 8, 2024
1 check failed
@mvasilak mvasilak deleted the add-share-support-for-sciencedirect-captcha branch March 8, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants