File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,17 +49,18 @@ function getJsonResource(tabID) {
4949 var xhr = new XMLHttpRequest ( ) ;
5050 xhr . open ( "GET" , jsonResourceURL , true ) ;
5151 xhr . onreadystatechange = function ( ) {
52- if ( xhr . readyState === 4 ) {
53- if ( xhr . status === 200 ) {
52+ if ( xhr . readyState === 4 && xhr . getResponseHeader ( "X-Powered-By" ) === "Express" ) {
53+ if ( xhr . status === 200 ) { //Check this separately so we can notify devtools if we don't get a 200 response.
5454 try {
55- pageContext = JSON . parse ( xhr . responseText ) ;
56- notifyDevtools ( pageContext ) ;
55+ notifyDevtools ( JSON . parse ( xhr . responseText ) ) ;
5756 } catch ( e ) {
5857 notifyDevtools ( JSON . parse ( '{"error":"' + e + '"}' ) ) ;
5958 }
6059 } else {
61- notifyDevtools ( JSON . parse ( '{"error":"No Solidus Page Context Found!"}' ) ) ;
60+ notifyDevtools ( JSON . parse ( '{"error":"Solidus Page Context Not Found!"}' ) ) ;
6261 }
62+ } else {
63+ notifyDevtools ( JSON . parse ( '{"error":"Looks like you\'re not inspecting a Solidus Page."}' ) ) ;
6364 }
6465 }
6566 xhr . send ( ) ;
You can’t perform that action at this time.
0 commit comments