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

Safari: ProQuest translator same-origin processDocuments() is treated as cross-origin, loses cookies(?) #515

Open
AbeJellinek opened this issue Oct 25, 2024 · 1 comment

Comments

@AbeJellinek
Copy link
Member

AbeJellinek commented Oct 25, 2024

Reported: https://forums.zotero.org/discussion/comment/477452/#Comment_477452

ProQuest.js makes a processDocuments() request to grab the abstract page. ProQuest returns a login page ("Gain access through your school, library, or company"). Clicking the abstract link manually works fine, so ProQuest only thinks I'm not logged in when the request comes from the Connector's cross-origin request system. Makes me think that it's either not sending cookies or not routing through my SOCKS proxy. Connector cross-origin requests don't show up in the page's inspector panel, so I'm not sure how to figure out which it is.

I don't know much about the Safari Connector, but there's no obvious reason for this particular request to be processed as cross-origin, either - it's the same domain.

I haven't tried updating the translator to use async request methods.

@adomasven
Copy link
Member

adomasven commented Oct 28, 2024

The most straightforward way to troubleshoot this is to put a breakpoint at

let sameOriginRequestViaSafari = Zotero.isSafari && Zotero.HTTP.isSameOrigin(url) && !options.headers['User-Agent'];
.

You can open the background page for safari under Develop -> Macbook Air [computer name] -> Zotero Connector JSContext. To debug the swift part of the extension you need to build it in xcode. Either way, neither should be required for this, but putting it out there for posterity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants