ModernDeck icon indicating copy to clipboard operation
ModernDeck copied to clipboard

Manifest v3 Support

Open dangeredwolf opened this issue 2 years ago • 1 comments

To be required by Chrome in 2023, Manifest v3 makes some changes that we'll eventually have to adapt to on the extension side

Replacing webRequest with declarativeNetRequest

ModernDeck overwrites TweetDeck's Content-Security-Policy header for several reasons

  • Allow requests to external GIF providers such as Giphy and Tenor where otherwise they would be blocked
  • Block Twitter's Google Analytics and other tracking from the page
  • Ensure all ModernDeck assets can be loaded

For our use case, declarativeNetRequest is actually strongly beneficial, as before to do the same with webRequest API we needed to have a background page to intercept requests. Now the browser is able to handle it without a background process. However, I think declarativeNetRequest should complement webRequest, not replace it.

declarativeNetRequest rules in ModernDeck are located in common/extension/dnr_rules.json

web_accessible_resources changes

This change also adapts to the new web_accessible_resources changes. ModernDeck resources can no longer be snooped on by 3rd party webpages, as they can only be accessed from https://tweetdeck.twitter.com/*

host_permissions

Since host permissions were moved here, the only permission is declarativeNetRequest and the only host_permissions property is https://tweetdeck.twitter.com/*.

Misc

browser_action is now action in Manifest v3

Final Roadblock: Browser support

Firefox doesn't support Manifest v3 at all yet, and it's unclear to me at this point if Safari fully implements it either (Safari 15 does at least implement declarativeNetRequest though). So this will remain as a pull request until the time is right, as we ship you the exact same extension whether you use Chrome, Edge, or Firefox.

Once Manifest v3 is switched to, older browsers will be dropped. It's always a good idea to use an up-to-date browser on an up-to-date operating system.

dangeredwolf avatar Apr 05 '22 20:04 dangeredwolf

Tracking issue for firefox manifest v3 https://bugzilla.mozilla.org/show_bug.cgi?id=1578284

Lunarequest avatar Apr 06 '22 03:04 Lunarequest