【问题标题】:Chrome extension: Permission to use another extensionChrome 扩展程序:使用其他扩展程序的权限
【发布时间】:2018-09-24 20:20:34
【问题描述】:

我正在使用 React 开发 chrome 扩展。我想在开发模式下使用 React devtools,但它不会出现。我尝试在权限中添加chrome://extensions/,但这不是有效的。 我是否缺少启用此功能的东西?此外,一旦添加到中间件中,Redux 开发工具就会出现。

【问题讨论】:

  • 不确定use React devtools in dev mode 与浏览器 UI 页面 chrome://extensions 的关系。你能用截图详细说明或说明问题吗?

标签: reactjs google-chrome-extension react-devtools


【解决方案1】:

要在浏览器扩展中使用 react-devtools,您应该使用 react-devtools 的 standalone version。在您的控制台中运行。

$ npm install --g react-devtools

添加到你的 manifest.json

"content_security_policy": "connect-src ws://localhost:8097"

现在运行react-devtools
不要忘记重新加载您的扩展程序。

附言
如果您不想全局安装react-devtools,可以运行npm install --save-dev react-devtools,然后添加到package.json

"scripts": {
   "react-devtools": "react-devtools"
}

然后运行npm run react-devtools

【讨论】:

    猜你喜欢
    • 2017-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多