internetarchive / bookreader

The Internet Archive BookReader
https://openlibrary.org/dev/docs/bookreader
GNU Affero General Public License v3.0
976 stars 416 forks source link

mode/2up is ignored when rendering in iframe #1311

Open pbinkley opened 8 months ago

pbinkley commented 8 months ago

Description

I am attempting to display an item embedded in an iframe, and I want it to start in 2up mode. I have an embed url which works correctly outside an iframe, but when it is used inside an iframe, it opens in 1up mode.

Evidence / Screenshot (if possible)

See https://www.wallandbinkley.com/poet/ . The iframe uses this url: https://archive.org/embed/p-c-programme-uaa-1995-131-636-002-2-1/page/0/mode/2up?ui=embed , but within the iframe the item is displayed in 1up mode. If you visit that url directly, it is displayed in 2up.

Expectation

Within the iframe the item should be displayed in 2up mode.

Context

Should work in any browser. I have tested in Firefox, Chrome and Edge in Windows 11, Firefox in Ubuntu, and Firefox in Android. All open the item in 1up mode. I don't see a reason why BookReader should behave differently in the iframe than it does in page called directly.

Proposal & Constraints

Let me know if the syntax of my embed url is wrong - otherwise fix BookReader to respect mode/2up when embedded inside an iframe

Stakeholders