Page 1 of 1

Noscript PDF file can't be loaded?!

Posted: Tue Sep 16, 2014 4:44 pm
by ReporterX
I'm trying to open this PDF in the browser but it fails to load.
I'm using PDF Viewer addon.
I can open other PDFs in other websites. They are all loading fine.
Is it just me? :cry: Or something wrong with this PDF?

Also Noscript asks me whether to allow pdf.js.
Should I allow it?
Thanks a lot. :)

Re: Noscript PDF file can't be loaded?!

Posted: Tue Sep 16, 2014 6:35 pm
by barbaz
pdfjs issue
Try this link?
(Personally I modify the pdfjs addon to work around this issue. So i don't remember if that's the right link or not.
I'll PM you the diff if you like, so that you can make yourself a modified version where you can simply go to the PDF and it will load.)
ReporterX wrote:Also Noscript asks me whether to allow pdf.js.
Should I allow it?
That is actually "resource://pdf.js" so even though it doesn't show up as Allowed in the menu, it is. No need to Allow it.

Re: Noscript PDF file can't be loaded?!

Posted: Tue Sep 16, 2014 11:11 pm
by ReporterX
barbaz wrote:pdfjs issue
Try this link?
Yes it works.
But if I open it in a new tab, it does not load (you get a blank page). You need to refresh to load it.
If I open in the current tab, it loads fine. :)
barbaz wrote:(Personally I modify the pdfjs addon to work around this issue. So i don't remember if that's the right link or not.
I'll PM you the diff if you like, so that you can make yourself a modified version where you can simply go to the PDF and it will load.)
Is it a modified xpi? If so, yes PM me.
I don't know how to patch a diff to the xpi.
barbaz wrote:That is actually "resource://pdf.js" so even though it doesn't show up as Allowed in the menu, it is. No need to Allow it.
Yes the PDF still loads without the permission.
But one issue now - it keeps asking me every time I open a PDF. It seems strange to set it as untrusted. :|
I think there is no harm to set it as allowed too (like in terms of potential security risks :twisted: ). Am I right?

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 12:00 am
by barbaz
ReporterX wrote:Is it a modified xpi? If so, yes PM me.
I don't know how to patch a diff to the xpi.
An XPI is just a zip file which has an install.rdf file on the top level of the archive, so in order to apply the diff, you would
1) extract the XPI (rename to .zip if needed) into its own directory
2) apply the diff to the files (I just do this step manually :? )
3) in the directory with install.rdf, select all, compress the selection as .zip, then change the .zip filename extension to .xpi

To install, drag&drop your XPI onto the browser window.

If you don't have an archive manager on your system, I've had good experience with 7-Zip, though it can be a little slow sometimes.
If any of that sounds too complicated for you, I can try to PM you a modified XPI, but that's a bit of a pain for me.
ReporterX wrote:
barbaz wrote:That is actually "resource://pdf.js" so even though it doesn't show up as Allowed in the menu, it is. No need to Allow it.
Yes the PDF still loads without the permission.
But one issue now - it keeps asking me every time I open a PDF. It seems strange to set it as untrusted. :|
I think there is no harm to set it as allowed too (like in terms of potential security risks :twisted: ). Am I right?
Don't set it as Untrusted as that will place additional restrictions on it that may take precedence over the whitelisted status and thus mess up the addon.
It won't hurt to Allow it unless you somehow access a site like "http://www.pdf.js/" and it's malicious...
(I haven't seen such a site yet, but I've never tried to type that in / go there)

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 1:31 am
by therube
URL: http://noscript.net/abe/abe_rules.pdf

> I'm using PDF Viewer addon.

Why?
It's now part of FF (32)?

> pdfjs issue

That's talking about Nightly, OP is on 32?
So 32 is affected, similarly.
Or is it actually a server issue?
And while the pdf link from github does work, Giorgio's server, what needs a patch to correct its issue?

> Try this link?

