diff --git a/manifest/background-chrome.js b/manifest/background-chrome.js new file mode 100644 index 00000000..35a4b9d0 --- /dev/null +++ b/manifest/background-chrome.js @@ -0,0 +1,10 @@ +/* eslint-disable no-undef */ +chrome.runtime.setUninstallURL('https://muetab.com/uninstall'); + +chrome.runtime.onInstalled.addListener((details) => { + if (details.reason === 'install') { + chrome.tabs.create({ + url: chromeruntime.getURL('index.html') + }); + } +}); diff --git a/manifest/background-firefox.js b/manifest/background-firefox.js new file mode 100644 index 00000000..286b64a1 --- /dev/null +++ b/manifest/background-firefox.js @@ -0,0 +1,10 @@ +/* eslint-disable no-undef */ +browser.runtime.setUninstallURL('https://muetab.com/uninstall'); + +browser.runtime.onInstalled.addListener((details) => { + if (details.reason === 'install') { + browser.tabs.create({ + url: browser.runtime.getURL('index.html') + }); + } +}); diff --git a/manifest/chrome.json b/manifest/chrome.json index b331f54b..1c7abf12 100644 --- a/manifest/chrome.json +++ b/manifest/chrome.json @@ -17,5 +17,9 @@ "48": "icons/48x48.png", "128": "icons/128x128.png" }, - "content_security_policy": "script-src 'self' https://api.bing.com https://www.google.com; object-src 'self'" + "content_security_policy": "script-src 'self' https://api.bing.com https://www.google.com; object-src 'self'", + "background": { + "persistent": false, + "scripts": [ "background-chrome.js" ] + } } diff --git a/manifest/firefox.json b/manifest/firefox.json index 39620958..95f51039 100644 --- a/manifest/firefox.json +++ b/manifest/firefox.json @@ -18,5 +18,9 @@ "chrome_settings_overrides": { "homepage": "index.html" }, - "content_security_policy": "script-src 'self' https://api.bing.com https://www.google.com; object-src 'self'" + "content_security_policy": "script-src 'self' https://api.bing.com https://www.google.com; object-src 'self'", + "background": { + "persistent": false, + "scripts": [ "background-chrome.js" ] + } } diff --git a/package.json b/package.json index 8f62fc89..899acdc2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "license": "BSD-3-Clause", "version": "5.2.0", "dependencies": { - "@emotion/react": "^11.4.0", + "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fontsource/lexend-deca": "4.4.5", "@fontsource/montserrat": "4.4.5", @@ -28,12 +28,12 @@ "weather-icons-react": "1.2.0" }, "devDependencies": { - "@babel/core": "^7.14.8", - "@babel/eslint-parser": "^7.14.9", + "@babel/core": "^7.15.0", + "@babel/eslint-parser": "^7.15.0", "@babel/plugin-proposal-class-properties": "^7.14.5", - "@babel/plugin-transform-react-constant-elements": "^7.13.15", - "@babel/plugin-transform-runtime": "^7.14.5", - "@babel/preset-env": "^7.14.9", + "@babel/plugin-transform-react-constant-elements": "^7.14.5", + "@babel/plugin-transform-runtime": "^7.15.0", + "@babel/preset-env": "^7.15.0", "@babel/preset-react": "^7.14.5", "@eartharoid/deep-merge": "^0.0.1", "babel-loader": "^8.2.2", @@ -44,18 +44,18 @@ "eslint": "^7.32.0", "eslint-config-react-app": "^6.0.0", "html-webpack-plugin": "^5.3.2", - "mini-css-extract-plugin": "^2.1.0", - "sass": "^1.37.0", + "mini-css-extract-plugin": "^2.2.0", + "sass": "^1.37.5", "sass-loader": "^12.1.0", "source-map-loader": "^3.0.0", - "webpack": "^5.47.1", + "webpack": "^5.50.0", "webpack-cli": "^4.7.2", "webpack-dev-server": "^4.0.0-rc.0" }, "scripts": { "start": "webpack serve", "build": "webpack --mode=production", - "chrome": "cp manifest/chrome.json build/manifest.json && cp -r manifest/_locales build/_locales", + "chrome": "cp manifest/chrome.json build/manifest.json && cp -r manifest/_locales build/_locales && cp manifest/background-chrome.js build/background-chrome.js", "firefox": "rm -rf build/_locales && cp manifest/firefox.json build/manifest.json" }, "browserslist": {