cypress-browser-extension-plugin icon indicating copy to clipboard operation
cypress-browser-extension-plugin copied to clipboard

Fix: use path.posix.join instead of path.join for manifest fields

Open PoziWorld opened this issue 6 years ago • 0 comments

Both, Chrome extensions and WebExtensions, use POSIX-style path names.

Currently, on Windows, loader.js' path.join generates invalid paths for background and content_scripts fields:

  "background": {
    "scripts": [
      "scripts/background.js",
      "cypress-extension-hooks\\background.js"
    ],
  },
  "content_scripts": [
    {
      "css": [
        "styles/content-script.css"
      ],
      "js": [
        "scripts/content-script.js"
      ],
      "exclude_matches": [
        "*://*/*/integration/*"
      ]
    },
    {
      "js": [
        "cypress-extension-hooks\\contentscript.js"
      ],
    }
  ],

References: https://developer.chrome.com/extensions/manifest/web_accessible_resources https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources

PoziWorld avatar Oct 20 '19 03:10 PoziWorld