@@ -21,7 +21,7 @@ function handleIconClick(tab)
21
21
22
22
var isContentScriptActive = false ;
23
23
24
- chrome . tabs . sendRequest ( tab . id , { name : "FB_isActive" } ,
24
+ chrome . tabs . sendMessage ( tab . id , { name : "FB_isActive" } ,
25
25
26
26
function ( response )
27
27
{
@@ -34,7 +34,7 @@ function handleIconClick(tab)
34
34
else
35
35
{
36
36
setActivationStorage ( tab ) ;
37
- chrome . tabs . sendRequest ( tab . id , { name : "FB_loadFirebug" } ) ;
37
+ chrome . tabs . sendMessage ( tab . id , { name : "FB_loadFirebug" } ) ;
38
38
}
39
39
}
40
40
) ;
@@ -67,7 +67,7 @@ function handleTabChange(tabId, selectInfo)
67
67
{
68
68
var isUpdated = false ;
69
69
70
- chrome . tabs . sendRequest ( tabId , { name : "FB_isActive" } ,
70
+ chrome . tabs . sendMessage ( tabId , { name : "FB_isActive" } ,
71
71
72
72
function ( response )
73
73
{
@@ -120,7 +120,7 @@ function handleUpdateTab(tabId, updateInfo, tab)
120
120
121
121
// *************************************************************************************************
122
122
123
- chrome . extension . onRequest . addListener
123
+ chrome . runtime . onMessage . addListener
124
124
(
125
125
function ( request , sender , sendResponse )
126
126
{
@@ -133,10 +133,10 @@ chrome.extension.onRequest.addListener
133
133
else if ( request . name == "FB_deactivate" )
134
134
{
135
135
disableBrowserActionIcon ( ) ;
136
- chrome . tabs . getSelected ( null , function ( tab ) {
137
- unsetActivationStorage ( tab ) ;
136
+ chrome . tabs . query ( { currentWindow : true } , function ( tab ) {
137
+ unsetActivationStorage ( tab [ 0 ] . id ) ;
138
138
139
- chrome . tabs . sendRequest ( tab . id , { name : "FB_deactivate" } ) ;
139
+ chrome . tabs . sendMessage ( tab [ 0 ] . id , { name : "FB_deactivate" } ) ;
140
140
} ) ;
141
141
}
142
142
@@ -150,7 +150,9 @@ chrome.contextMenus.create({
150
150
title : "Inspect with Firebug Lite" ,
151
151
"contexts" : [ "all" ] ,
152
152
onclick : function ( info , tab ) {
153
- chrome . tabs . sendRequest ( tab . id , { name : "FB_contextMenuClick" } ) ;
153
+ chrome . tabs . query ( { currentWindow : true } , function ( tabs ) {
154
+ chrome . tabs . sendMessage ( tabs [ 0 ] . id , { name : "FB_contextMenuClick" } ) ;
155
+ } ) ;
154
156
}
155
157
} ) ;
156
158
0 commit comments