【问题标题】:what is the correct syntax for node-webkit chromium args?node-webkit chromium args 的正确语法是什么?
【发布时间】:2013-04-30 09:20:59
【问题描述】:

在 node-webkit 的 package.json 文件中,我有:"chromium-args" : "--url="http://www.google.com"" 我尝试使用反斜杠 \"www.google.com\",但使用黑斜杠时 webkit 似乎根本无法打开。如果我不使用黑斜线,webkit 会加载窗口但会产生 JSON 语法错误。

package.json 文件代码:

{
  "main": "index.html",
  "name": "nw-demo",
  "description": "demo app of node-webkit",
  "version": "0.1.0",
  "keywords": [ "demo", "node-webkit" ],
  "window": {
    "icon": "link.png",
    "toolbar": true,
    "width": 800,
    "height": 500,
    "position": "mouse",
    "min_width": 400,
    "min_height": 200,
    "max_width": 800,
    "max_height": 600
  },
  "webkit": {
    "plugin": true
  },
  "chromium-args" : "--url=\"http://www.google.com\""
}

“chromium-args”的正确 json 语法是什么?

【问题讨论】:

    标签: json node-webkit


    【解决方案1】:

    对于“url”,您可以在“main”字段中输入。

    为了引用它可以这样写'--key

    【讨论】:

    • 我用远程网站的 url 替换了我的主要字段,并且按预期工作。在发布我的问题之前,我确实尝试过,但 node-webkit 没有按预期工作。我认为最初的试验和错误我没有正确压缩文件。这次我删除了我的 app.nw 并从头开始。现在 webkit 似乎可以正常工作了。
    【解决方案2】:

    用单引号代替双引号

    "chromium-args" : "--url='http://www.google.com'"

    【讨论】:

      猜你喜欢
      • 2017-07-14
      • 1970-01-01
      • 2014-04-19
      • 2018-11-14
      • 2019-09-07
      • 1970-01-01
      • 1970-01-01
      • 2023-01-25
      相关资源
      最近更新 更多