Not necessary? Rated 3 out of 5 stars

Firefox already does this automatically!
https://bugzilla.mozilla.org/show_bug.cgi?id=512854