File tree 2 files changed +36
-29
lines changed
2 files changed +36
-29
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @browserbasehq/stagehand " : patch
3
+ ---
4
+
5
+ only start domdebug if enabled
Original file line number Diff line number Diff line change @@ -110,36 +110,38 @@ export class StagehandPage {
110
110
}
111
111
112
112
public async startDomDebug ( ) {
113
- try {
114
- await this . page
115
- . evaluate ( ( ) => {
116
- if ( typeof window . debugDom === "function" ) {
117
- window . debugDom ( ) ;
118
- } else {
119
- this . stagehand . log ( {
120
- category : "dom" ,
121
- message : "debugDom is not defined" ,
122
- level : 1 ,
123
- } ) ;
124
- }
125
- } )
126
- . catch ( ( ) => { } ) ;
127
- } catch ( e ) {
128
- this . stagehand . log ( {
129
- category : "dom" ,
130
- message : "Error in startDomDebug" ,
131
- level : 1 ,
132
- auxiliary : {
133
- error : {
134
- value : e . message ,
135
- type : "string" ,
136
- } ,
137
- trace : {
138
- value : e . stack ,
139
- type : "string" ,
113
+ if ( this . stagehand . debugDom ) {
114
+ try {
115
+ await this . page
116
+ . evaluate ( ( ) => {
117
+ if ( typeof window . debugDom === "function" ) {
118
+ window . debugDom ( ) ;
119
+ } else {
120
+ this . stagehand . log ( {
121
+ category : "dom" ,
122
+ message : "debugDom is not defined" ,
123
+ level : 1 ,
124
+ } ) ;
125
+ }
126
+ } )
127
+ . catch ( ( ) => { } ) ;
128
+ } catch ( e ) {
129
+ this . stagehand . log ( {
130
+ category : "dom" ,
131
+ message : "Error in startDomDebug" ,
132
+ level : 1 ,
133
+ auxiliary : {
134
+ error : {
135
+ value : e . message ,
136
+ type : "string" ,
137
+ } ,
138
+ trace : {
139
+ value : e . stack ,
140
+ type : "string" ,
141
+ } ,
140
142
} ,
141
- } ,
142
- } ) ;
143
+ } ) ;
144
+ }
143
145
}
144
146
}
145
147
You can’t perform that action at this time.
0 commit comments