Skip to content

Commit bf5fc7d

Browse files
AnikHasibulhajimehoshi
authored andcommitted
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.
1 parent 0210a2f commit bf5fc7d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tool.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,15 @@ func (fs serveCommandFileSystem) Open(requestName string) (http.File, error) {
641641

642642
if isIndex {
643643
// If there was no index.html file in any dirs, supply our own.
644-
return newFakeFile("index.html", []byte(`<html><head><meta charset="utf-8"><script src="`+base+`.js"></script></head><body></body></html>`)), nil
644+
return newFakeFile("index.html", []byte(`<html>
645+
<head>
646+
<meta name="viewport" content="initial-scale=1">
647+
<meta charset="utf-8">
648+
<script defer src="`+base+`.js"></script>
649+
</head>
650+
<body>
651+
</body>
652+
</html>`)), nil
645653
}
646654

647655
return nil, os.ErrNotExist

0 commit comments

Comments
 (0)