#70 We need to document wrapper injection code
Opened 2 years ago by polcak. Modified 2 years ago

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:



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.

Login to comment on this ticket.