Go-Go中是否可以像webkit一样嵌入Google Chrome浏览器? 使Mac,Windows,Linux兼容?

我需要准备一个Go应用,该应用将用于分发,启动后它将在Go中打开Goog​​le Chrome浏览器 (例如模式窗口或单窗口GUI),并且可以将其部署到Mac,Windows,Linux上执行。</ p>

我尝试使用Go to Google Chrome浏览器执行命令行执行,但这并不能解决 我的问题是重新调整大小/移动/拖动/自定义设计窗口。</ p>

您是否知道Go和Google Chrome浏览器是否有任何有效的稳定绑定? (例如webKit)</ p>

编辑:</ p>

1)如何制作: http://www.youtube.com/watch?v=IhcUWEN6uTY </ p>

2)其他方式: https://groups.google.com/forum/#!topic/golang-nuts / oFhXm4Rx1HM </ p>
</ div>

展开原文

原文

I need to prepare a Go application which will be used for distribution, on launch it will open Google Chrome browser within Go (like modal window or single window GUI) and that can be deployed to Mac, Windows, Linux for execution.

I have tried command line execution with Go to Google Chrome but that does not solve my problem to re-size/move/drag/customized design window.

Any idea if there is any working stable binding for Go and Google Chrome browser? (like webKit)

EDIT:

1) how to make it: http://www.youtube.com/watch?v=IhcUWEN6uTY

2) some other way: https://groups.google.com/forum/#!topic/golang-nuts/oFhXm4Rx1HM

doudou201701
doudou201701 您可以根据Go改善我的答案吗?如果至少可以使该部分正常工作,则可以使用go触发它,并且可以使用一些外部GUI拖动器,移动器,调整大小器来控制那些弹出窗口。
6 年多之前 回复
dounao4179
dounao4179 如果系统未安装GoogleChrome,它将检查runtime.GOOS和runtime.GOARCH并自动进行升级或安装。然后启动它。
6 年多之前 回复
duanfeng3879
duanfeng3879 如果运行您的GO应用程序的系统未安装Chrome怎么办?
6 年多之前 回复

1个回答

1) install nodejs ( http://www.youtube.com/watch?v=ogprXGQWrQk )

$ wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz
./configure && make && make install
$ node --version
v0.10.25
$ node
> 1+1
2

2) Prepare project

$ mkdir /var/tmp/go; cd /var/tmp/go
$ npm init
$ cat >> package.json <\EOF
{
  "name": "go",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "window": {
    "title": "Sample Application 2",
    "toolbar": true,
    "frame": true,
    "width": 850,
    "height": 500",
    "position": "center",
    "resizable": true,
    "icon": "sample.png"
  }
  "author": "",
  "license": "ISC"
}
EOF
$ cat >> index.js <\EOF
Hello world
EOF
$ zip go.nw index.js package.json    

3) Run

A) get node-webkit

$ cd /var/tmp/
$ wget https://s3.amazonaws.com/node-webkit/v0.8.4/node-webkit-v0.8.4-linux-x64.tar.gz;
mv node-webkit-v0.8.4-linux-x64.tar.gz node-webkit;

B) play $ cp /var/tmp/go/go.nw /var/tmp/node-webkit/ $ ./nw go.nw

enter image description here

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