Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP EXPERIMENTAL: File access in javascript #2280

Closed
wants to merge 4 commits into from

Conversation

harshad1
Copy link
Collaborator

In this PR I am experimenting with adding a 'Markor' api to javascript opened in the webview.

This API will allow reading / writing / navigating the file system from javascript in a webview.

May enable useful extensions to markor by users.

@harshad1
Copy link
Collaborator Author

Not sure if we want to merge this at all. Putting it here to drive discussion.

@gsantner gsantner marked this pull request as draft May 19, 2024 07:23
@gsantner
Copy link
Owner

We should not expose file management features to the web/webview, risky to get misused. Some things might be interesting but it needs to be very very careful if it needs to be.

@@ -62,4 +79,20 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
}
return true;
}

@Override
public void onPageStarted(final WebView view, final String url, final Bitmap favicon) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some added safety I added this to disable file access for non-local files.

Most of this PR is to be looked at as an experiment, not to merged anytime soon :)

@harshad1
Copy link
Collaborator Author

Closing this PR. I want to explore other avenues for enabling more functionality from JS

@harshad1 harshad1 closed this May 22, 2024
@gsantner
Copy link
Owner

gsantner commented May 25, 2024

As usual idea and improvements are welcome. Only need to make sure it not creates high exploitable threats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants