Close the current window?

77 views
Skip to first unread message

Mat

unread,
Jul 21, 2020, 6:35:50 AM7/21/20
to TiddlyWiki
The tiddler tool "Open in new window" uses tm-open-window to show the tid in a separate window.
I'm making a little toolbar menu inside the window and want a close tiddler button there, i.e really a close window button.
How can this be done? Is there some action or message to close the current window?

Thank you!

<:-)

Saq Imtiaz

unread,
Jul 21, 2020, 8:31:29 AM7/21/20
to TiddlyWiki
Try
<a href="self.close ()">Close</a>

or
<a href="window.close ()">Close</a>

TW Tones

unread,
Jul 21, 2020, 9:18:50 AM7/21/20
to TiddlyWiki
Saq,

Both return a 404 in Chrome and FireFox.

Regards
Tony
Message has been deleted

Eric Shulman

unread,
Jul 21, 2020, 9:34:13 AM7/21/20
to TiddlyWiki
On Tuesday, July 21, 2020 at 5:31:29 AM UTC-7, Saq Imtiaz wrote:
Try
<a href="self.close ()">Close</a>
or
<a href="window.close ()">Close</a>


That should be:
<a href="javascript:self.close ()">Close</a>

or
<a href="javascript:window.close ()">Close</a>

-e

Mat

unread,
Jul 21, 2020, 9:40:23 AM7/21/20
to TiddlyWiki
Thank you guys! Erics solution works, excellent. 

<:-)

TW Tones

unread,
Jul 21, 2020, 9:43:14 AM7/21/20
to TiddlyWiki
Eric,

Both worked as advertised and do not close the main tab if used there in (fortunatly)

Regards
Tony

Saq Imtiaz

unread,
Jul 21, 2020, 10:23:17 AM7/21/20
to TiddlyWiki
Right! Thanks for correcting Eric, that's what I get for rushing.

Jeremy Ruston

unread,
Jul 21, 2020, 11:56:28 AM7/21/20
to tiddl...@googlegroups.com
Cunning stuff, but it also reminds me that the core should really be suppressing links to javascript: URIs. In this case, we should add a “tm-close-window” message of course.

Best wishes

JEremy

> On 21 Jul 2020, at 15:23, Saq Imtiaz <saq.i...@gmail.com> wrote:
>
> Right! Thanks for correcting Eric, that's what I get for rushing.
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4c0900de-f755-4aa0-b6de-79b58910c81fo%40googlegroups.com.

TiddlyTweeter

unread,
Jul 21, 2020, 2:01:33 PM7/21/20
to TiddlyWiki
Jeremy Ruston wrote:
Cunning stuff, but it also reminds me that the core should really be suppressing links to javascript: URIs. In this case, we should add a “tm-close-window” message of course. 
 
Right!

It surprised me it worked!

As far as I understand it, Mother can create and close windows. 
But spawned child won't be able to kill herself via button, only Mother can do that???

Best wishes
TT

TW Tones

unread,
Jul 21, 2020, 7:59:17 PM7/21/20
to TiddlyWiki
Jeremy,

If I may share a view on this, I do not mean to tell you something you know, but restate the need for openness, even while filling potential security gaps. I am seeking agreement or discussion.


On Wednesday, July 22, 2020 at 1:56:28 AM UTC+10, Jeremy Ruston wrote:
Cunning stuff, but it also reminds me that the core should really be suppressing links to javascript: URIs. In this case, we should add a “tm-close-window” message of course.

It is a good idea to remove identified gaps such as this and provide a de jure method. 

What you say may be best practice and would be worthy of a default behaviour, especially when a tiddlywiki is internet facing, however please consider that Tiddlywikis versatility allows for many applications, I for one have a set of them running on my local machine, that only I can access and I use for desktop interaction and to take full control of my browser and desktop. In this case I am not keen to have restrictions imposed, restrictions that may be necessary for the "filthy internet", impact the local functionality/versatility.

Other applications of tiddlywiki can take place in a secure LAN from local servers, apart from the fact such devices may already be hack-able on many levels, this can be a semi or wholly trusted environment. An example may be once a user logs in and has access to tiddlywiki, such as on a Raspberry Pi they may be keen to interact with the device hardware.

The javascript uri function is used with bookmarks as well, and I make use of only a few so far, but they are a big productivity gain.

I believe decisions already taken for robustness in the face of the internet have impacted the versatility off line, this includes lost opportunities for example I would like to freely save files locally without direct user involvement for automation. 

Best wishes
Tony
Reply all
Reply to author
Forward
0 new messages