Folks, I just wanted to share a thought, what if we introduce a new window that can be brought forward or pushed to the back that retains an Iframe in a no refresh mode indefinitely?
This would allow iframes into other services to avoid the tiddlywiki refresh! You could call them no refresh tiddler windows, and allow a longer term consistent iframe. Regards Tony On Sunday, 6 September 2020 06:34:35 UTC+10, Eric Shulman wrote: > > On Saturday, September 5, 2020 at 12:17:05 PM UTC-7, Jan wrote: >> >> it's marvelous. Your instruction was perfect. (...and I see that I was >> not really awake this morning.) >> This is a great help to integrate external content into tiddlywiki, >> thanks a lot! >> > > Good to know it's working. > > One more suggestion: > > When I checked your latest test case at > https://www.szen.io/Kunstgeschichte/#FlexframeTest, it gave a RMOD (Red > Message of Death) to report an "Uncaught Security Error". This is due to > the fact that your test is attempting to modify a "cross-origin" IFrame > (with contents from wikipedia). As I noted in my instructions: > > ** IMPORTANT NOTE: the src="..." file must be from the *same domain* as >> your TiddlyWiki file because, for security reasons, modern browsers do not >> permit "cross-domain" access to the "document" object of another file.* > > > There's no way to make the code work for cross-origin references... but > you *can* suppress the error message by adding a try/catch wrapper around > the hook code, like this: > exports.startup = function() { > $tw.hooks.addHook("th-page-refreshed",function() { > setTimeout(function() { > try { > var iframes = document.querySelectorAll("iframe"); > for( var i = 0; i < iframes.length; i++) { > iframes[i].height = iframes[i].contentWindow.document.body. > scrollHeight; > } catch(e) { /* do nothing */; } > }, 1000); > }); > $tw.hooks.addHook("th-navigating",function(event) { > setTimeout(function() { > try { > var iframes = document.querySelectorAll("iframe"); > for( var i = 0; i < iframes.length; i++) { > iframes[i].height = iframes[i].contentWindow.document.body. > scrollHeight; > } catch(e) { /* do nothing */; } > }, 1000); > return event; > }); > }; > > Let me know how it goes... > > enjoy, > -e > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4a0510e5-5a4e-4735-99b6-2f12224a884do%40googlegroups.com.