を使わずにブラウザの履歴を書き換えることはできhistory.pushState
ますか?
次のようなルーターを備えたバックボーン アプリケーションがあります。
routes: {
'posts': 'posts',
'modal': 'modal'
},
'before': function (args) {
//check if logged in
//do some various other setup tasks
//maybe delete modal routes from the history?
//forward to route
args.next()
},
'posts': function () {
//make and show posts
},
'modal': function (params) {
//edit user email preferences OR
//create a new post OR
//do various other crud operations
}
モーダル ルートが起動されるたびに、ハッシュがブラウザの履歴状態に書き込まれないようにしたいと考えています。その理由は、ユーザーは履歴をさかのぼるときにモーダルを再度開いてはならないからです。
バックボーンのソース コードを調べましたが、単純にhistory = []
.
プッシュ状態なしでこれを行う方法はありますか?