Skip to content

Commit 7bf729b

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
[SPIKE] Send Page.reload message to iOS runtime
1 parent 0b42cc9 commit 7bf729b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/services/ios-debug-service.ts

+11
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ class IOSDebugService implements IDebugService {
177177
let timeout = this.$utils.getMilliSecondsTimeout(IOSDebugService.TIMEOUT_SECONDS);
178178
awaitNotification(npc, notification.appLaunching(projectId), timeout).wait();
179179
process.nextTick(() => {
180+
// console.log("BEFORE SEND PAGE RELOAD!!!!!");
181+
/* let pageReloadMessage = {"method":"Page.reload","params":{"ignoreCache":false},"id":54};
182+
npc.postNotificationAndAttachForData(pageReloadMessage);
183+
console.log("DEBUG BRK CORE!!!!"); */
180184
npc.postNotificationAndAttachForData(notification.waitForDebug(projectId));
181185
npc.postNotificationAndAttachForData(notification.attachRequest(projectId));
182186
});
@@ -338,6 +342,13 @@ function createTcpSocketProxy($logger: ILogger, socketFactory: (handler: (socket
338342
process.exit(0);
339343
});
340344

345+
let message = '{ "method":"Page.reload","params":{"ignoreCache":false},"id":54 }';
346+
let length = Buffer.byteLength(message, "utf16le");
347+
let payload = new Buffer(length + 4);
348+
payload.writeInt32BE(length, 0);
349+
payload.write(message, 4, length, "utf16le");
350+
backendSocket.write(payload);
351+
341352
backendSocket.pipe(frontendSocket);
342353
frontendSocket.pipe(backendSocket);
343354
frontendSocket.resume();

0 commit comments

Comments
 (0)