From 9414d297f39e6fe6733d0307b975a994b1896f6f Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Wed, 23 Jun 2021 19:05:13 +1200 Subject: [PATCH] Add noops for window (re)sizing, resorting to throwing errors. --- src/Webdriver.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Webdriver.hs b/src/Webdriver.hs index fe7b174..cff9b71 100644 --- a/src/Webdriver.hs +++ b/src/Webdriver.hs @@ -45,7 +45,11 @@ serveSession sessions = WD.withSession fail (\uuid session -> msum [ getWindowHandle uuid, delSession sessions uuid, -- Closing the only window closes the session. switchWindowHandle uuid, - dir "handles" $ getWindowHandles uuid + dir "handles" $ getWindowHandles uuid, + dir "rect" $ unsupportedOp, + dir "maximize" $ unsupportedOp, + dir "minimize" $ unsupportedOp, + dir "fullscreen" $ unsupportedOp ], dir "frame" $ msum [noSuchFrame, dir "parent" $ ok $ toResponse ()] -- Noops ]) sessions @@ -153,3 +157,7 @@ noSuchFrame = do method POST nullDir errJSON 404 "no such frame" "Rhapsode doesn't support frames" + +unsupportedOp = do + nullDir + errJSON 400 "unsupported operation" "Windowsize is meaningless to Rhapsode" -- 2.30.2