boblemaire / IoTaWatt

IoTaWatt Open WiFi Electric Energy Monitor
https://iotawatt.com
GNU General Public License v3.0
639 stars 177 forks source link

fixing firefox issues #337

Closed rspenc29 closed 1 year ago

rspenc29 commented 1 year ago

Just a few small fixes so firefox users aren't forced to chrome.

rspenc29 commented 1 year ago

Hey Bob. I'm not sure how you're doing your development and testing on the web app but I threw together a simple dev server if you want to use it. It will let you run the web app locally but proxy requests to the iotawatt device for real time data. It works the same as if it was running on the device but you won't have to upload files everytime you make a change to test them. I also wrote a little bash script to upload any changed files from the SD directory to the device. Check it out and if you find it useful then let me know and I'll submit a pull request for that too.

https://github.com/rspenc29/IoTaWatt/tree/dev/server

boblemaire commented 1 year ago

You will have to be more specific about the Firefox issues that you are fixing. I use Firefox almost exclusively without any problems. I'm reluctant to make changes when I don't understand the problem or what the proposed solution does.

Not sure what you are doing for app development, but I develop those apps directly using the IoTaWatt File Manager with the Ace editor that is included. When I make changes, I just hit CTRL-S and it uploads to the IoTaWatt. If I run the target app in another window, I then just need to refresh to run it.

I completely developed Graph+ using this method and found it to be very easy.

rspenc29 commented 1 year ago

You will have to be more specific about the Firefox issues that you are fixing. I use Firefox almost exclusively without any problems. I'm reluctant to make changes when I don't understand the problem or what the proposed solution does.

The body onload event wasn't being called in firefox 108 on mac resulting in a blank screen on every page. Rather than try to track the issue down, it's just much easier to move the event to DOMContentLoaded.

The requestAnimationFrame isn't necessarily a bug fix, just a good practice. It stops the polling from firing in the background when you switch to another browser tab or minimize your browser and resumes when you go back to viewing the page.

Not sure what you are doing for app development, but I develop those apps directly using the IoTaWatt File Manager with the Ace editor that is included. When I make changes, I just hit CTRL-S and it uploads to the IoTaWatt. If I run the target app in another window, I then just need to refresh to run it.

I completely developed Graph+ using this method and found it to be very easy.

That's fine. I like to work in my own editor with my key bindings and plugins and just thought I'd share if it would make things easier for you. Do whatever you're comfortable with.