使用php加载页面时获取所有源(images / js / css)

I want to get a list of files that are being loaded on a page (this can be any page, not mine). For example i need a list of all javascript/css files, images/gifs and so on that are being loaded on www.example.com.

I use Simple HTML DOM Parser but this isn't enough. It gets all sources that are being shown in source code, but lets say i have CSS file that puts a background image on some DIV - source of that background image won't be shown in source code. Same with javascripts - 1 javascript file can load other files, those other files can load other files and so on (those other files wont be shown in source code).

Basically im trying to achieve something when you press Network tab on Chrome dev tools (F12) - it shows all the files that were loaded. Im not looking for some alternative tool or website that does this for me, im trying to see if its possible to do in PHP (maybe there are some libraries for this?).

Any thoughts?