feat: open new tab on install and add uninstall page

This commit is contained in:
David Ralph
2021-08-14 15:01:45 +01:00
parent 9c3b8c7f59
commit 0f20983c37
5 changed files with 40 additions and 12 deletions

View File

@@ -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')
});
}
});

View File

@@ -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')
});
}
});

View File

@@ -17,5 +17,9 @@
"48": "icons/48x48.png", "48": "icons/48x48.png",
"128": "icons/128x128.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" ]
}
} }

View File

@@ -18,5 +18,9 @@
"chrome_settings_overrides": { "chrome_settings_overrides": {
"homepage": "index.html" "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" ]
}
} }

View File

@@ -11,7 +11,7 @@
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"version": "5.2.0", "version": "5.2.0",
"dependencies": { "dependencies": {
"@emotion/react": "^11.4.0", "@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0", "@emotion/styled": "^11.3.0",
"@fontsource/lexend-deca": "4.4.5", "@fontsource/lexend-deca": "4.4.5",
"@fontsource/montserrat": "4.4.5", "@fontsource/montserrat": "4.4.5",
@@ -28,12 +28,12 @@
"weather-icons-react": "1.2.0" "weather-icons-react": "1.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.8", "@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.14.9", "@babel/eslint-parser": "^7.15.0",
"@babel/plugin-proposal-class-properties": "^7.14.5", "@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-transform-react-constant-elements": "^7.13.15", "@babel/plugin-transform-react-constant-elements": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5", "@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.14.9", "@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.14.5", "@babel/preset-react": "^7.14.5",
"@eartharoid/deep-merge": "^0.0.1", "@eartharoid/deep-merge": "^0.0.1",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.2",
@@ -44,18 +44,18 @@
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-react-app": "^6.0.0", "eslint-config-react-app": "^6.0.0",
"html-webpack-plugin": "^5.3.2", "html-webpack-plugin": "^5.3.2",
"mini-css-extract-plugin": "^2.1.0", "mini-css-extract-plugin": "^2.2.0",
"sass": "^1.37.0", "sass": "^1.37.5",
"sass-loader": "^12.1.0", "sass-loader": "^12.1.0",
"source-map-loader": "^3.0.0", "source-map-loader": "^3.0.0",
"webpack": "^5.47.1", "webpack": "^5.50.0",
"webpack-cli": "^4.7.2", "webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.0.0-rc.0" "webpack-dev-server": "^4.0.0-rc.0"
}, },
"scripts": { "scripts": {
"start": "webpack serve", "start": "webpack serve",
"build": "webpack --mode=production", "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" "firefox": "rm -rf build/_locales && cp manifest/firefox.json build/manifest.json"
}, },
"browserslist": { "browserslist": {