LNReader / lnreader

Light novel reader for Android.
https://lnreader.github.io
MIT License
1.72k stars 186 forks source link

Grant access of the phone storage to JS/CSS editor #736

Open Palloxin opened 1 year ago

Palloxin commented 1 year ago

Describe your suggested feature

Granting access of the phone storage to js/css editor.

Why

It will allow users to import files from storage. With CSS one could import new fonts directly from the storage with .tts file. One could do this

@font-face {
font-family: 'Merriweather';
src: url("file:///storage/3131-3835/Merriweather.ttf");
}

but this happens image-4

with Js one could import the content of a js file in the storage without the chore of using the in-app js editor(not suited for code editing). In this way every time a chapter is loaded the js will be actively updated while the users edits the file using external means (QuickEdit or other apps). Alas it doesnt work.

Other details

You could make a toggle option to enable/disable js/css editor storage permissions. Maybe in the Advanced section of settings

Acknowledgements

SkillGG commented 1 year ago

You could try adding allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs flags on the WebView object, which could possibly allow for those to be loaded from storage memory. I can't check it though, because I don't have the space for setting up RN right now.

nyagami commented 1 year ago

You could try adding allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs flags on the WebView object, which could possibly allow for those to be loaded from storage memory. I can't check it though, because I don't have the space for setting up RN right now.

I dont think it could work if you dont give app permission to read the files. Because the js files he write/download must belong to other app (Chrome, File Editor, ...), or I just dont know how to create and edit a new file without using app