Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

webloop

> 编程语言
Open source

WebLoop: Scriptable, headless WebKit with a Go API. Like PhantomJS, but for Go.

1.4K stars0 likes0 views
WebsiteGitHub

About

WebLoop: Scriptable, headless WebKit with a Go API. Like PhantomJS, but for Go.

WebLoop

Scriptable, headless WebKit with a Go API. Like PhantomJS, but for Go. Render static HTML versions of dynamic JavaScript applications, automate browsing, run arbitrary JavaScript in a browser window context, etc., all from Go or the command line.

  • Documentation on Sourcegraph

Requirements

  • Go >= 1.2rc1 (due to #3250)
  • WebKitGTK+ >= 2.0.0
  • go-webkit2

For instructions on installing these dependencies, see the go-webkit2 README.

To install WebLoop, run: go get github.com/sourcegraph/webloop/...

Usage

Static HTML rendering reverse proxy

The included command static-reverse-proxy proxies a dynamic JavaScript application and serves an equivalent statically rendered HTML website to clients. Run it with:

$ go install github.com/sourcegraph/webloop/...
$ static-reverse-proxy

For example, to proxy a dynamic application at http://example.com and serve an equivalent statically rendered HTML website on http://localhost:13000, run:

$ static-reverse-proxy -target=http://example.com -http=:13000

Run with -h to see more information.

Rendering static HTML from a dynamic, single-page AngularJS app

StaticRenderer is an HTTP handler that serves a static HTML version of a dynamic web application. Use it like:

go
staticHandler := &webloop.StaticRenderer{
        TargetBaseURL:         "http://dynamic-app.example.com",
        WaitTimeout:           time.Second * 3,
        ReturnUnfinishedPages: true
}
http.Handle("/", staticHandler)

See the examples/angular-static-seo/ directory for example code. Run the included binary with:

$ go run examples/angular-static-seo/server.go

Instructions will be printed for accessing the 2 local demo HTTP servers. Run with -h to see more information.

Operating a headless WebKit and running arbitrary JavaScript in the page

…

See webloop_test.go for more examples.

TODO

  • Set up CI testing. This is difficult because all of the popular CI services run older versions of Ubuntu that make it difficult to install WebKitGTK+ >= 2.0.0.
  • Add the ability for JavaScript code to send messages to WebLoop, similar to [PhantomJS's callPhantom] (https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#oncallback) mechanism.

Users

  • WebLoop is used to render static HTML pages on Sourcegraph for search engine crawlers

Contributors

See the AUTHORS file for a list of contributors.

Submit contributions via GitHub pull request. Patches should include tests and should pass golint.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言