This function function and either this function are not implemented in scrapy-playwright.
I tried with coroutines (evaluate) but it doesn't give the same results as add_init_script
as the JS script in this function is evaluated before all the JS of the document loaded.