Added database for plugins#986
Conversation
|
isnt cookie managed by React Native Network? |
|
Yes, they are managed, but you can't interact with them, |
commit da4d7e8 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Fri Mar 8 13:21:19 2024 +0300 / commit 592c4db Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Fri Mar 8 13:20:34 2024 +0300 test commit 6324050 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Fri Mar 8 12:38:13 2024 +0300 / commit 591d259 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Fri Mar 8 11:42:03 2024 +0300 fix progressbar commit 3d34cfb Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 21:13:49 2024 +0300 forgot commit c36d090 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 20:51:31 2024 +0300 / commit 3c4e43b Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 20:15:38 2024 +0300 / commit 0a20a48 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 19:46:31 2024 +0300 add zIndex commit 7d44901 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 19:27:32 2024 +0300 test commit b585d5e Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 18:28:49 2024 +0300 / commit cb7241c Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 18:06:30 2024 +0300 Update Appbar.tsx commit 5fab766 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 17:55:24 2024 +0300 Update WebviewScreen.tsx commit aec9b92 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 17:15:16 2024 +0300 xd commit 1fa385b Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 17:11:23 2024 +0300 2 commit 589870d Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 16:28:24 2024 +0300 1 commit 343d2dd Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 16:11:08 2024 +0300 test commit f2dbf34 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Thu Mar 7 14:36:48 2024 +0300 test commit 04c04d9 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Wed Mar 6 22:37:45 2024 +0300 test zoom commit 6b80559 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Wed Mar 6 22:33:55 2024 +0300 fix commit 287ce94 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Wed Mar 6 19:00:01 2024 +0300 test commit 67bdddc Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Wed Mar 6 11:10:22 2024 +0300 Test newArch commit 7623537 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Tue Mar 5 20:49:29 2024 +0300 Update Appbar.tsx commit 2a876cb Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Tue Mar 5 20:42:28 2024 +0300 modal commit ba4cade Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Tue Mar 5 16:50:38 2024 +0300 1 commit 6c14a18 Author: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Tue Mar 5 14:54:27 2024 +0300 test
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 |
src/plugins/pluginManager.ts
Outdated
| plugins[_plugin.id] = undefined; | ||
| storage.mmkv.getAllKeys().forEach(key => { | ||
| if (key.startsWith(_plugin.id)) { | ||
| storage.mmkv.delete(key); |
There was a problem hiding this comment.
why do you use mmkv's delete method instead of storage instance's one
There was a problem hiding this comment.
It doesn't have access to localStorage, sessionStorage.
There was a problem hiding this comment.
clearAll(pluginID: string): void {
const keysToRemove = this.getAllKeys(pluginID);
keysToRemove.forEach(key => this.delete(pluginID, key));
}but you declare this
There was a problem hiding this comment.
The storage.getAllKeys function will only return keys that were set using storage.set.
It will not return keys to localStorage, sessionStorage.
(these can only be retrieved via a separate instance and are read-only, example).
|
There're some vulnerabilities,I can set/get/delete stored values in plugin A from plugin B code right? |
|
Yes, it's true, it can be fixed. import { MMKV } from 'react-native-mmkv';
const store = new MMKV({ id: 'plugin_db' });
store.clearAll(); |
Co-authored-by: nyagami <hoangquan05112002@gmail.com>
No, plugin does not have that privilege. They are literally standalone scripts and dont have module accesses. |
|
LGTM, Im going to test in devices |
|
You need to resolve Typescript errors. My editor is screaming |
Added database,
cookie managerfor pluginsAdded copying from webview localStorage, sessionStorage