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

Disable developer hash parameters by default #4954

Closed
yurydelendik opened this issue Jun 16, 2014 · 8 comments · Fixed by #4956
Closed

Disable developer hash parameters by default #4954

yurydelendik opened this issue Jun 16, 2014 · 8 comments · Fixed by #4956
Assignees
Milestone

Comments

@yurydelendik
Copy link
Contributor

We need to disable developers parameters for the generic or extensions builds. Pretty much all parameters at https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L1736 .

Also we need to add pdfBugEnabled to the preferences.

EDIT: it's just about not giving control to change those values via hash parameters -- api parameters will stay as is

@yurydelendik
Copy link
Contributor Author

See discussions at #4919 and #4949

@CodingFabian
Copy link
Contributor

a few comments here, because we bundle the viewer as a component in our application.

  • verbosity should then default to 0 - if it is a dev only param, i do not think that warnings should be shown to normal users (in fact i would like to even have a 'none' setting which could be used)
  • disableRange is a valid optimization if the embedded does not want to have range requests for some reason.
  • disableAutoFetch is a feature we really would like to keep accessible. Think of any mashed up web application that loads pdfs and displays them, for example in tile views etc. right now you could do iframes and use disableAutoFetch to control bandwith. if you would not use it all iframes would load all data, even though most of them are not navigated beyond page 1.

I know that I could patch them during my build, but those 3 make sense as regular options rather than pdfjs-developer options.
i am fine with moving them, but please leave them at least in :)

@Snuffleupagus
Copy link
Collaborator

@CodingFabian Why do you need to access the options through the hash parameters to achieve that though? You could (or even should) do either:

  • Change the default values in default_preferences.js.
  • Or add PDFJS.disableRange = true (and others as appropriate) to e.g. the top of viewer.js.

This issue isn't about removing any options, rather changing how they are accessed.
Since having them available as regular hash parameters means that a website could change how the viewer works, which is really bad and that was never intended functionality.

@yurydelendik
Copy link
Contributor Author

@CodingFabian the api settings will stay without changes. we just need to find a way to make them changable for the users of the pdf.js generic viewer -- configuring the viewer via hash parameter is not a good idea. It might be a good idea to keep the code disabled for development and diagnostics of the issues.

@Snuffleupagus
Copy link
Collaborator

Pretty much all parameters at https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L1736 .

@yurydelendik Does that mean that you want to keep some of them accessible still, or could we just place all of them inside a block like this:

//#if !PRODUCTION
...
//#endif

@yurydelendik
Copy link
Contributor Author

it will be nice to have them handy when pdfBugEnabled is set to true (similar to pdfBug hash tag control)

@Snuffleupagus
Copy link
Collaborator

Sure, sounds like a great idea!
(I've started working on this, so I'm assigning the issue to myself.)

@CodingFabian
Copy link
Contributor

ok, if it is just about the hash params, I am fine - I just wanted to point out that the parameters are not all equal, right? for example you do have locale as regular parameter. and maybe disableAutoFetch should be one as well?
What about my comment on the default verbosity? is warning there to stay?

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

Successfully merging a pull request may close this issue.

3 participants