awesome-webextension / webpack-target-webextension

WebExtension Target for Webpack 5. Supports code-splitting and HMR.
MIT License
46 stars 5 forks source link

Manifest v3 compatibility #7

Closed Jack-Works closed 3 years ago

Jack-Works commented 3 years ago

Chrome has released Manifest V3 in M88, is there any plan to support it?

crimx commented 3 years ago

I don't see how that would affact webpack-target-webextension?

Jack-Works commented 3 years ago

I'm still blocked by other problems in the manifest v3 so I can't verify if this plugin already works with manifest v3 well. I'll continually tracking on this 👀

crimx commented 3 years ago

This plugin doesn't access the manifest, but you have to make sure that the output scripts are accessible.

{
  // Make sure chunks are accessible.
  // For example, if webpack outputs js and css to `assets`:
  "web_accessible_resources": ["assets/*"],
}
twschiller commented 3 years ago

I think this package will still be compatible with MV3, but will have to be switched over to the new chrome.scripting namespace: https://developer.chrome.com/docs/extensions/reference/scripting/

Example from the API reference: https://developer.chrome.com/docs/extensions/reference/scripting/#files

const tabId = getTabId();
const frameIds = [frameId1, frameId2];
chrome.scripting.executeScript(
    {
      target: {tabId: tabId, frameIds: frameIds},
      files: ['script.js'],
    },
    () => { ... });
crimx commented 3 years ago

Thanks for the input! I'll look into it

Jack-Works commented 3 years ago

Thanks for that, if you can fix the support for manifest v3, that will be cool. I recently don't spend my time investigating support for manifest v3. If you want to support that, FYI here's something to check if it works normally:

Jack-Works commented 3 years ago

I'm working on this. Currently, code splitting is done, but HMR is impossible.

Jack-Works commented 3 years ago

closed by #23