I want to run some actions as soon as any page is loaded in Playwright (in library mode):
load page A
run common post-load actions <---
run specific actions for page A
load page B
run common post-load actions <---
run specific actions for page B
etc.
I found the DOMContentLoaded
event, and added my general post-load actions in a suitable event handler. But Playwright doesn't wait for my code to complete, so I assume (?) that is not a supported scenario - it's probably just for small/quick scripts, etc.
Is there a way to do this?