Skip to content

History.JS running settimeout every second because of IE8. #321

Open
@leonardoanalista

Description

@leonardoanalista

I've just searched and haven't found exactly the same issie open.

I am using jquery.history.js. On the line 3247 you have this code:

// For Internet Explorer
History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval));

as well as this code too:

// For Other Browsers
History.Adapter.bind(window,'beforeunload',History.onUnload);
History.Adapter.bind(window,'unload',History.onUnload);

This code will trigger a clean up on history local storage when user leaves the page. I know that IE 8 has got issues with unload event.

However, all other browsers are being "punished" with this settimeout running every second because of IE8. It seems to be unnecessary as the cross-browser unload can be achieved with this code:

window.onbeforeunload = beforeQuit;
function beforeQuit(){
    return "Do you really wanna quit?";
}

My point is: All other browsers don't need to have this settimout function running all the time. I am building mobile web apps and I am concern about possible battery draining issues.

What do you think?

Btw this library is great man! you guys are doing a f great job!

cheers
Leoanrdo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions