0

I have a stream, similar to the Twitter home feed, but without any JS. I'm using nested iframes (and nesting them further for every new post) and using a refresh header. This is the only way I found to support text browsers.

But for non-text browsers, how can I make the nested content follow my website's CSS?

My iframes:

<iframe src="/api/v1/get_new_posts?since=$TIME"></iframe>

Contents of /api/v1/get_new_posts, when empty, including Refresh header:

Refresh: 10

<html><head></head><body></body></html>

Contents when not empty (including Refresh header - or lack thereof):

<html><head></head><body>
<iframe src="/api/v1/get_new_posts?since=$TIME"></iframe>
<!-- post HTML -->
</body></html>
SoniEx2
  • 1,484
  • 1
  • 18
  • 35
  • Not sure what a nested iframe entials can you provide the code? – zer00ne Jun 05 '18 at 14:13
  • Possible duplicate of [How to apply CSS to iframe?](https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe) – Capricorn Jun 05 '18 at 14:25
  • @Capricorn that's JS, I don't want JS. – SoniEx2 Jun 05 '18 at 14:38
  • It's not possible without manipulating the iframe page content with JavaScript (https://stackoverflow.com/questions/19858217/how-to-apply-css-to-inner-iframe-element-through-parent-window-css-class). Why can't you just add the same style-link you're using in the parent window to the response from `api/v1/get_new_posts`? – Capricorn Jun 05 '18 at 14:42
  • I can, I was just trying to avoid it as then themes would be part of the API... – SoniEx2 Jun 05 '18 at 15:03

0 Answers0