mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.7k stars 10.02k forks source link

Mimic "Google Scholar PDF Reader" features #17921

Open 7vq opened 7 months ago

7vq commented 7 months ago

Chrome has a new "Google Scholar PDF Reader" extension for academic articles. The extension allows clicking in-text citations to show, in a popup: the cited article's title, full author list, and article summary. That avoids losing your reading place every time you want to see what paper a citation corresponds to. It also avoids having to manually copy, paste, search, and find each citation online to read the abstract. The extension also automatically adds a linked table of contents for the current PDF, even for PDFs without a built-in linked table of contents.

To convey how much people like these features: the extension was only released a few months ago and already has 100k users.

Could these features be added to pdf.js? (It sounds to me like Firefox wouldn't allow these features to be implemented as a Firefox extension?)

sylvestre commented 7 months ago

FYI, this Google extension is based on pdf.js

JasonSome commented 5 months ago

Any update/news on this pending feature?

marco-c commented 5 months ago

No news, and we have other things with higher priorities in our roadmap at the moment.

7vq commented 5 months ago

@JasonSome This bookmarklet gives a popup preview for internal links like figures and citations. The only issue is I haven't found a way to automate manually clicking/calling the bookmarklet on every PDF load.


Maybe that repository's code could be integrated into pdf.js?

Snuffleupagus commented 5 months ago

This bookmarklet gives a popup preview for internal links like figures and citations. The only issue is I haven't found a way to automate manually clicking/calling the bookmarklet on every PDF load.

Maybe that repository's code could be integrated into pdf.js?

I don't think so, since that code can end up trigger rendering a lot when just moving the mouse around which may hurt overall performance in many cases. This is made worse by the fact that there's no attempt, as far as I can tell, to actually cancel (and clean-up) properly once the preview is no longer needed.

7vq commented 5 months ago

I don't think so, since that code can end up trigger rendering a lot when just moving the mouse around which may hurt overall performance in many cases. This is made worse by the fact that there's no attempt, as far as I can tell, to actually cancel (and clean-up) properly once the preview is no longer needed.

Ah, fair enough. (For what it's worth, I haven't noticed any issues myself in years of usage. But obviously other people will have different usages, plus I might just be overlooking issues.)

salomepoulain commented 3 months ago

Any updates?

yuyuslab commented 1 month ago

Is Google Scholar PDF reader extension an open source project?? I'm thinking of adding annotation features somehow...

salcc commented 1 week ago

I've created a modified version of the Google Scholar PDF Reader extension that adds annotation capabilities while maintaining the core citation preview features: https://github.com/salcc/Scholar-PDF-Reader-with-Annotations. The extension is open source - feel free to use it or contribute!

Sorry for the slight off-topic reply, but I thought many people that come here just want these features (like me a few months ago)

yuyuslab commented 1 week ago

Wow, I will take a look soon!! Thank you a lot 😆

yuyuslab commented 1 week ago

I've just used the extension, and it works just fine!! thx for your work! I might create PR for a new feature later.