@@ -50,7 +50,7 @@ Running from the browser
50
50
------------------------
51
51
52
52
After ChessHue is run once, the next time it can be started using the ` chess:// ` protocol.
53
- You can pass your PGN in the URL, like ` chess://e4 e5 / ` .
53
+ You can pass your PGN in the URL, like ` chess://e4_e5 / ` .
54
54
55
55
To analyse your games in ChessHue right after they end:
56
56
@@ -66,10 +66,10 @@ To analyse your games in ChessHue right after they end:
66
66
if (e .key === ' l' && document .querySelector (' .game-review-buttons-component' )) {
67
67
const nodes = document .querySelectorAll (' .main-line-ply' );
68
68
if (nodes .length > 0 ) {
69
- const moves = [... nodes].map (e => e .textContent );
69
+ const moves = [... nodes].map (e => e .textContent . trim () );
70
70
const clock = document .querySelector (' .clock-bottom' );
71
71
const color = clock .classList .contains (' clock-black' ) ? ' b' : ' w' ;
72
- const url = ` chess://${ moves .join (' ' )} /${ color} ` ;
72
+ const url = ` chess://${ moves .join (' _ ' )} /${ color} ` ;
73
73
window .open (url .replace (' #' , ' %23' ), ' _blank' );
74
74
}
75
75
}
@@ -83,10 +83,10 @@ To analyse your games in ChessHue right after they end:
83
83
if (e.key === 'l' && document.querySelector('.rematch')) {
84
84
const nodes = document.querySelectorAll('l4x kwdb');
85
85
if (nodes.length > 0) {
86
- const moves = [...nodes].map(e => e.textContent);
86
+ const moves = [...nodes].map(e => e.textContent.trim() );
87
87
const clock = document.querySelector('.rclock-bottom');
88
88
const color = clock.classList.contains('rclock-black') ? 'b' : 'w';
89
- const url = ` chess: // ${moves.join(' ')}/${color}`;
89
+ const url = ` chess: // ${moves.join('_ ')}/${color}`;
90
90
window .open (url .replace (' #' , ' %23' ).replace (/ ½\? / g , ' ' ), ' _blank' );
91
91
}
92
92
}
0 commit comments