The wrapper injection code works mostly great but see #46, #47, #48, #55, #56, #57, #22, #32, #43. All issues go to Giorgio because the affected code is not documented well. See for example:
https://pagure.io/JShelter/webextension/issue/46#comment-793783
(https://pagure.io/JShelter/webextension/blob/17d9641b45e85a8ced726cc134b9af2777452f28/f/common/document_start.js#_70)
As I understand, there is a race condition on running this script and the navigation script that adds the configuration property. But why isn't it documented. Additionally, what happens if the window has a property configuration not added by JShelter (another extension, page script)? Is it possible or not. Why do need to assign the configuration in the first place? Is the else branch guaranteed to synchronously set the correct configuration, does it only work when the navigation script did not run yet? Is there any work wasted?
I always have similar questions when I dig into https://pagure.io/JShelter/webextension/blob/17d9641b45e85a8ced726cc134b9af2777452f28/f/common/code_builders.js#_375.
Regarding the injection, we actually had some documentation, see https://pagure.io/JShelter/paper2022/blob/50ac7cfdaa1d637b1026755345abe99bece4acf0/f/paper.tex#_875 which I modified after Radek's review in https://pagure.io/JShelter/paper2022/c/a59c59f089297cf8b8ff9af5ab30789d7da6d803?branch=cnil.
But that text does not reflect my observations in https://pagure.io/JShelter/webextension/issue/46#comment-793783 so I modified the text in https://pagure.io/JShelter/paper2022/c/a7e7e88edecfa19c3a52542b553bf1dc9b4388a9?branch=cnil
I added pointers to these issues/paper to the code: https://pagure.io/JShelter/webextension/c/31746abdba1cb0c420b17646216193797bb60b66?branch=main
Log in to comment on this ticket.