Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Oct 5, 2023
1 parent 02c27df commit e63ed3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WebDriverAgentLib/Routing/FBWebServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ - (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>";
NSString *calibrationPage = @"<html>"
"<title>{\"x\":null,\"y\":null}</title>"
"<header>"
"<script>document.addEventListener(\"click\",function(e){document.title=JSON.stringify({x:e.clientX,y:e.clientY})})</script>"
"</header>"
"</html>";
[self.server get:@"/calibrate" withBlock:^(RouteRequest *request, RouteResponse *response) {
[response respondWithString:calibrationPage];
}];
Expand Down

0 comments on commit e63ed3f

Please sign in to comment.