File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,10 @@ export class McpContext implements Context {
407407 ) ;
408408 } ) ;
409409
410- if ( ! this . #selectedPage || this . #pages. indexOf ( this . #selectedPage) === - 1 ) {
410+ if (
411+ ( ! this . #selectedPage || this . #pages. indexOf ( this . #selectedPage) === - 1 ) &&
412+ this . #pages[ 0 ]
413+ ) {
411414 this . selectPage ( this . #pages[ 0 ] ) ;
412415 }
413416
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ function makeTargetFilter() {
3030 if ( target . url ( ) === 'chrome://newtab/' ) {
3131 return true ;
3232 }
33+ // Could be the only page opened in the browser.
34+ if ( target . url ( ) . startsWith ( 'chrome://inspect' ) ) {
35+ return true ;
36+ }
3337 for ( const prefix of ignoredPrefixes ) {
3438 if ( target . url ( ) . startsWith ( prefix ) ) {
3539 return false ;
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ function registerTool(tool: ToolDefinition): void {
148148 content,
149149 } ;
150150 } catch ( error ) {
151+ logger ( `${ tool . name } response handling error:` , error , error . stack ) ;
151152 const errorText =
152153 error instanceof Error ? error . message : String ( error ) ;
153154
@@ -162,7 +163,7 @@ function registerTool(tool: ToolDefinition): void {
162163 } ;
163164 }
164165 } catch ( err ) {
165- logger ( `${ tool . name } error: ${ err . message } ` ) ;
166+ logger ( `${ tool . name } error:` , err , err . stack ) ;
166167 throw err ;
167168 } finally {
168169 guard . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments