My mind has been officially blown! How have I not found this sooner??
I've added more nested levels to accommodate some deeper levels of the dom, but that's a simple copy and paste job from the code above.
I'll be adding the bookmark for sure!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.