Problem
While trying to scan a URL, the application crashes and shows some JavaScript ReferenceErrors. Because of this, the scan does not complete and an error message appears on the screen.
Expected vs Actual Behavior
Expected: The URL should be scanned successfully, the dashboard stats should update, and the Typosquatting Family Tree should be displayed.
Actual: The scan fails and shows "Scan Error: An unexpected error occurred" "Error: Cannot access 'totalScans' before initialization". When checking the browser console, multiple JavaScript errors can be seen.
Steps to Reproduce
Method 1: Using the Deployed Application
- Open the deployed Cybershield application in a browser.
- Enter any valid URL (for example:
https://github.com/Mrinalray/Cybershield_URL) in the input field.
- Click on Scan URL.
- Observe the error message displayed on the page.
- Open the browser developer tools (
F12) and check the console for errors.
Method 2: Using a Local Development Environment
- Clone the repository and set up the project locally.
- Run the application and open it in a browser.
- Enter any valid URL in the scanner input field.
- Click on Scan URL.
- Observe the error message displayed on the page.
- Open the browser developer tools (
F12) and check the console for errors.
Current Behavior
The following errors appear:
-
``
- The script crashes during initialization because it tries to access a DOM element (
#teamGrid) that is not available.
- Due to this, variables like
totalScans are not initialized properly.
-
``
- The code calls
renderFamilyTree(data.typosquatting) while displaying Typosquatting results.
- However, the function does not seem to be defined, which stops further execution.
Expected Behavior
- URL scanning should work without crashing.
- Dashboard statistics such as "URLs Scanned" and "Threats Blocked" should update correctly.
Environment
- Browser: Chrome / Edge
- OS: Windows
- Device: Desktop
Screenshots
Additional Context
While looking into the issue, I already found the solution for it
I would like you to assign this issue under GSSoC to me so that I can submit a PR to fix it.
Problem
While trying to scan a URL, the application crashes and shows some JavaScript
ReferenceErrors. Because of this, the scan does not complete and an error message appears on the screen.Expected vs Actual Behavior
Expected: The URL should be scanned successfully, the dashboard stats should update, and the Typosquatting Family Tree should be displayed.
Actual: The scan fails and shows "Scan Error: An unexpected error occurred" "Error: Cannot access 'totalScans' before initialization". When checking the browser console, multiple JavaScript errors can be seen.
Steps to Reproduce
Method 1: Using the Deployed Application
https://github.com/Mrinalray/Cybershield_URL) in the input field.F12) and check the console for errors.Method 2: Using a Local Development Environment
F12) and check the console for errors.Current Behavior
The following errors appear:
``
#teamGrid) that is not available.totalScansare not initialized properly.``
renderFamilyTree(data.typosquatting)while displaying Typosquatting results.Expected Behavior
Environment
Screenshots
Additional Context
While looking into the issue, I already found the solution for it
I would like you to assign this issue under GSSoC to me so that I can submit a PR to fix it.