There are only 3 things that are essential for browsers.
1) security
2) security.
3) security!
Most browser vendors consider an "active" write from a web page to the harddisk as a security risk.
Most vendors consider an active write from an file:// URI as a security risk too!
So they don't let us do this. period.
------- more detailed info ------------
A browser basically is a sandbox, that lets us (the users) execute untrusted code, from potentially evil sites, on our private computers, with a lot of private stuff on it.
In favour of security, it is essential, that browsers don't allow javscript programs full access to the PC resources. I think, that's a good thing. right?
That's why browser vendors limit the access to the users harddisk in different ways. Depending on the browser vendor, those methods are completely different.
eg:
WebKit based browsers like Chrome, Safari, Opera and others
don't allow javascript to
actively write anything to the harddisk at all! It's forbidden! They don't let us do this! They provide us the "passive" file download feature instead :/
Gecko based browsers like FireFox and its cousins, let javascript actively write to the hardisk, if "
signed" AddOns are involved. The signing and review mechanism should protect users from evil software.
Chakra based browsers like IE10 allow
AddOns to actively write to the disk. The
HTA file extension is treated as a trusted application, that allows an hta app file access out of the box.
EdgeHTML based browser like MS Edge try hard to be WebKit compatible. I don't know the details about
MS Edge web extensions. ... So not much info here. ... Just NO active write, if WebKit compatibility is true!
An "active write" works like this:
- a javascript program says to the browser: "Hey browser, I want to save some content to the disk."
- "Give me a container, where I can write to"
- The browser does as requested and offers a file-handler. (after the user explicitly allowed the AddOn to do so)
- The program writes a new file to the harddisk.
- If the file exists, it's overwritten.
A "passive" write / download works like this:
1 a javascript program tells the browser, there is a file at location xxx with the name yyy.html,
- please download it.
2 The browser sends a request to the server: "Hey server send me file yyy.html"
3 The server does this and
4 the browser saves it as file: yyy.html
5 If the user requests the same file-name again, the browser wants to be helpful and it doesn't overwrite the file
- instead it saves the new file as yyy(1).html, because it could be a different file with the same name.
With some
js magic its possible to do step 2,3,4 without the need of a server. So a javscript program like TW can use the "passive" download mechanism.
I hope you can see, these 2 file saving mechanisms are completely different!
-------------
So the reason why we can't just overwrite tw.html is: Many browser vendors just don't allow active file saving, initiated by a javascript app!
Even if we go like this, imo it won't happen ;)
------------
The full truth is: Also FireFox will make it harder or even impossible to use TiddlyFox in the future. IMO both security and performance wise. TiddlyFox type of plugins are incompatible with the new
Webkit like WebExtensions.
See paragraph 4.
Before WebExtensions, you could develop Firefox add-ons using one of three different systems: XUL/XPCOM overlays, bootstrapped extensions, or the Add-on SDK. In the future, WebExtensions will be the recommended way to develop Firefox add-ons, and other systems will be deprecated.
More research needs to be done!
I hope I could shed some more light on the topic.
have fun!
mario