LoginSignup
0
1

More than 1 year has passed since last update.

ブラウザバック判別

Last updated at Posted at 2022-02-24
if(window.performance.navigation.type === 2) { // ちなみにリロードの場合は1
	// ブラウザバック時に実行したいイベント
}

こっちでもいける

if(window.performance.navigation.type === performance.navigation.TYPE_BACK_FORWARD){ // リロードの場合はTYPE_RELOAD 
	// ブラウザバック時に実行したいイベント
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1