#FEN to ANKI (fixed)

19 messages · Page 1 of 1 (latest)

wind oasis
#

Hello,

I am writting an extension for firefox for a niche problem. I want, when in a study or in an analysis board, get the current fen to be fetched and copied to clipboard.

This would permit me to create anki notes from position I want to keep informations about (in majority, remember what I did wrong).

I see there is a FEN displayed underboard but I can't find a way to copy it without me having to click onto the button.

I am not a dev in the first place but I have an embryonic of something but is it normal to have to develop a JS beast just to fetch the FEN of the currently displayed board ?

rapid fable
#

If Lichess starts adding every single feature user wants it's gonna be unmaintainable

#

And automatically copying the FEN to the clipboard isn't a feature a lot of people want.

#

But you can always make an extension.

#

Maybe try with AI assistants first if you don't know anything about coding, but it'll be hard. If you already know JS programming it should be quite easy.

wind oasis
#

I am doing. But cant someone just explain how the fen is fetched and displayed on a url like https://lichess.org/gameID/black#23 for example ? I inspected the DOM and all stuff and I can see at some point one WSS call. This call is unique and fetches all the PGN data plus the list of ply/fen but I can't find the wayt it then shows up in the FEN input tag

#

(and I do not want lichess implementing something wich is obvisouly my need huh)

rapid fable
#

DO NOT manipulate the WebSocket directly. This WILL ban your account.

#

Just fetch the FEN from the input box.

wind oasis
#

why would I be banned in the analysis or study board ?

#

I am not in a live game, never

rapid fable
#

Just remember to NOT manipulate the WebSocket directly.

#

It is easier to fetch the FEN from the FEN share box under the board with some JS.

#

Also I'm not sure if the WebSocket uses FEN, they might use a more compact and efficient format.

wind oasis
#

Ok, I won't risk my account for that. Will try another way. Thank you.

#

FEN to ANKI (fixed)

modest pumice
rapid fable
#

Maybe, but most websites have extremly complex partially obfuscated HTML