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

Chrome extension: Add options page #5619

Merged
merged 1 commit into from
Jan 14, 2015

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Jan 6, 2015

Fixes #4560

I've always wanted an options page, but there was little progress due to the lack of UI guidelines.
Starting with Chrome 40, extension options pages will be embedded at Chrome's settings page, which encourages the use of Chrome's UI styles. To view the options page on the current stable version of Chrome (39) with the new styles, start Chrome with the --enable-embedded-extension-options flag.

Screenshot:

pdfjs-crx-options

@timvandermeij
Copy link
Contributor

This looks really nice! I have tested this in Chrome 39 and I have made a list of issues I have found:

  • Can we add some spacing between the last option and the reset button?
  • Disabling 'Show previous position upon load' does not seem to work. The viewer will still go back to the original position for me.
  • Setting the zoom level dropdown to 400% makes the viewer display pages at 4%.
  • 'Sidebar state on load' does not appear to work. The sidebar always remains closed for me.

@Rob--W
Copy link
Member Author

Rob--W commented Jan 13, 2015

@timvandermeij

  • No, the spacing is already consistent with Chrome's styles. Here is a screenshot where the PDF.js options are displayed in the background, and Chrome's settings page semi-transparantly on top. Note that the checkboxes/buttons are spaced and aligned correctly:
    pdfjs-chrome-options-and-chrome-settings
  • I've debugged this issue, and it is not specific to the Chrome extension. It is caused by the fact that the history's state is preserved when the page is reloaded. The page size, etc. are persisted in history.state across reloads.
  • Fixed by multiplying the option values by 100.
  • Fixed by using parseInt.

timvandermeij added a commit that referenced this pull request Jan 14, 2015
Chrome extension: Add options page
@timvandermeij timvandermeij merged commit c7af070 into mozilla:master Jan 14, 2015
@timvandermeij
Copy link
Contributor

Awesome work! Tested and verified that my points were addressed. I will open a follow-up issue for the history state issue as it is not specific to this patch.

speedplane pushed a commit to speedplane/pdf.js that referenced this pull request Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement options page for setting default preferences in Chromium extension
2 participants