File tree 1 file changed +6
-3
lines changed
content/tutorial/common/src 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ window.addEventListener('focusin', (e) => {
49
49
post ( { type : 'iframe_took_focus' } ) ;
50
50
} ) ;
51
51
52
+ let previous_href = location . href ;
53
+
52
54
window . addEventListener ( 'click' , ( e ) => {
53
55
let node = e . target ;
54
56
while ( node ) {
@@ -60,7 +62,10 @@ window.addEventListener('click', (e) => {
60
62
e . preventDefault ( ) ;
61
63
window . open ( url , '_blank' ) ;
62
64
} else {
63
- update_path ( url . pathname + url . search + url . hash ) ;
65
+ if ( location . href !== url . href ) {
66
+ previous_href = url . href ;
67
+ update_path ( url . pathname + url . search + url . hash ) ;
68
+ }
64
69
}
65
70
}
66
71
node = node . parent ;
@@ -75,8 +80,6 @@ window.addEventListener('visibilitychange', () => {
75
80
}
76
81
} ) ;
77
82
78
- let previous_href = location . href ;
79
-
80
83
const url_observer = new MutationObserver ( ( ) => {
81
84
if ( location . href !== previous_href ) {
82
85
previous_href = location . href ;
You can’t perform that action at this time.
0 commit comments