manifest v3: popup works
- remove webpack-extension-reloader as it doesn't understand service worker - remove content_security_policy - use devtool that doesn't use eval
This commit is contained in:
+13
-9
@@ -3,7 +3,7 @@
|
||||
"short_name": "SimpleLogin",
|
||||
"description": "Easily create a different email for each website to hide your real email. Protect your inbox against spams, phishing, data breaches",
|
||||
"version": null,
|
||||
"manifest_version": 2,
|
||||
"manifest_version": 3,
|
||||
"icons": {
|
||||
"16": "icons/icon_16.png",
|
||||
"32": "icons/icon_32.png",
|
||||
@@ -14,25 +14,29 @@
|
||||
"permissions": [
|
||||
"activeTab",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"contextMenus"
|
||||
],
|
||||
"host_permissions": [
|
||||
"https://*.simplelogin.io/*",
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
],
|
||||
"browser_action": {
|
||||
"action": {
|
||||
"default_title": "SimpleLogin",
|
||||
"default_popup": "popup/popup.html"
|
||||
"default_popup": "popup/popup.html",
|
||||
"default_icon": {
|
||||
"16": "icons/icon_16.png",
|
||||
"32": "icons/icon_32.png",
|
||||
"48": "icons/icon_48.png",
|
||||
"96": "icons/icon_96.png",
|
||||
"128": "icons/icon_128.png"
|
||||
}
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "addon@simplelogin"
|
||||
}
|
||||
},
|
||||
"background": {
|
||||
"scripts": [
|
||||
"background.js"
|
||||
]
|
||||
},
|
||||
"commands": {
|
||||
"generate-random-alias": {
|
||||
"suggested_key": {
|
||||
|
||||
+6
-11
@@ -2,7 +2,6 @@ const webpack = require('webpack');
|
||||
const ejs = require('ejs');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const ExtensionReloader = require('webpack-extension-reloader');
|
||||
const { VueLoaderPlugin } = require('vue-loader');
|
||||
const { version, betaRev } = require('./package.json');
|
||||
const fs = require('fs');
|
||||
@@ -103,7 +102,6 @@ const config = {
|
||||
jsonContent.version = version;
|
||||
|
||||
if (config.mode === 'development') {
|
||||
jsonContent.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self'";
|
||||
jsonContent.permissions = jsonContent.permissions.concat(devConfig.permissions);
|
||||
}
|
||||
|
||||
@@ -179,15 +177,6 @@ if (config.mode === 'production') {
|
||||
]);
|
||||
}
|
||||
|
||||
if (process.env.HMR === 'true') {
|
||||
config.plugins = (config.plugins || []).concat([
|
||||
new ExtensionReloader({
|
||||
manifest: __dirname + '/src/manifest.json',
|
||||
port: 19090
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
function transformHtml(content) {
|
||||
return ejs.render(content.toString(), {
|
||||
...process.env,
|
||||
@@ -195,4 +184,10 @@ function transformHtml(content) {
|
||||
});
|
||||
}
|
||||
|
||||
if (config.mode === 'production') {
|
||||
config.devtool="source-map";
|
||||
} else {
|
||||
config.devtool="cheap-source-map";
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
|
||||
Reference in New Issue
Block a user