-
Notifications
You must be signed in to change notification settings - Fork 198
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
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 <[email protected]> Date: Fri Mar 8 13:21:19 2024 +0300 / commit 592c4db Author: Rider21 <[email protected]> Date: Fri Mar 8 13:20:34 2024 +0300 test commit 6324050 Author: Rider21 <[email protected]> Date: Fri Mar 8 12:38:13 2024 +0300 / commit 591d259 Author: Rider21 <[email protected]> Date: Fri Mar 8 11:42:03 2024 +0300 fix progressbar commit 3d34cfb Author: Rider21 <[email protected]> Date: Thu Mar 7 21:13:49 2024 +0300 forgot commit c36d090 Author: Rider21 <[email protected]> Date: Thu Mar 7 20:51:31 2024 +0300 / commit 3c4e43b Author: Rider21 <[email protected]> Date: Thu Mar 7 20:15:38 2024 +0300 / commit 0a20a48 Author: Rider21 <[email protected]> Date: Thu Mar 7 19:46:31 2024 +0300 add zIndex commit 7d44901 Author: Rider21 <[email protected]> Date: Thu Mar 7 19:27:32 2024 +0300 test commit b585d5e Author: Rider21 <[email protected]> Date: Thu Mar 7 18:28:49 2024 +0300 / commit cb7241c Author: Rider21 <[email protected]> Date: Thu Mar 7 18:06:30 2024 +0300 Update Appbar.tsx commit 5fab766 Author: Rider21 <[email protected]> Date: Thu Mar 7 17:55:24 2024 +0300 Update WebviewScreen.tsx commit aec9b92 Author: Rider21 <[email protected]> Date: Thu Mar 7 17:15:16 2024 +0300 xd commit 1fa385b Author: Rider21 <[email protected]> Date: Thu Mar 7 17:11:23 2024 +0300 2 commit 589870d Author: Rider21 <[email protected]> Date: Thu Mar 7 16:28:24 2024 +0300 1 commit 343d2dd Author: Rider21 <[email protected]> Date: Thu Mar 7 16:11:08 2024 +0300 test commit f2dbf34 Author: Rider21 <[email protected]> Date: Thu Mar 7 14:36:48 2024 +0300 test commit 04c04d9 Author: Rider21 <[email protected]> Date: Wed Mar 6 22:37:45 2024 +0300 test zoom commit 6b80559 Author: Rider21 <[email protected]> Date: Wed Mar 6 22:33:55 2024 +0300 fix commit 287ce94 Author: Rider21 <[email protected]> Date: Wed Mar 6 19:00:01 2024 +0300 test commit 67bdddc Author: Rider21 <[email protected]> Date: Wed Mar 6 11:10:22 2024 +0300 Test newArch commit 7623537 Author: Rider21 <[email protected]> Date: Tue Mar 5 20:49:29 2024 +0300 Update Appbar.tsx commit 2a876cb Author: Rider21 <[email protected]> Date: Tue Mar 5 20:42:28 2024 +0300 modal commit ba4cade Author: Rider21 <[email protected]> Date: Tue Mar 5 16:50:38 2024 +0300 1 commit 6c14a18 Author: Rider21 <[email protected]> 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
@@ -119,6 +121,11 @@ const installPlugin = async (url: string): Promise<Plugin | undefined> => { | |||
|
|||
const uninstallPlugin = async (_plugin: PluginItem) => { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you use mmkv's delete method instead of storage instance's one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have access to localStorage
, sessionStorage
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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