Skip to main content

ruddocom.pdfiframer: correct handling of PDFs in IFRAMEs

This Plone add-on adds a bit of JavaScript that turns all served IFRAMEs which embed a PDF into a clickable icon the user must tap or click before the PDF is actually embedded and rendered. This behavior is only active on certain mobile browsers known not to display PDFs embedded.

This not only saves you bandwidth, it also prevents a nasty behavior on mobile devices when embedding PDFs using IFRAMEs — instead of the PDF being displayed, a download window pops up (yes, even when the server sends a Content-Disposition: inline HTTP header).

Thus, visitors to your site can see the PDF onscreen with one click, and mobile visitors can download the PDF by clicking / tapping on the icon.

Note that, by default, Plone filters IFRAME tags out of content types. Use the HTML filtering control panel configuration screen to allow IFRAMEs to be used on your Plone site.

Notes

We use a footer viewlet to include the JavaScript, because on mobile Fennec or Firefox Focus, the IFRAME has already begun loading and the download window pops up before the DOMContentLoaded event has happened.

Setup

It's a standard Plone add-on. Add to your Plone eggs list, buildout.

License

The project is licensed under the GPLv2 or later at your choice.

Metadata

Release files for ruddocom.pdfiframer 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ruddocom.pdfiframer 1.1
File Size Uploaded
ruddocom.pdfiframer-1.1.tar.gz 10.9 kB Details

Release files / ruddocom.pdfiframer-1.1.tar.gz

Download URL ruddocom.pdfiframer-1.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
59f47f6d3b6a94ab3345516a225969c6b4b45dd465e74dfb8a2f49ff9f6cd278
BLAKE2b-256 checksum
How to use checksums
f0ac56540042788430dc757ffe1bf2e5ec0888d13bb283aeef43640f9cf981e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.9

Release history Release notifications | RSS feed

This release

1.1 This release

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page