can you put that svg as in place of base64 image, will firefox addon support…
- User
can you put that svg as in place of base64 image, will firefox addon support it?:
- Assistant
- User
There was an error during the temporary add-on installation. Error details
Unsupported manifest version: 3: { "manifest_version": 3, "name": "Auto Clear Data", "version": "1.0", "description": "Automatically clears cache, cookies, localStorage, indexedDB, and service worker registrations after a specified time interval.", "permissions": ["<all_urls>", "storage", "browsingData", "cookies", "notifications"], "action": { "default_popup": "popup.html", "default_icon": { "48": "icon48.png" // Add an icon file with this name and size in the same directory } }, "background": { "service_worker": "cleardata.js" } }
- Assistant
It appears that you are trying to install a temporary extension with Manifest V3 in Mozilla Firefox. As of now, Firefox only supports Manifest V2 in their extensions.
You can either downgrade your manifest to V2 to make it compatible, or you can wait for Firefox to support Manifest V3 in the future. Here's your manifest file modified to V2:
{ "manifest_version": 2, "name": "Auto Clear Data", "version": "1.0", "description": "Automatically clears cache, cookies, localStorage, indexedDB, and service worker registrations after a specified time interval.", "permissions": ["<all_urls>", "storage", "browsingData", "cookies", "notifications"], "browser_action": { "default_popup": "popup.html", "default_icon": { "48": "icon48.png" } }, "background": { "scripts": ["cleardata.js"] } }Please note that if you use the Manifest V2 version, you may need to adjust your code in
cleardata.jsor other files to ensure compatibility with V2 API differences. Also, remember to add the icon file "icon48.png" to the same directory. - User
Content Security Policy: Couldn’t process unknown directive ‘script-src-elem’Content Security Policy: The page’s settings blocked the loading of a resource at data: (“media-src”).Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). moz-extension:77:16
- Assistant
The error messages you're encountering are due to Content Security Policy (CSP) restrictions. The extension is blocking inline JavaScript execution and media requests with the
data:protocol.To fix these issues, follow these steps:
- Create a separate JavaScript file, e.g.,
popup.js, and move the inlineonclickJavaScript code from the HTML file to the new JavaScript file:
popup.js:document.addEventListener('DOMContentLoaded', () => { const clearDataButton = document.getElementById('clear-data-button'); clearDataButton.addEventListener('click', clearData); });- Replace the
onclickattribute on your<svg>tag with anidattribute:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="clear-data-button" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512; cursor:pointer;" xml:space="preserve"> ... </svg> - Create a separate JavaScript file, e.g.,