File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
content/tutorial/common/src Expand file tree Collapse file tree 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) => {
4949 post ( { type : 'iframe_took_focus' } ) ;
5050} ) ;
5151
52+ let previous_href = location . href ;
53+
5254window . addEventListener ( 'click' , ( e ) => {
5355 let node = e . target ;
5456 while ( node ) {
@@ -60,7 +62,10 @@ window.addEventListener('click', (e) => {
6062 e . preventDefault ( ) ;
6163 window . open ( url , '_blank' ) ;
6264 } 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+ }
6469 }
6570 }
6671 node = node . parent ;
@@ -75,8 +80,6 @@ window.addEventListener('visibilitychange', () => {
7580 }
7681} ) ;
7782
78- let previous_href = location . href ;
79-
8083const url_observer = new MutationObserver ( ( ) => {
8184 if ( location . href !== previous_href ) {
8285 previous_href = location . href ;
You can’t perform that action at this time.
0 commit comments