aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js23
-rw-r--r--src/manifest.json10
2 files changed, 23 insertions, 10 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index fade66d..5dac1b2 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -29,11 +29,24 @@ class CreateManifestPlugin {
for (const scriptType in this.scripts) {
if (Object.keys(this.scripts[scriptType]).length > 0) {
- this.manifest.content_scripts.push({
- matches: ["https://banglarbhumi.gov.in/*", "http://banglarbhumi.gov.in/*"],
- js: Object.keys(this.scripts[scriptType]).map(scriptName => `${scriptName}.js`),
- run_at: scriptType
- });
+ const currentScripts = this.scripts[scriptType];
+
+ let paths = {};
+ for (const scriptName in currentScripts) {
+ const scriptPath = currentScripts[scriptName];
+ if (!path[scriptPath]) {
+ paths[scriptPath] = [];
+ }
+ paths[scriptPath].push(scriptName);
+ }
+
+ for (const scriptPath in paths) {
+ this.manifest.content_scripts.push({
+ matches: [`*://banglarbhumi.gov.in/${scriptPath}`],
+ js: paths[scriptPath].map(scriptName => `${scriptName}.js`),
+ run_at: scriptType
+ });
+ }
}
}
diff --git a/src/manifest.json b/src/manifest.json
index b8930ae..397ec6e 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,15 +1,15 @@
{
"before": {
- "block-unnecessary": true
+ "block-unnecessary": "*"
},
"injected": {
- "stop-blocking": true
+ "stop-blocking": "*"
},
"injected_and_loaded": {
- "autofill-otps": true,
- "auto-login": true
+ "autofill-otps": "*",
+ "auto-login": "*"
},
"loaded": {
- "autofill-captcha": true
+ "autofill-captcha": "*"
}
}