machawk1 / warcreate

Chrome extension to "Create WARC files from any webpage"
https://warcreate.com
MIT License
205 stars 13 forks source link

Adapting code to use manifest v3 #117

Open machawk1 opened 4 years ago

machawk1 commented 4 years ago

https://www.bleepingcomputer.com/news/software/google-begins-testing-extension-manifest-v3-in-chrome-canary/

It will have significant changes to the webRequest API, which WARCreate extensively uses.

machawk1 commented 3 years ago

Now available in Chrome 88 beta per https://blog.chromium.org/2020/12/manifest-v3-now-available-on-m88-beta.html

Note the deprecated of background pages in favor of service workers.

machawk1 commented 3 years ago

The beta still does not read all attributes of Manifest v3. Use the Dev channel build for testing.

machawk1 commented 3 years ago

https://github.com/kentbrew/learning-manifest-v3/blob/master/ep_004.md

machawk1 commented 3 years ago

chrome.tabs.getSelected() has been deprecated per https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/ , so the code needs to be adapted.

machawk1 commented 3 years ago

The usage of chrome.tabs.connect in serviceWorker.js, e.g.,

  let port = chrome.tabs.connect(tab.id, { name: 'getImageData' }) // create a persistent connection
  port.postMessage({ url: tab.url, method: 'getImageData' })

causes an error, observable in the popup's console, that says,

Error handling response: TypeError: Error in invocation of tabs.connect(integer tabId, optional object connectInfo): No matching signature.

In the "Long-Lived Connections" section of https://developer.chrome.com/docs/extensions/mv2/messaging/ , the link to "tabs.connect" is a 404. Attempting to view the signature says, "VM311:1 function connect() { [native code] }".

machawk1 commented 2 years ago

https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/ To be deprecated for existing extensions in January 2023