diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-23 14:26:18 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-23 14:26:18 +0530 |
| commit | 3b29d138bee5e98c9536d3606de3e4b5378338f0 (patch) | |
| tree | baddef6b68e970e54404cbfa694811b2aecb8bd1 /config | |
| parent | b7b840319aaf37cd48461e7a578cc859454a29e3 (diff) | |
| download | banglar-bhumi-utils-3b29d138bee5e98c9536d3606de3e4b5378338f0.tar.gz banglar-bhumi-utils-3b29d138bee5e98c9536d3606de3e4b5378338f0.zip | |
Some minor changes.
Diffstat (limited to 'config')
3 files changed, 7 insertions, 9 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js index 8705039..f571986 100644 --- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js +++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js @@ -23,8 +23,10 @@ class CreateManifestPlugin { for (const scriptPath in scripts) { for (const scriptType in scripts[scriptPath]) { const matches = [`*://banglarbhumi.gov.in/BanglarBhumi/${scriptPath}`]; - if (scriptPath !== "*") + + if (scriptPath === "Home") matches.push(`*://banglarbhumi.gov.in/BanglarBhumi/${scriptPath}.action`); + manifest.content_scripts.push({ matches, js: [`scripts/${getFileNameHash(scriptPath)}/${scriptType}.js`], @@ -35,17 +37,15 @@ class CreateManifestPlugin { const resources = []; - for (const assetName in assets) { - if (/^assets\/.*\.(jpg|png|gif)$/.test(assetName)) { + for (const assetName in assets) + if (/^assets\/.*\.(jpg|png|gif)$/.test(assetName)) resources.push(assetName); - } - } if (resources.length > 0) { manifest.web_accessible_resources = [ { resources, - matches: [ "<all_urls>" ] + matches: ["<all_urls>"] } ]; } diff --git a/config/webpack/plugins/inject-script-webpack-plugin/get-injection-code.js b/config/webpack/plugins/inject-script-webpack-plugin/get-injection-code.js index 90a1cb7..6f3c9b3 100644 --- a/config/webpack/plugins/inject-script-webpack-plugin/get-injection-code.js +++ b/config/webpack/plugins/inject-script-webpack-plugin/get-injection-code.js @@ -1 +1 @@ -module.exports = code => `const o=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let e=\`(()=>{${code.replaceAll("`","\\`")}})();\`;null==t.getAttribute("data-replaced")?(t.innerHTML=e,t.setAttribute("data-replaced","")):t.innerHTML+=e,o.disconnect()}});o.observe(document,{childList:!0,subtree:!0});`; +module.exports = code => `(()=>{const o=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let e=\`(()=>{${code.replaceAll("`","\\`")}})();\`;null==t.getAttribute("data-replaced")?(t.innerHTML=e,t.setAttribute("data-replaced","")):t.innerHTML+=e,o.disconnect()}});o.observe(document,{childList:!0,subtree:!0});})();`; diff --git a/config/webpack/utils/format-scripts.js b/config/webpack/utils/format-scripts.js index cfa11bc..0961674 100644 --- a/config/webpack/utils/format-scripts.js +++ b/config/webpack/utils/format-scripts.js @@ -11,7 +11,5 @@ module.exports.formatScripts = scripts => { } } - - return _scripts; }; |
