File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33// Can use:
44// chrome.tabs.*
55// chrome.extension.*
6-
6+ var tabInspected ;
77var ports = [ ] ;
88chrome . runtime . onConnect . addListener ( function ( port ) {
99 if ( port . name !== "devtools" ) return ;
@@ -19,15 +19,16 @@ chrome.runtime.onConnect.addListener(function (port) {
1919} ) ;
2020
2121chrome . tabs . onUpdated . addListener ( function ( tabId , changes , tabObject ) {
22- if ( changes . status == "complete" ) {
22+ if ( tabId == tabInspected && changes . status == "complete" ) {
2323 getJsonResource ( tabId ) ;
2424 }
2525} ) ;
2626
2727function processBackgroundIncomingMessage ( msg ) {
2828 console . log ( "Processing Message in Background" , msg )
2929 if ( msg . tabId ) {
30- getJsonResource ( msg . tabId ) ;
30+ tabInspected = msg . tabId ;
31+ getJsonResource ( tabInspected ) ;
3132 } else {
3233 console . log ( msg ) ;
3334 }
@@ -57,7 +58,7 @@ function getJsonResource(tabID) {
5758 notifyDevtools ( JSON . parse ( '{"error":"' + e + '"}' ) ) ;
5859 }
5960 } else {
60- notifyDevtools ( JSON . parse ( '{"error":"No Solidus Page Context Found"}' ) ) ;
61+ notifyDevtools ( JSON . parse ( '{"error":"No Solidus Page Context Found! "}' ) ) ;
6162 }
6263 }
6364 }
You can’t perform that action at this time.
0 commit comments