feat: chrome extension migrate to manifest v3

This commit is contained in:
Anoop M D 2022-10-17 18:18:27 +05:30
parent d91ee36192
commit 075e9162c2
3 changed files with 56 additions and 55 deletions

View File

@ -1,4 +1,3 @@
(function () {
let currentTab = {
id: null,
url: null,
@ -30,7 +29,7 @@
}
// Open the extension tab when the extension icon is clicked
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.action.onClicked.addListener(function (tab) {
if (!currentTab || !currentTab.id) {
createNewTab();
} else {
@ -51,4 +50,3 @@
currentTab = {};
}
});
})();

View File

@ -1,5 +1,5 @@
{
"manifest_version": 2,
"manifest_version": 3,
"version": "0.1.0",
"name": "Bruno API Client",
"short_name": "Bruno",
@ -10,17 +10,17 @@
"128": "assets/images/logo-128x128.png"
},
"background": {
"scripts": [
"js/background.js"
]
"service_worker": "js/background.js"
},
"browser_action": {
"action": {
"default_icon": "assets/images/logo-128x128.png"
},
"permissions": [
"http://*/",
"https://*/",
"tabs",
"storage"
],
"host_permissions": [
"http://*/",
"https://*/"
]
}

View File

@ -17,7 +17,10 @@ cp -r packages/bruno-chrome-extension/* chrome-extension
# Filenames starting with "_" are reserved for use by the system
mv chrome-extension/_next chrome-extension/next
sed -i 's@/_next/@/next/@g' chrome-extension/**.html
sed -i'' -e 's@/_next/@/next/@g' chrome-extension/**.html
# Remove sourcemaps
find chrome-extension -name '*.map' -type f -delete
# Compress the chrome-extension directory into a zip file
zip -r bruno.zip chrome-extension