Skip to content

Conversation

@RohitKushvaha01
Copy link
Member

Note: If your HTML file is not inside an opened project folder, it can only access files in the same folder or below it not outside.

For example:

  • Let's say your HTML file is at:
    /sdcard/HelloWorld/html/index.html

Case 1: You open /sdcard/HelloWorld as the project folder

  • Now the HTML file can access:

    • /sdcard/HelloWorld/css/style.css
    • /sdcard/HelloWorld/images/logo.png
    • /sdcard/HelloWorld/html/scripts/app.js
  • But it cannot access:

    • /sdcard/AnotherFolder/data.json
      (because it's outside the project root)

Case 2: No folder is opened in the sidebar or a different folder is opened (just the HTML file)

  • Now the root becomes /sdcard/HelloWorld/html, so the HTML file can only access:

    • /sdcard/HelloWorld/html/scripts/app.js
    • /sdcard/HelloWorld/html/images/logo.png
  • It cannot access:

    • /sdcard/HelloWorld/css/style.css
      (because it’s outside /sdcard/HelloWorld/html)

@RohitKushvaha01 RohitKushvaha01 changed the title Fix html css js Fix html content access May 20, 2025
@UnschooledGamer
Copy link
Member

UnschooledGamer commented May 20, 2025

It cannot access:
/sdcard/HelloWorld/css/style.css
(because it’s outside /sdcard/HelloWorld/html)

For case 2, It's about detecting the parent directory of the file(opened the html file) and limiting the access to it?

Copy link
Member

@UnschooledGamer UnschooledGamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok

@UnschooledGamer UnschooledGamer added the enhancement New feature or request label May 20, 2025
@RohitKushvaha01 RohitKushvaha01 merged commit e4c712d into Acode-Foundation:main May 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants