From dea716c9a64803e811d00061981f727d658c186a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 22 Aug 2020 18:40:31 +0900 Subject: [PATCH] uidriver: Remove force focusing by clicking the body As long as the game is embedded in an iframe, this is no longer needed. --- internal/uidriver/js/ui.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/uidriver/js/ui.go b/internal/uidriver/js/ui.go index e7fd71828..693fa0740 100644 --- a/internal/uidriver/js/ui.go +++ b/internal/uidriver/js/ui.go @@ -292,13 +292,6 @@ func init() { bodyStyle.Set("margin", "0") bodyStyle.Set("padding", "0") - // TODO: This is OK as long as the game is in an independent iframe. - // What if the canvas is embedded in a HTML directly? - document.Get("body").Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} { - canvas.Call("focus") - return nil - })) - canvasStyle := canvas.Get("style") canvasStyle.Set("width", "100%") canvasStyle.Set("height", "100%")