#70 We need to document wrapper injection code
Opened 7 months ago by polcak. Modified 7 months 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:

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.


Login to comment on this ticket.

Metadata