nielsonm236 / NetMod-ServerApp

Reprogramming the Web_Relay_Con V2.0 HW-584 Network Module
71 stars 20 forks source link

Problem with Autocomplete on Chrome #184

Closed nielsonm236 closed 11 months ago

nielsonm236 commented 1 year ago

While working on #183 I've found a problem with Chrome Autocomplete. The scenario: a) I use REST command /72 to start the Code Uploader. b) I upload new firmware and start using it. c) I then start to type REST command /72 to upload new firmware, but as soon as I type /7 it autocompletes to /72 AND it sends the command to the Network Module, causing the Code Uploader to start running.

This is very undesirable behavior. What if I was trying to enter some other /7x command? I would never get the chance to do that because the Code Uploader would install itself preventing the other /7x from working.

At first I thought this was a Network Module firmware problem, but it DOES NOT happen with Firefox. And the Network Module should be unaware of what the user is typing on the URL bar until Enter is pressed. So how is the URL bar getting transmitted to the Network Module before Enter is pressed? (Again, only in Chrome).

I've been Google searching this and haven't found this specific problem described. I see a lot of complaints about how Chrome autofill / autocomplete settings don't work well, but nothing about autofill / autocomplete sending the URL before Enter is pressed. I will keep looking.

nielsonm236 commented 1 year ago

Having said I didn't find anything in Google searches I may have found it here: https://stackoverflow.com/questions/24036730/why-is-chrome-calling-the-autocompleted-url-before-validation I still need to test if this is the problem. But if Chrome is "pre-fetching" based on partial URL entries and history, then this would definitely cause the problem. This is still unpleasant if the user needs to know to disable this "feature" in Chrome.

nielsonm236 commented 12 months ago

Turning off Chrome "Pre-Fetch" makes everything work well. I've seen some more complicated suggestions online in Stack Overflow. I'll keep this open in case one of the contributors has a good idea for this. The problem boils down to this: The firmware currently uses "filenames" to cause functions to execute. Those file names are what I call "REST commands", like /60, /61, /00, /01, etc. Unfortunately Chrome Pre-Fetch watchs what you are typing in the search bar and begins "pre-fetching" the webpages that match what was partially typed in. Unfortunately this causes actions to start executing in the Network Module. If "Pre-fetch" is turned off this problem goes away. Since Chrome keeps changing how you turn off Pre-Fetch I've attached a PDF file explaining how to do it in the current Chrome revision. 20230706 Turning off Pre-Fetch in Chrome.pdf

nielsonm236 commented 11 months ago

Addressed in build 20230803 1943