How do i deactivate the default option to save in the personal desktop in chrome or Edge?

hi
i have tiddlywiki 5.3.5 in Github
it save in main folder with the Personal access token.
but i need it to save only in Github because every body in the web can save all tiddles in your personal desktop despite they are not autorized access.
how do i deactivate the default option to save in the personal desktop in chrome or Edge?

If save to GitHub is active, TW does not save anything locally. – I am not sure, what you question is.

yes. I can save in github.
But any other, in other pc, without personal token or any permission can write and attempt save with the save button.
This action download the full Tiddlywiki at the desktop of the this person.
I need deactivate this option please.

It doesn’t save anything. That save option is there but it will save the wiki to the users local machine not back to your GitHub repo. If i understand your question correctly. However you can hide the option to save…I have seen the functionality somewhere…I will look for it and come back to you. Take a look at this for starters ; How could I activate a "read-only" mode over "http://" or "https://" automatically? and Wikitext solution for hiding buttons/tabs ("read only") - contributions welcomed and no doubt there are countless other ways to disable / hide the functionality…If you wait i’m sure someone with more experience will chip in and you’ll have the answer to your problem…but these give you something to think about in the meantime :wink:

Thankyou dhjackal
very interesting your contribution about read only.

Yes the save button may be hidden but its easy to locate it.
As you say, “That save option is there but it will save the wiki to the users local machine”
It is exactly i want deactivate.

I found a module that can be the solution.

i dont know java Script.
Can you help me to disable this module
so that it does not save in local machine?

$:/core/modules/savers/download.js

/*\ title: $:/core/modules/savers/download.js type: application/javascript module-type: saver

Handles saving changes via HTML5’s download APIs

*/ (function(){

/*jslint node: true, browser: true */ /*global $tw: false */ “use strict”;

/* Select the appropriate saver module and set it up */ var DownloadSaver = function(wiki) { };

DownloadSaver.prototype.save = function(text,method,callback,options) { options = options || {}; Get the current filename var filename = options.variables.filename; if(!filename) { var p = document.location.pathname.lastIndexOf("/"); if(p !== -1) { We decode the pathname because document.location is URL encoded by the browser filename = $tw.utils.decodeURIComponentSafe(document.location.pathname.substr(p+1)); } } if(!filename) { filename = “tiddlywiki.html”; } Set up the link var link = document.createElement(“a”); if(Blob !== undefined) { var blob = new Blob([text], {type: “text/html”}); link.setAttribute(“href”, URL.createObjectURL(blob)); } else { link.setAttribute(“href”,“data:text/html,” + encodeURIComponent(text)); } link.setAttribute(“download”,filename); document.body.appendChild(link); link.click(); document.body.removeChild(link); Callback that we succeeded callback(null); return true; };

/* Information about this saver */ DownloadSaver.prototype.info = { name: “download”, priority: 100 };

Object.defineProperty(DownloadSaver.prototype.info, “capabilities”, { get: function() { var capabilities = [“save”, “download”]; if(($tw.wiki.getTextReference("$:/config/DownloadSaver/AutoSave") || “”).toLowerCase() === “yes”) { capabilities.push(“autosave”); } return capabilities; } });

/* Static method that returns true if this saver is capable of working */ exports.canSave = function(wiki) { return document.createElement(“a”).download !== undefined; };

/* Create an instance of this saver */ exports.create = function(wiki) { return new DownloadSaver(wiki); };

})();

Its not clear to me WHY you want to disable download saving (and I personally think it is a bad idea).

Nonetheless, you can give this a try:

  • edit $:/core/modules/savers/download.js and delete the module-type field.
    This disables the normal “HTML5 download saver”.
  • edit $:/core/modules/savers/manualdownload.js and delete the module-type field.
    This disables the fallback “manual download saver” modal message and download link.

Important note:
Once you have done this, no one, NOT EVEN YOU, will be able to save a local version of your TiddlyWiki.

To reverse this, you will need to:

  • view your GitHub-hosted TiddlyWiki
  • delete the two tiddlers you modified above. This restores the default “shadow” definitions.
  • save to github and reload after waiting for GitHub to re-deploy the updated file

-e

2 Likes