sticky iframe?

289 views
Skip to first unread message

Dave Parker

unread,
Oct 2, 2009, 4:45:41 PM10/2/09
to TiddlyWiki
Good afternoon,

I use this code to view other files and directories and webpages from
my TW (NoteStorm)

<html><iframe name="content" src="Address Here" width=100%
height=600></iframe></html>


Sometimes when the iframe is rendered, the TW disappears and the page
is rendered in a wholly new firefox tab. I can get back to my TW by
pressing the back button, but I'd rather it just render right there in
the tiddler. If I've made changes and haven't saved them it'll ask me
if I really want to leave, and when I say no, the webpage renders in
the tiddler, but I don't want to perpetually operate with unsaved
changes to get the behavior I want.

Does anyone have a fix for this? (maybe its a firefox thing and not a
TW thing...)

Thanks,
DP

Eric Shulman

unread,
Oct 2, 2009, 5:29:10 PM10/2/09
to TiddlyWiki
> Sometimes when the iframe is rendered, the TW disappears and the page
> is rendered in a wholly new firefox tab.  I can get back to my TW by
> pressing the back button, but I'd rather it just render right there in
> the tiddler.  If I've made changes and haven't saved them it'll ask me
> if I really want to leave, and when I say no, the webpage renders in
> the tiddler, but I don't want to perpetually operate with unsaved
> changes to get the behavior I want.
>
> Does anyone have a fix for this?  (maybe its a firefox thing and not a
> TW thing...)

Actually, it's a "web page thing"... the particular page you are
viewing in the IFRAME almost certainly contains some "frame busting"
javascript code to force it to *not* be displayed inside an IFRAME
(some authors really don't like their pages being embedded on other
sites).

Normally, there is no way to defeat the "frame busting" code.
However, as you have discovered, if you have unsaved changes in your
TW document, then the "are you sure you want to leave" message is
triggered... and, pressing "cancel" from this dialog *does* block the
page transition, which usually leaves the target page displayed in the
IFRAME, as desired.

Of course, as you note, this isn't really a good solution, as you
would always have to edit some tiddler, just to enable the 'are you
sure' transition handling.

Fortunately, I've got a plugin (of course :-) that allows you to
enable the 'are you sure' trigger, without having to 'dirty' the
document first:
http://www.tiddlytools.com/#ConfirmExitPlugin

The plugin has an option checkbox:
<<option chkAlwaysConfirmExit>>
When installed, this setting is enabled by default, so that exiting
the document will always confirm before exiting, even if there are no
unsaved changes. Although this might be a bit of a nuisance when
simply closing the document normally, it *will* prevent external URLs
from escaping the confines of the IFRAME.

enjoy,
-e

cedardoc

unread,
Oct 2, 2009, 6:16:13 PM10/2/09
to TiddlyWiki
Thank you sir! as usual that works great.

live long and prosper.
DP
Reply all
Reply to author
Forward
0 new messages