Skip to content

Commit

Permalink
feat: Add /calibrate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Oct 5, 2023
1 parent 570866e commit 02c27df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WebDriverAgentLib/Routing/FBWebServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ - (void)registerServerKeyRouteHandlers
[response respondWithString:@"I-AM-ALIVE"];
}];

NSString *calibrationPage = @"<html><header><script>function printMousePos(e){document.getElementById(\"x\").innerHTML=e.clientX,document.getElementById(\"y\").innerHTML=e.clientY}document.addEventListener(\"click\",printMousePos)</script></header><div><p id=x><p id=y></div></html>";
[self.server get:@"/calibrate" withBlock:^(RouteRequest *request, RouteResponse *response) {
[response respondWithString:calibrationPage];
}];

[self.server get:@"/wda/shutdown" withBlock:^(RouteRequest *request, RouteResponse *response) {
[response respondWithString:@"Shutting down"];
[self.delegate webServerDidRequestShutdown:self];
Expand Down

0 comments on commit 02c27df

Please sign in to comment.