Skip to content

background-iframe backup option #1074

Open

Description

@maxpel

It's a minor issue, but I was wondering if there is a way to define a static picture (png or svg) as a fallback option for an iframe in a reveal.js presentation? Sometimes it could be that some external policy is blocking the loading of the iframe and it would be nice to have something instead on the slide then. My use case would be displaying my personal webpage at the end of the presentation (with an iframe it would always show the up-to-date version).

{background-iframe="https://page.com/"}

Activity

  1. cderv commented on Jun 6, 2022

    @cderv
    Member

    I don't think there is a built in option in revealjs to do that. There is one feature request for something like it in order to have a fallback image on print: hakimel/reveal.js#2795

    Maybe you could add such feature in your presentation using JS by changing the <iframe> to an <img> on some conditions ?
    some custom JS can be added using revealjs hooks, or bare JS and setting includes

    Also from https://dev.w3.org/html5/pf-summary/embedded-content-0.html

    An iframe element never has fallback content, as it will always create a nested browsing context, regardless of whether the specified initial contents are successfully used.

    so that is not something built in spec a fallback for iframe

    if there is an easy way to do this, we could try adding, but blocking policy cannot really be detected at build time, and only run time (hence a JS solution in browser)

  2. maxpel commented on Jun 6, 2022

    @maxpel
    Author

    thanks for the fast answer and the useful information!
    I guess something along the lines of these solutions could work in that case: https://stackoverflow.com/questions/24529625/how-to-check-if-iframe-is-visible-on-page-using-jquery

  3. added this to the Future milestone on Jun 7, 2022
  4. added
    enhancement
    revealjs
    on Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrevealjs

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions