Skip to content

Conversation

@Ankush1oo8
Copy link

** Fix for Issue #1311**

This PR ensures that the mode=2up setting is properly respected when the BookReader is embedded inside an iframe. Previously, the reader defaulted to 1up mode despite the URL containing mode=2up.

** Changes Made:**

✅ Updated BookReader.js to ensure that:

  • The mode is retrieved from the URL (mode=2up), or from localStorage if previously set.
  • Embedded readers (inside iframes) respect the mode=2up parameter.
  • Mode switching (1up, 2up, thumb) persists after refresh.
  • Navigation controls correctly update localStorage for mode preference.

🛠 Testing Done:

  • ✅ Opened BookReader inside an iframe → Confirmed it starts in 2up mode.
  • ✅ Changed modes (1up, 2up, thumb) → Refreshed page, mode persisted.
  • ✅ Verified fullscreen and non-embedded modes remain unaffected.
  • ✅ Tested in Chrome, Firefox, and Edge to confirm cross-browser compatibility.

** Steps to Reproduce & Test:**

  1. Embed the reader using:
    <iframe src="https://archive.org/embed/YOUR_ITEM_ID/page/0/mode/2up?ui=embed" width="800" height="600"></iframe>
  2. Load in a browser → It should start in 2up mode.
  3. Switch to 1up mode → Refresh the page → It should remember the last selected mode.
  4. Test outside an iframe (normal mode) → No unintended changes.

✅ Expected Outcome:

  • BookReader inside an iframe starts in 2up mode.
  • User-selected mode persists after page refresh.
  • No impact on normal (non-iframe) usage.

@Ankush1oo8
Copy link
Author

can any one check it

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

Successfully merging this pull request may close these issues.

1 participant