There doesn't seem to be any History API support detection in the ember source.
So if you set location
to history
, and there's no support, your routing will probably fail.
If you intend to support old browsers, safest bet is like you said:
if (window.history && window.history.pushState) {
App.Router.reopen({
location: 'history'
});
}
UPDATE 23 Jan 2014
You can now use location:'auto'
if you enable ember-routing-auto-location
feature in canary.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…