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

Is a static site necessary? #1

Open
j3soon opened this issue Jan 1, 2023 · 1 comment
Open

Is a static site necessary? #1

j3soon opened this issue Jan 1, 2023 · 1 comment

Comments

@j3soon
Copy link
Owner

j3soon commented Jan 1, 2023

As mentioned by @cipri-tom in j3soon/arxiv-utils#2 (2020), the PDF container hack used in arxiv-utils may be used as a general workaround for the Firefox issue: content_scripts won't load with pdf.js tabs (2018).

We may implement this addon to intercept all PDF pages and redirect to a local PDF container. However, other addons will not work in the container page, since the container's URL start with moz-extension://* (verified using arxiv-utils + ScrollAnywhere). Another solution is to redirect to a PDF container hosted as a static site (maybe a html page in this repo deployed by GitHub pages).

Although I believe using an external static site will work, it will be better if it is possible to somehow allow other addons' content_scripts to run in our local PDF container (with URL format: moz-extension://*).

I may investigate the possibility of addon interoperability sometime in the future. If it isn't possible, we can simply fallback to the original plan (i.e., using a static site).

@cipri-tom
Copy link

cipri-tom commented Jan 3, 2023

Thank you for considering this !

It would be great if this is possible ! IMO, a static site seems to be the only option so far, but it would be nice to have interop on web extensions. Probably several developments would be necessary for this to be achieved, looking at the linked bug to Support content handlers in WebExtensions, where Rob mentions:

This design was chosen to minimize the impact of code execution vulnerabilities in content handlers, and to support the ability to allow other extensions to run code in the page (e.g. accessibility, translations, ...).

And this would solve pdf content-scripts.

My worry with a static website is that someone would have to foot the bill for all the serving, and pdf.js is not small (15 Mb with maps, 7.3 Mb without maps).


Edit: the static website already exists: https://mozilla.github.io/pdf.js/web/viewer.html . We can pass it the ?file=... parameter: https://mozilla.github.io/pdf.js/web/viewer.html?file=https://arxiv.org/pdf/2004.07606.pdf and it works.

So, do we just redirect all pdf.js to mozilla's github site ? ... We should probably ask them

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

No branches or pull requests

2 participants