autoscheduling in firefox

I added a variable true where ever my task are updated or added and kept false after saving the updated. if not saved i added to alert on hiting back to save first. The one which are linked tasks
(Ex: start to end) I am autoscheduling the dependency tasks to change the dates as source task end date should be the start date of target task.

issue is it is working fine in chrome but m getting alert to save in firefox when hiting back button.