如何创建 EmberJS 应用程序并将其粘贴到 Chrome 中

我正在尝试创建一个基本的 Ember 应用程序,然后坚持使用 Chrome 扩展程序。我希望 Chrome 扩展程序接管该newtab功能。最终目标是在我打开新标签时看到 Ember Welcome App。


这是我的manifest.json:


{

  "manifest_version": 2,

  "name": "My Cool Extension",

  "version": "0.1",

  "description": "Build an Extension!",

  "permissions": ["storage", "activeTab", "geolocation"],

  "background": {

    "scripts": ["background.js"]

  },

  "content_scripts": [

    {

      "matches": [

        "<all_urls>"

      ],

      "js": ["jquery-2.2.4.min.js", "content.js"]

    }

  ],

  "browser_action": {

    "default_icon": {

      "16": "icon.png"

    }

  },

  "chrome_url_overrides": { "newtab": "index.html" }

}

我正在运行 Ember CLI 3.10,这是一个全新的 EmberJS 应用程序。我运行ember build --environment production并复制了 dist 文件夹到我的chrome文件夹中,其中包含我的manifest.json. 我index.html在我的manifest.json. 我遇到的问题是,当我打开一个新页面时,我UnrecognizedURLError: /index.html发现它源自我的指纹vendor.js. 这是为什么?我怎样才能解决这个问题?


慕田峪7331174
浏览 131回答 1
1回答

扬帆大鱼

啊! 我需要在我的文件中设置locationType为:'none'config/environment.jsmodule.exports = function(environment) {&nbsp; let ENV = {&nbsp; &nbsp; modulePrefix: 'my-project',&nbsp; &nbsp; environment,&nbsp; &nbsp; rootURL: '/',&nbsp; &nbsp; locationType: 'none', // changed from 'auto'&nbsp; &nbsp; …&nbsp; }这个想法是禁用 URL 管理。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript