How to prevent "This page is asking you to confirm that you want to leave - data you have entered may not be saved" ?

86 views
Skip to first unread message

Lin Onetwo

unread,
Apr 11, 2020, 11:14:06 AM4/11/20
to TiddlyWiki
I've set up a wiki in now.sh , only for viewing, not expect for online editing.

But everytime I open https://wiki.onetwo.ren/ and scroll for a while, and try to close the window, it tells me there is something changed and don't want me go. In fact I haven't change anything.

How to debug what tiddler have changed?

Or is there a way to disable saver when I package nodejs wiki to html wiki using tiddlywiki cli?

I'm also curious why https://tiddlywiki.com/ don't have a red "saver" icon when I open it, but my wiki does...

I guess it might be tiddlymap updating tmap.id ...

Lin Onetwo

unread,
Apr 11, 2020, 11:19:29 AM4/11/20
to tiddl...@googlegroups.com

Screen Shot 2020-04-11 at 11.17.43 PM.png

Oh I figure out, it is tiddlymap...It is updating node id in the browser, just after my last deployment. So it will update the wiki, causing saver icon to be red.

Sometimes it needs to update the node id. I should wait it finish the update before I submit a website deployment.

在 2020年4月11日星期六 UTC+8下午11:14:06,Lin Onetwo写道:

TonyM

unread,
Apr 11, 2020, 8:49:43 PM4/11/20
to TiddlyWiki
Lin

In the most recent releases there is a save filter that determines when to activate autosave or the dirty indicator which says save is necessary and what to save.

See $:/core/save/all

The trick will be to change this then save before publishing. I thing an independent save method will be needed so you can save or export a copy of the wiki without the save settings you change.

Regards
Tont

Lin Onetwo

unread,
Apr 14, 2020, 11:40:52 AM4/14/20
to tiddl...@googlegroups.com

Hi Tony, that seems not working, may due to the fact that I'm using SyncAdaptor instead of Syncer.

I finally made a plugin to prevent that popup:


{
  "title": "$:/plugins/linonetwo/prevent-pop-up",
  "description": "Prevent \"This page is asking you to confirm that you want to leave\" in a read-only site",
  "author": "Lin Onetwo",
  "core-version": ">=5.0.0"
}

preventPopUp.js.tid:

created: 20200414150455988
creator: LinOnetwo
module-type: startup
title: preventPopUp.js
type: application/javascript

exports.startup = function() {
$tw.unloadTasks = $tw.unloadTasks.filter(task => !task.toString().includes('confirmationMessage'));
}



---

And add it to plugins:

"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/highlight",
"sitemap",
"prevent-pop-up"
],

Then it works...
Reply all
Reply to author
Forward
0 new messages