Yes, that works - after a page reload. Unexpected.
And #disableRange=true is mention in the github link.

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 1:45 am
by therube
Ah, is the real issue this, viewtopic.php?f=7&t=20064.
(And might that also account for some other recent "bugs"?)

IOW, disallow noscript.net & the abe_ruies.pdf loads, no trickery required.

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 1:57 am
by ReporterX
therube wrote:> I'm using PDF Viewer addon.

Why?
It's now part of FF (32)?
Yes I think so.
I have installed it for quite some time.
Maybe I should as well remove it.

therube wrote:> pdfjs issue

That's talking about Nightly, OP is on 32?
So 32 is affected, similarly.
Or is it actually a server issue?
And while the pdf link from github does work, Giorgio's server, what needs a patch to correct its issue?
I'm using Firefox 32.0.1 (stable version)

therube wrote: > Try this link?

Yes, that works - after a page reload. Unexpected.
And #disableRange=true is mention in the github link.
Yes it only works if I use #disableRange=true to load.

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 2:04 am
by ReporterX
therube wrote:Ah, is the real issue this, viewtopic.php?f=7&t=20064.
(And might that also account for some other recent "bugs"?)

IOW, disallow noscript.net & the abe_ruies.pdf loads, no trickery required.
No, it is not the cause.
I tried to test it in a fresh profile. The PDF still fails to load.
It seems to be either the server issue or the pdf.js bug.

Try hard refresh if you could load since it might just load from your cache.

P.S. I removed the PDF Viewer addon but it couldn't load PDF anymore.
I had to reinstall it. But my fresh profile could load PDF by default. Hmm... :?

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 2:20 am
by barbaz
therube wrote:> I'm using PDF Viewer addon.

Why?
It's now part of FF (32)?
I believe the version included in Fx release isn't the latest available version.
therube wrote:> pdfjs issue

That's talking about Nightly
...and it's a really old issue report from back when Gecko 26 was Nightly...
therube wrote:Or is it actually a server issue?
Yes, it is, but unlike the pdf.js team, I can't depend on other people's servers to work properly, especially considering that even Giorgio's server has this issue.
therube wrote:And while the pdf link from github does work, Giorgio's server, what needs a patch to correct its issue?
My mod to pdfjs isn't at all "necessary." It's just much more convenient, and makes me less likely to run into issues that aren't on my end.

@therube (and anyone else on this forum staff too): you also are welcome to have my mod to pdfjs, if you use pdfjs, and if you want. Note though that my mod is not useful to the pdfjs devs because IIRC (it's been a while) basically all I've done is flip an internal switch, and it seems from the issue report that I linked, that the pdf.js devs have no interest in doing the same.
therube wrote:Ah, is the real issue this, viewtopic.php?f=7&t=20064.
That topic was about a link which had a click listener that apparently caused NoScript to block left-clicking on it. The link I posted doesn't have any click listener...

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 2:41 am
by barbaz
@ReporterX: Sorry, I'm not clear on whether you think you can apply a diff using these instructions, or if I should upload a modified XPI somewhere for you to download? I'm willing to do either; just that if I upload the full XPI, you won't have it quite as quickly.

Re: Noscript PDF file can't be loaded?!

Posted: Wed Sep 17, 2014 2:55 am
by ReporterX
barbaz wrote:@ReporterX: Sorry, I'm not clear on whether you think you can apply a diff using these instructions, or if I should upload a modified XPI somewhere for you to download? I'm willing to do either; just that if I upload the full XPI, you won't have it quite as quickly.
An XPI would be better. I can wait. :)
Thank you in advance.

Re: Noscript PDF file can't be loaded?!

Posted: Mon Sep 29, 2014 11:54 pm
by barbaz
@ReporterX: FYI, if you haven't seen already, this issue has been officially fixed now https://github.com/mozilla/pdf.js/commi ... 8c87267fed
(Been testing those patches unofficially for some time, and it WFM)