Close

Edit a text file on a phone in a browser

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 02/13/2024 at 20:110 Comments

There is a desire to edit config files & notes on a phone without shuffling files around, typing on the phone screen, or using busybox on ADB.

https://hackaday.io/project/138050-silly-software-wishlist/log/179072-web-based-file-manager-for-android

Webphone needs an editor which shows the file contents in a text box, has a save button, revert button.  Browser text editing is horrendous but better than nothing.  It would be the absolute minimum way of changing a text file.

After some heroic HTML POST handling, it was done.  Need undo or revert?  Just hit the back button.

There is 1 kaboom case.  If a text editor on the phone changes it & the user resends the POST in the browser, it'll overwrite the phone changes.    The post could contain an md5sum of the previous save & it could reject the post if the md5 doesn't match what's on the phone. 

-------------------------------------------------------------------------------

This became kind of a pain after a while.  It needs to retain the size of the text box in a cookie. 

-----------------------------------------------------------------------------------------

Eventually, it always based the text box size on the window size. 

The mane problem is the lack of an error if the user saves when the app is closed.  It just sits & spins. 

Discussions