Browse files

Added viewport support and defered execution on gopherjs serve (#860)

Added `<meta name="viewport" content="initial-scale=1">` for responsive web development 
environment with gopherjs via gopherjs serve command.
  • Loading branch information...
AnikHasibul authored and hajimehoshi committed Oct 3, 2018
1 parent 0210a2f commit bf5fc7d381404c2a218d4c28865b251d6e8e1cb8
Showing with 9 additions and 1 deletion.
  1. +9 −1 tool.go
10 tool.go
@@ -641,7 +641,15 @@ func (fs serveCommandFileSystem) Open(requestName string) (http.File, error) {
if isIndex {
// If there was no index.html file in any dirs, supply our own.
return newFakeFile("index.html", []byte(`<html><head><meta charset="utf-8"><script src="`+base+`.js"></script></head><body></body></html>`)), nil
return newFakeFile("index.html", []byte(`<html>
<meta name="viewport" content="initial-scale=1">
<meta charset="utf-8">
<script defer src="`+base+`.js"></script>
</html>`)), nil
return nil, os.ErrNotExist

0 comments on commit bf5fc7d

Please sign in to comment.