diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2025-06-15 22:58:32 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2025-06-15 22:58:32 +0530 |
| commit | 920c4837acbba57fb1c51941770586c89436bc61 (patch) | |
| tree | adab786c0b6ef869ee7c062bb3affdda7b43ace3 | |
| parent | 8b7f56048cb8dce1cd41225a059b82b1e782299b (diff) | |
| download | banglar-bhumi-utils-920c4837acbba57fb1c51941770586c89436bc61.tar.gz banglar-bhumi-utils-920c4837acbba57fb1c51941770586c89436bc61.zip | |
Updated README.md + Some minor changes.
| -rw-r--r-- | .github/workflows/release.yml | 2 | ||||
| -rw-r--r-- | README.md | 26 | ||||
| -rw-r--r-- | src/offscreen/ocr/index.js | 4 | ||||
| -rw-r--r-- | src/scripts/captcha/application-receipt.ts | 1 | ||||
| -rw-r--r-- | src/scripts/captcha/know-your-property.ts | 6 | ||||
| -rw-r--r-- | src/shared/generate-web-page.ts | 15 | ||||
| -rw-r--r-- | src/shared/intercept-jquery-ajax.ts | 4 | ||||
| -rw-r--r-- | src/shared/modify-dom.ts | 2 | ||||
| -rw-r--r-- | src/shared/observe-dom.ts | 2 | ||||
| -rw-r--r-- | src/shared/script-injector.ts | 2 | ||||
| -rw-r--r-- | src/shared/styling.ts | 2 |
11 files changed, 45 insertions, 21 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da3ffa2..2d59a06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 # Action to check out your repository code - - name: Setup Node.js (if applicable) + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' # Specify your Node.js version @@ -1,2 +1,24 @@ -# banglar-bhumi-utils -A chrome extension to improve functionality of the banglarbhumi.gov.in website. +# Banglar Bhumi Utils + +A Chrome extension that enhances the functionality of the [banglarbhumi.gov.in](https://banglarbhumi.gov.in) website. + +## Features + +- Automatic captcha filling +- Front-end optimizations +- Additional service functionality + - Download Khatian and plot information as PDF + - Download Mutation application as PDF + +## How to Build +### Requirements +- Node.js (>= 22) +- NPM + +### Building +```sh +git clone https://github.com/arpitchakladar/banglar-bhumi-utils +cd banglar-bhumi-utils +npm install +npm run build +``` diff --git a/src/offscreen/ocr/index.js b/src/offscreen/ocr/index.js index b935024..432811e 100644 --- a/src/offscreen/ocr/index.js +++ b/src/offscreen/ocr/index.js @@ -1,8 +1,8 @@ import Tesseract from "./tesseract.esm.min.js"; let ocrWorker = null; -const WORKER_PATH = chrome.runtime.getURL("/offscreen/ocr/static/worker.min.js"); -const CORE_PATH = chrome.runtime.getURL("/offscreen/ocr/static"); +const WORKER_PATH = chrome.runtime.getURL("offscreen/ocr/static/worker.min.js"); +const CORE_PATH = chrome.runtime.getURL("offscreen/ocr/static"); async function performOcrInOffscreen(dataURL) { if (!ocrWorker) { diff --git a/src/scripts/captcha/application-receipt.ts b/src/scripts/captcha/application-receipt.ts index 5ff1a57..595195e 100644 --- a/src/scripts/captcha/application-receipt.ts +++ b/src/scripts/captcha/application-receipt.ts @@ -1,5 +1,4 @@ document.addEventListener("DOMContentLoaded", () => { $("#werter > div > form > div:nth-child(4)").hide(); (window as any).validateForm = () => true; - const captchaElement = $("#werter > div > div:nth-child(4)"); }); diff --git a/src/scripts/captcha/know-your-property.ts b/src/scripts/captcha/know-your-property.ts index eac33f1..6e11a3f 100644 --- a/src/scripts/captcha/know-your-property.ts +++ b/src/scripts/captcha/know-your-property.ts @@ -1,2 +1,4 @@ -(window as any).validateCaptcha = () => true; -$("#khatianPlotDiv > div:nth-child(6) > div").hide(); +document.addEventListener("DOMContentLoaded", () => { + $("#khatianPlotDiv > div:nth-child(6) > div").hide(); + (window as any).validateCaptcha = () => true; +}); diff --git a/src/shared/generate-web-page.ts b/src/shared/generate-web-page.ts index 1771e15..a07575f 100644 --- a/src/shared/generate-web-page.ts +++ b/src/shared/generate-web-page.ts @@ -1,10 +1,11 @@ -export const generateWebPage = (content: string, title: string = "Banglar Bhumi") => { +export function generateWebPage(content: string, title: string = "Banglar Bhumi") { const tab = window.open("about:blank", "_blank"); - - if (tab) { - tab.document.write(content); - tab.document.close(); - tab.document.title = title; - tab.focus(); + if (!tab) { + return; } + + tab.document.write(content); + tab.document.close(); + tab.document.title = title; + tab.focus(); }; diff --git a/src/shared/intercept-jquery-ajax.ts b/src/shared/intercept-jquery-ajax.ts index efcb555..a77dd44 100644 --- a/src/shared/intercept-jquery-ajax.ts +++ b/src/shared/intercept-jquery-ajax.ts @@ -32,10 +32,10 @@ document.addEventListener("DOMContentLoaded", () => { }; }); -export const interceptPost = (url: string, callback: InterceptJqueryAjaxCallback) => { +export function interceptPost(url: string, callback: InterceptJqueryAjaxCallback) { postIntercepts.push({ url, callback }); }; -export const interceptGet = (url: string, callback: InterceptJqueryAjaxCallback) => { +export function interceptGet(url: string, callback: InterceptJqueryAjaxCallback) { getIntercepts.push({ url, callback }); }; diff --git a/src/shared/modify-dom.ts b/src/shared/modify-dom.ts index 21dfab0..22b8e8e 100644 --- a/src/shared/modify-dom.ts +++ b/src/shared/modify-dom.ts @@ -45,6 +45,6 @@ observeDOM(() => { return false; }); -export const modifyDOM = (modificationRules: DOMModificationRules) => { +export function modifyDOM(modificationRules: DOMModificationRules) { domModificationRules = domModificationRules.concat(modificationRules); }; diff --git a/src/shared/observe-dom.ts b/src/shared/observe-dom.ts index 37bcfcd..e82ce1e 100644 --- a/src/shared/observe-dom.ts +++ b/src/shared/observe-dom.ts @@ -24,6 +24,6 @@ observer.observe(document, { subtree: true }); -export const observeDOM = (callback: ObserveDOMCallback) => { +export function observeDOM(callback: ObserveDOMCallback) { callbacks.push(callback); }; diff --git a/src/shared/script-injector.ts b/src/shared/script-injector.ts index a2139c7..697c8d6 100644 --- a/src/shared/script-injector.ts +++ b/src/shared/script-injector.ts @@ -2,7 +2,7 @@ type DataType = { [key: string]: string }; -export const injectScriptHead = (src: string, data: DataType = {}) => { +export function injectScriptHead(src: string, data: DataType = {}) { const s = document.createElement("script") as HTMLScriptElement; s.src = chrome.runtime.getURL(src); for (const i in data) { diff --git a/src/shared/styling.ts b/src/shared/styling.ts index 3ec25c8..759fecb 100644 --- a/src/shared/styling.ts +++ b/src/shared/styling.ts @@ -1,4 +1,4 @@ -export const styles = (selector: string, styles: { [key: string]: string }) => { +export function styles(selector: string, styles: Record<string, string>) { const elements = Array.from(document.querySelectorAll(selector)) as HTMLElement[]; for (const element of elements) { |
