File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,12 @@ cls.ResourceManagerService = function(view, network_logger)
5959 this . _update = function ( msg )
6060 {
6161 var ctx = { } ;
62+ // get list of window_contexts for which we saw the main_document
63+ ctx . windowList = ( this . _network_logger . get_window_contexts ( ) || [ ] ) . filter ( function ( w )
64+ {
65+ return w . saw_main_document ;
66+ } ) ;
6267
63- ctx . windowList = this . _network_logger . get_window_contexts ( ) ;
6468 if ( ctx . windowList && ctx . windowList . length )
6569 {
6670 var typeGroupMapping =
@@ -73,16 +77,25 @@ cls.ResourceManagerService = function(view, network_logger)
7377 '*' :'others'
7478 } ;
7579
76- // get all the resources
7780 ctx . resourceList = [ ] ;
78- ctx . windowList . forEach ( function ( w )
81+ ctx . documentResourceHash = { } ;
82+
83+ // get all the resources
84+ ctx . windowList
85+ . forEach ( function ( w )
7986 {
80- var wr = w . get_resources ( ) ;
81- ctx . resourceList = ctx . resourceList . concat ( wr ) ;
87+ // get resources of the current window
88+ var windowResources = w . get_resources ( ) ;
89+ // filter out the resources that are unloaded
90+ windowResources
91+ . filter ( function ( r )
92+ {
93+ return ! r . is_unloaded ;
94+ } ) ;
95+ // concat the result to flat list of resource
96+ ctx . resourceList = ctx . resourceList . concat ( windowResources ) ;
8297 } ) ;
8398
84- ctx . documentResourceHash = { } ;
85-
8699 // filter the documentId that belong in the windowIdList
87100 ctx . documentList = this . _documentList . filter ( function ( d )
88101 {
You can’t perform that action at this time.
0 commit comments