lingua-libre / SignIt

🌻 Lingua Libre SignIt web-browser extension translates selected word in French Sign Language via an elegant pop up so you learn sign language while reading online.
https://addons.mozilla.org/en-US/firefox/addon/lingua-libre-signit/
MIT License
15 stars 15 forks source link

Updating manifest from V2 to V3 #50

Closed kabir-afk closed 10 months ago

kabir-afk commented 10 months ago

This issue had already been addressed and ticked in Issue 21 but for some reason when I cloned it , manifest file had no changes in relation to V3. So I updated the manifest from V2 to V3. I used the extension-manifest-converter , you can check out the repo here : extension-manifest-converter .

The converter seems to follow all the protocols mentioned in Update Manifest but I couldn't wrap my head around background scripts so I just let them be:

Manifest V2

"background": {
    "scripts": [
        "lib/browser-polyfill.min.js",
        "lib/jquery.min.js",
        "lib/banana-i18n.js",
        "background-script.js"
    ]
},

Manifest V3

"background": {
    "service_worker": "service_worker.js"
},

this resulted in making of another directory which had service_worker.js, but it was empty, so I let background scripts remain the same.

Other syntactical changes

Manifest Version:

Manifest V2:

"manifest_version": 2,

Manifest V3:

"manifest_version": 3,

Web Accessible Resources:

Manifest V2:

"web_accessible_resources": [
    "icons/*"
],

Manifest V3:

"web_accessible_resources": [
    {
        "resources": [
            "icons/*"
        ],
        "matches": [
            "<all_urls>"
        ]
    }
],

Content Security Policy (CSP):

Manifest V2: "content_security_policy": "default-src 'self' data: https://lingualibre.org https://*.wikimedia.org https://*.wikipedia.org https://*.wiktionary.org; script-src 'self'; object-src 'self' https://commons.wikimedia.org; style-src 'self' 'unsafe-inline'; img-src 'self' data:" Manifest V3:

"content_security_policy": {
    "extension_pages": "default-src 'self' data: https://lingualibre.org https://*.wikimedia.org https://*.wikipedia.org https://*.wiktionary.org; script-src 'self'; object-src 'self' https://commons.wikimedia.org; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
},

Browser Action Details:

Manifest V2:

"browser_action": {
    "default_icon": "icons/Lingualibre_SignIt-logo-no-text-square-32.png",
    "default_title": "Lingua Libre SignIt",
    "default_popup": "popup/popup.html"
},

Manifest V3:

"action": {
    "default_icon": "icons/Lingualibre_SignIt-logo-no-text-square-32.png",
    "default_title": "Lingua Libre SignIt",
    "default_popup": "popup/popup.html"
},