File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 2020 " activeTab" ,
2121 " storage" ,
2222 " idle" ,
23- " chrome://favicon/*"
23+ " chrome://favicon/*" ,
24+ " webNavigation"
2425 ],
2526 "background" : {
2627 "scripts" : [" scripts/common.js" ,
Original file line number Diff line number Diff line change @@ -55,4 +55,14 @@ class Activity {
5555 loadDataFromStorage ( ) {
5656 var tabs = storage . load ( STORAGE_TABS ) ;
5757 }
58+
59+ updateFavicon ( tab ) {
60+ var domain = this . extractHostname ( tab . url ) ;
61+ var currentTab = this . getTab ( domain ) ;
62+ if ( currentTab !== null && currentTab !== undefined ) {
63+ if ( tab . favIconUrl !== undefined && tab . favIconUrl !== currentTab . favicon ) {
64+ currentTab . favicon = tab . favIconUrl ;
65+ }
66+ }
67+ }
5868} ;
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ function addListener() {
5050 activity . addTab ( tab ) ;
5151 } ) ;
5252 } ) ;
53+
54+ chrome . webNavigation . onCompleted . addListener ( function ( details ) {
55+ chrome . tabs . get ( details . tabId , function ( tab ) {
56+ activity . updateFavicon ( tab ) ;
57+ } ) ;
58+ } ) ;
5359}
5460
5561addListener ( ) ;
You can’t perform that action at this time.
0 commit comments