Added database for plugins
Added database, ~~cookie manager~~ for plugins Added copying from webview localStorage, sessionStorage
isnt cookie managed by React Native Network?
Yes, they are managed, but you can't interact with them, I made a wrapper under react-native-cookies/cookies, so from the plugin you can add, modify, check, delete site cookies
Yes, they are managed, but you can't interact with them, I made a wrapper under react-native-cookies/cookies, so from the plugin you can add, modify, check, delete site cookies
But is cookie management that important. Instead of remove/edit one cookie, users can just open webview, old cookies will be overrided.
I don't know, but this process can be automated with these functions.
By the way, do you think I need to redo copying from webview of localStorage, sessionStorage objects via java (directly).
Right now it is implemented through injecting js code
I don't know, but this process can be automated with these functions.
Cookies have been already autmatically added by React Native. So I think cookies management isnt neccessary at all.
I think it would be handy to have that option. example What if source has 2 APIs
- with authorization only
- without authorization
How to know if the user is authorized on the site?
Or another example, what if the site for some reason will store in cookies what is needed for queries?
- for the authorization issue, I think you just force users to login via webview like how people are using Novel Updates.
- there's no way a website would decode cookie in client site. security risks
- there's no way a website would decode cookie in client site. security risks
If I'm not mistaken, there is a document. cookie.
Only it stores the cookie for the current page name=value; .
So the client has access to at least read the cookie.
There're some vulnerabilities,I can set/get/delete stored values in plugin A from plugin B code right? Since we had plugin repositories feature, users could be nuked by some trollers
Yes, it's true, it can be fixed. But I don't see the point of fixing it. The running plugin has too many permissions. They could just write something like.
import { MMKV } from 'react-native-mmkv';
const store = new MMKV({ id: 'plugin_db' });
store.clearAll();
Yes, it's true, it can be fixed. But I don't see the point of fixing it. The running plugin has too many permissions. They could just write something like.
import { MMKV } from 'react-native-mmkv'; const store = new MMKV({ id: 'plugin_db' }); store.clearAll();
No, plugin does not have that privilege. They are literally standalone scripts and dont have module accesses.
The import keyword in plugin code is just a hack. import would be converted into declared require function which is refer to https://github.com/LNReader/lnreader/blob/e2d22a5b05a47b57e1f46ccfb6d8dd3ebb05bcc8/src/plugins/pluginManager.ts#L23C1-L38C3
LGTM, Im going to test in devices
You need to resolve Typescript errors. My editor is screaming