Follow the Following step to generate Flutter web app as Chrome Extension
Remove all the <script>
tags from web/index.html
and replace with the below code.
<body>
<script src="main.dart.js" type="application/javascript"></script>
</body>
<!DOCTYPE html>
<html style="height: 600px; width: 350px">
{
"name": "flutter_chrome_extension",
"description": "Flutter Chrome Extension",
"version": "1.0.0",
"content_security_policy": {
"extension_pages": "script-src 'self' ; object-src 'self'"
},
"action": {
"default_popup": "index.html",
"default_icon": "icons/Icon-192.png"
},
"manifest_version": 3
}
flutter build web --web-renderer html --csp
Follow the following steps:
Or if you are using edge then edge://extensions
Enable Developer Mode
Click on load unpacked and open the build/web
folder