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",
|
"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",
|
"description": "Easily create a different email for each website to hide your real email. Protect your inbox against spams, phishing, data breaches",
|
||||||
"version": null,
|
"version": null,
|
||||||
"manifest_version": 2,
|
"manifest_version": 3,
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icons/icon_16.png",
|
"16": "icons/icon_16.png",
|
||||||
"32": "icons/icon_32.png",
|
"32": "icons/icon_32.png",
|
||||||
@@ -14,25 +14,29 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
"activeTab",
|
"activeTab",
|
||||||
"storage",
|
"storage",
|
||||||
"contextMenus",
|
"contextMenus"
|
||||||
|
],
|
||||||
|
"host_permissions": [
|
||||||
"https://*.simplelogin.io/*",
|
"https://*.simplelogin.io/*",
|
||||||
"http://*/*",
|
"http://*/*",
|
||||||
"https://*/*"
|
"https://*/*"
|
||||||
],
|
],
|
||||||
"browser_action": {
|
"action": {
|
||||||
"default_title": "SimpleLogin",
|
"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": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "addon@simplelogin"
|
"id": "addon@simplelogin"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"background": {
|
|
||||||
"scripts": [
|
|
||||||
"background.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"commands": {
|
"commands": {
|
||||||
"generate-random-alias": {
|
"generate-random-alias": {
|
||||||
"suggested_key": {
|
"suggested_key": {
|
||||||
|
|||||||
+7
-12
@@ -2,7 +2,6 @@ const webpack = require('webpack');
|
|||||||
const ejs = require('ejs');
|
const ejs = require('ejs');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const ExtensionReloader = require('webpack-extension-reloader');
|
|
||||||
const { VueLoaderPlugin } = require('vue-loader');
|
const { VueLoaderPlugin } = require('vue-loader');
|
||||||
const { version, betaRev } = require('./package.json');
|
const { version, betaRev } = require('./package.json');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
@@ -102,8 +101,7 @@ const config = {
|
|||||||
const jsonContent = JSON.parse(content);
|
const jsonContent = JSON.parse(content);
|
||||||
jsonContent.version = version;
|
jsonContent.version = version;
|
||||||
|
|
||||||
if (config.mode === 'development') {
|
if (config.mode === 'development') {
|
||||||
jsonContent.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self'";
|
|
||||||
jsonContent.permissions = jsonContent.permissions.concat(devConfig.permissions);
|
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) {
|
function transformHtml(content) {
|
||||||
return ejs.render(content.toString(), {
|
return ejs.render(content.toString(), {
|
||||||
...process.env,
|
...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;
|
module.exports = config;
|
||||||
|
|||||||
Reference in New Issue
Block a user