@@ -8,8 +8,7 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab)
88}
99
1010// Prep some variables
11- var sites = [ ] ,
12- ideKey = "XDEBUG_ECLIPSE" ,
11+ var ideKey = "XDEBUG_ECLIPSE" ,
1312match = true ,
1413traceTrigger = ideKey ,
1514profileTrigger = ideKey ,
@@ -18,11 +17,6 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab)
1817// Check if localStorage is available and get the settings out of it
1918if ( localStorage )
2019{
21- if ( localStorage [ "sites" ] )
22- {
23- sites = JSON . parse ( localStorage [ "sites" ] ) ;
24- }
25-
2620if ( localStorage [ "xdebugIdeKey" ] )
2721{
2822ideKey = localStorage [ "xdebugIdeKey" ] ;
@@ -39,32 +33,24 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab)
3933}
4034}
4135
42- // Get the current domain out of the tab URL and check if it matches anything in the sites array
43- domain = tab . url . match ( / : \/ \/ ( .[ ^ \/ ] * ) / ) [ 1 ] ;
44- match = isValueInArray ( sites , domain ) ;
45-
46- // Check if we have a match or don't need to match at all
47- if ( ( domain != null && match ) || sites . length === 0 )
48- {
49- // Request the current status and update the icon accordingly
50- chrome . tabs . sendMessage (
51- tabId ,
52- {
53- cmd : "getStatus" ,
54- idekey : ideKey ,
55- traceTrigger : traceTrigger ,
56- profileTrigger : profileTrigger
57- } ,
58- function ( response )
59- {
60- if ( chrome . runtime . lastError ) {
61- console . log ( "Error: " , chrome . runtime . lastError ) ;
62- } else {
63- updateIcon ( response . status , tabId ) ;
64- }
36+ // Request the current status and update the icon accordingly
37+ chrome . tabs . sendMessage (
38+ tabId ,
39+ {
40+ cmd : "getStatus" ,
41+ idekey : ideKey ,
42+ traceTrigger : traceTrigger ,
43+ profileTrigger : profileTrigger
44+ } ,
45+ function ( response )
46+ {
47+ if ( chrome . runtime . lastError ) {
48+ console . log ( "Error: " , chrome . runtime . lastError ) ;
49+ } else {
50+ updateIcon ( response . status , tabId ) ;
6551}
66- ) ;
67- }
52+ }
53+ ) ;
6854} ) ;
6955
7056chrome . commands . onCommand . addListener ( function ( command )
0 commit comments