File tree 2 files changed +39
-1
lines changed
2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codebolt/codeboltjs" ,
3
- "version" : " 1.1.37 " ,
3
+ "version" : " 1.1.38 " ,
4
4
"description" : " " ,
5
5
"keywords" : [],
6
6
"author" : " " ,
Original file line number Diff line number Diff line change @@ -152,6 +152,44 @@ const cbbrowser = {
152
152
} ) ;
153
153
} ) ;
154
154
} ,
155
+ /**
156
+ * Retrieves the snapshot of the current page.
157
+ * @returns {Promise<GetContentResponse> } A promise that resolves with the content.
158
+ */
159
+ getSnapShot : ( ) :Promise < any > => {
160
+
161
+ return new Promise ( ( resolve , reject ) => {
162
+ cbws . getWebsocket . send ( JSON . stringify ( {
163
+ "type" : "browserEvent" ,
164
+ action : 'getSnapShot'
165
+ } ) ) ;
166
+ cbws . getWebsocket . on ( 'message' , ( data : string ) => {
167
+ const response = JSON . parse ( data ) ;
168
+ if ( response . event === "getSnapShotResponse" ) {
169
+ resolve ( response ) ;
170
+ }
171
+ } ) ;
172
+ } ) ;
173
+ } ,
174
+ /**
175
+ * Retrieves browser info like height width scrollx scrolly of the current page.
176
+ * @returns {Promise<GetContentResponse> } A promise that resolves with the content.
177
+ */
178
+ getBrowserInfo : ( ) :Promise < any > => {
179
+
180
+ return new Promise ( ( resolve , reject ) => {
181
+ cbws . getWebsocket . send ( JSON . stringify ( {
182
+ "type" : "browserEvent" ,
183
+ action : 'getBrowserInfo'
184
+ } ) ) ;
185
+ cbws . getWebsocket . on ( 'message' , ( data : string ) => {
186
+ const response = JSON . parse ( data ) ;
187
+ if ( response . event === "getBrowserInfoResponse" ) {
188
+ resolve ( response ) ;
189
+ }
190
+ } ) ;
191
+ } ) ;
192
+ } ,
155
193
156
194
/**
157
195
* Extracts text from the current page.
You can’t perform that action at this time.
0 commit comments