douzhang5199 2014-02-08 00:53
浏览 1380
已采纳

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

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

  • 写回答

1条回答 默认 最新

  • dongzz4545 2014-02-09 01:18
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?