question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open iframe content external link correctly on android

See original GitHub issue

Home Assistant Android version: Latest beta version of Home Assistant App.

Android version: 12

Phone model: Samsung Galaxy S10

Home Assistant version: 2022.11.1

Last working Home Assistant release (if known):

Description of problem: I use HomeAssistant with a card of type iframe to display my TV guide in a tab in a board. Here is the configuration of the card :

type: iframe
url: https://www.programme-television.org/?no_layout=
aspect_ratio: 50%

It works great to display the TV guide on the browser and the android app.

But if I clic on a link of the page, in the android app, nothing happens. In the browser, the link is displayed in a new tab.

What would be great for the android app, I see two options :

  • open the content in the homeassistant app replacing the content of the iframe.
  • open the content in the android default browser, as in the desktop version.

I would prefer the option one but there may be some technical elements in the good solution.

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):


Screenshot of problem: Nothing to show. The problem is easy to reproduce.

Additional information: N/A.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jpelgromcommented, Nov 8, 2022

Not mixed content related, I get a similar error when loading my server with https

1reaction
jpelgromcommented, Nov 8, 2022

Testing with the provided iframe URL shows the following console error for me:

Unsafe attempt to initiate navigation for frame with URL 'http://ha/iframe-test/0' from frame with URL 'https://www.programme-television.org/?no_layout='. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.

Which, if I understand it correctly, is an intentional security feature, so I’m not sure why it behaves differently when using a browser. Maybe it is still allowed because it expects there to be a address bar/navigation UI in the browser but not when using a webview?

Read more comments on GitHub >

github_iconTop Results From Across the Web

iFrames not loading on mobile or tablet - Stack Overflow
I think the android and iphone browsers work the same way as Firefox, and if a secure site is trying to show mixed...
Read more >
Making Embedded Content Work In A Responsive iFrame
This iframe enables external content to be displayed on your website, because it includes a URL that points to the source of the...
Read more >
Iframe not loading in HTML - CodeProject
Dear Friend,. The reason why external websites such as: 1. youtube.com 2. google.com 3. stackoverflow.com etc. are not loading in your frame ...
Read more >
WebView - Android Developers
WebView objects allow you to display web content as part of your activity layout, but lack some of the features of fully-developed browsers....
Read more >
Same-origin policy - Web security | MDN
CSS applied with <link rel="stylesheet" href="…"> . Due to the relaxed syntax rules of CSS, cross-origin CSS requires a correct Content-Type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found