MCPcopy Create free account
hub / github.com/wailsapp/wails / insertScriptInHead

Function insertScriptInHead

v2/pkg/assetserver/common.go:85–97  ·  view source on GitHub ↗
(htmlNode *html.Node, scriptName string)

Source from the content-addressed store, hash-verified

83}
84
85func insertScriptInHead(htmlNode *html.Node, scriptName string) error {
86 headNode := findFirstTag(htmlNode, "head")
87 if headNode == nil {
88 return errors.New("cannot find head in HTML")
89 }
90 scriptNode := createScriptNode(scriptName)
91 if headNode.FirstChild != nil {
92 headNode.InsertBefore(scriptNode, headNode.FirstChild)
93 } else {
94 headNode.AppendChild(scriptNode)
95 }
96 return nil
97}
98
99func appendSpinnerToBody(htmlNode *html.Node) error {
100 bodyNode := findFirstTag(htmlNode, "body")

Callers 1

processIndexHTMLMethod · 0.85

Calls 3

findFirstTagFunction · 0.85
createScriptNodeFunction · 0.85
InsertBeforeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…