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

ReferenceError: getUrlParameter is not defined when trying to open Epub/cbz in Palemoon. #38

Closed
e-alfred opened this issue Mar 22, 2017 · 8 comments

Comments

@e-alfred
Copy link

e-alfred commented Mar 22, 2017

Hello,

if I try to open an Epub or cbz file, I can only see a white page and the hidden controls on the top. In the error console, I get this error message shown:

ReferenceError: getUrlParameter is not defined ready.js:5:12

The browser is Palemoon 27.1.2.

@Yetangitu
Copy link
Owner

Yetangitu commented Mar 24, 2017

Are you running the latest version? That function is defined in js/ready.js:105 and should be 'hoisted' up by the JS engine. It Palemooon does not, Palemoon has problems.

As a temporary solution you can try to move it up in the file so it sits at the beginning, or even move it out of the onreadystatechange() function. A modified version is attached to this post, try it (after removing the '.txt' extension which I had to add to be allowed to attach it).

ready.js.txt

@e-alfred
Copy link
Author

I updated to 27.2.1 and the problem still existed. Then I used your ready.js file, but additionally I had to move renderCBR and renderEPUB to the top as well. Now both *.ebub and *.cbr files are rendered flawlessly using Palemoon.

Also I like the fact that Comic books are now rendered with this awesome app. It helps me to deprecate another unmaintained plugin I used for this purpose that I got to run on OC 9 with some heavy tweaking.

@Yetangitu
Copy link
Owner

Still... strange that it did not work with those functions in the position they are in the distribution. It should work, but it doesn't. Palemoon is based on Gecko - which they call Goanna - and Gecko knows how to hoist functions. I'll download Palemoon and see what's up.

@Yetangitu
Copy link
Owner

Yetangitu commented Mar 24, 2017

OK, just downloaded Palemoon (27.2.1/Linux) and confirmed it does not hoist those functions, a clear bug on the side of Palemoon - and a strange one.. I'll move the declarations down one level in the next release, this does work in Palemoon.

BTW, the next version will support PDF, yet another app which can be replaced...

@Yetangitu
Copy link
Owner

The next (upcoming) version will contain this fix, but it also contains a new version of the bitjs unarchiver which happens to use ES6 classes... which are not supported by Palemoon...

This is a pity as that new version of bitjs brings much needed compatibility improvements with CBR. Since Palemoon does not seem to be on the verge of supporting ES6 I'm afraid you'll have to use a different browser for accessing Reader, at least until they've decided to move to a more up-to-date JS engine (see https://github.com/MoonchildProductions/Pale-Moon/issues/978 for some context on this)

@e-alfred
Copy link
Author

e-alfred commented Apr 10, 2017

Hello,

updated to 1.0.4, and now I am getting this error in the console:

ReferenceError: bitjs is not defined cbr.js:76:8

It loads the packed *.cbr, but then stops at this error. Before this error, another one occurs, but as you said this is probably because of lacking ES6 support in Palemoon:

SyntaxError: class is a reserved identifier archive.js:17:31

@Yetangitu
Copy link
Owner

Yes, unfortunately this is the case. The newer bitjs uses classes, I checked whether it was feasible to 'de-classify' the code but decided the effort was not worth the small gain. The new version of bitjs has much improved RAR-support and as such deals with the loading problems Reader had with some CBR archives. You can rip out the new bitjs and replace it with the version used in earlier versions and maintain a fork for Palemoon-users. You will not get the better RAR-support that way, but lackluster support is better than no support at all...

Or... you use another browser for Reader. Annoying, I agree, but the problems you encounter with Reader will not be the end of what you'll have to cope with when using a browser which does not support 'fashionable' JS-features.

@e-alfred
Copy link
Author

This is fixed with Pale Moon 28 which is based on the new UXP platform (which is a fork of Firefox ESR 52).

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