Share greasemonkey script and database between Windows and Android Firefox - android

I've been using a homemade greasemonkey scripts for ages on my laptop Firefox. It includes storing data with GM.setValue.
Now I just bought an Android tablet, and would like to be able to use this script and update the values, whereas I'm using the laptop or the tablet.
Hoped that Firefox Sync would handle that, but not even the scripts are synced.
I thought of synchronizing the script dans db files (Google drive, dropbox, whatever), but I realized that since the v4, the db that used to be in gm_scripts is gone, and I have no idea where Greasemonkey stores either the scripts or their associated database now.
I'm looking for anything that might make it work.
1) Is there a way to handle that with Firefox Sync ?
2) Would an alternative (Tampermonkey, Violentmonkey, ?) handle that better ?
3) Where can I find the scripts/database in the new Greasemonkey system ?
4) Could I synchronize them via Google drive ? (There seem to be some hacks to sync a file between machines)
5) Would there be a simple, free alternative that would allow me to synchronize a very small file between machines ?
===============================================
Update on this:
I tried TamperMonkey instead, it has a sync feature but even if it seems ok on different laptops or my phone, the syncing is random at best on the tablet.
Also realized that only scripts are synced, and not their data. The script almost never changes, but the data is updated several times a day, so not really a solution anyway.
Data doesn't exist anymore in a readable file format, so no luck either on syncing the data file externally.
TamperMonkey has also an import/export feature, this does take the data into account. So the best I can do for now is thinking about exporting then importing every time I switch device. Not ideal so still in search of a better solution.

Conclusion:
1-2) I switched to TamperMonkey where I could easily up/download scripts from Google Drive (or other).
3-4-5) New browser extensions architecture means that you basically can't access the data on file system
The only solution is to store/retrieve data elsewhere, not with the GM methods. I stored mine in an airtable base, because it offers a pretty easy to use API that can be called from user scripts.

storage.sync
Represents the sync storage area. Items in sync storage are synced by
the browser, and are available across all instances of that browser
that the user is logged into (e.g. via Firefox sync, or a Google
account), across different devices.
There are limitations with sync.
Sync requires login
Up to 100kb can be synced and more than that fails
Storage sync usually syncs the entire extension storage and in case of user-script managers, they are often larger than 100kb as they include the user-scripts as well
Data is stored elsewhere (not on your computer) which can have security/privacy concerns
Storage read/write requires internet access and longer times due to remote data storage
Extension must have the sync option
1) Is there a way to handle that with Firefox Sync ?
Yes but depends on aforementioned. While Firefox sync doesn't appear to have the 100kb limit, syncing the entire Firefox takes longer (How do I set up Sync on my computer?).
2) Would an alternative (Tampermonkey, Violentmonkey, ?) handle that better ?
Greasemonkey: No sync feature
Tampermonkey: Sync to Dropbox, Google Drive, or a WebDAV service
Violentmonkey: Sync to Dropbox, OneDrive, Google Drive, or a WebDAV service
Firemonkey: No sync feature
TM/VM 3rd party storage sync allows storage of more than 100KB. However, using 3rd party storage allows 3rd party tracking which is a privacy consideration. The storage read/write operation is also a lot slower.
3) Where can I find the scripts/database in the new Greasemonkey system ?
Since Firefox 57, extensions can not save files to the HD and the only storage area is the extension storage which is not accessible as before.
4) Could I synchronize them via Google drive ? (There seem to be some hacks to sync a file between machines)
Refer to above
5) Would there be a simple, free alternative that would allow me to synchronize a very small file between machines ?
That depends on the set-up and how often data is changed.
For example, if data is not often changed, especially if the data privacy is imperative, there is the backup export/import option (script + data). Therefore, the extension data can be saved to a USB flash drive and loaded anywhere (suitable for shared environment).

Related

On Android, what folders will "sync" automatically?

On iOS, there's the FILES app, and if your app writes anything to it, it'll propagate to all devices.
I notice in the Google Files app, there's a "documents" folder. If I give the user the option to save data into that folder, will it automatically sync between their devices in the same was iOS does? I'm looking for the simplest way to give the user the option to save their data somewhere that will sync to all their devices.
The closest thing is autobackup. This is meant for installing an app on a device, or uninstalling and later reinstalling. It isn't really meant for syncing, as figuring out conflicts without being the app developer would be nearly impossible. Cache coherency is a hard problem. THe docs for Google's Auto Backup feature are at https://developer.android.com/guide/topics/data/autobackup
Anything stored in the app's internal or external storage will be saved, as well as any dbs in the default db directory and any shared preference files. Files in the cache directories are not backed up. There is a 25 MB limit per app for backup. If you are over 25 MB, your app will be notified but no backups will be made until you're under 25 MB again.

Android APK using external data

Hi i am looking into an android development , as we all know when we build the project it makes an APK that is the whole program. but is it possible to make a an android project / APK that would be able to use external files to include more info into the project.
like say for example i have a list commands or functions in my list , but i dont want it to be added into my APK build , is it possible to use it externally?
i was curious because something like COC and other games after downloading it , then downloads extra data from the net , more into updates for the whole game.
how is this possible or is it possible to do , and use functions or source codes externally and not include it into the APK , and also the proper usage of it
Any Android App can connect to the Internet and save downloaded data files to use as they need, without requiring to include them inside the APK. Indeed, for many games (and other Apps having large data sets), it's a sensible option.
There are a couple of things to be aware of:
Android restricts where (on the filesystem) you can save files. And no matter where you save the files, the user can delete them at any
time. Your App should be able to cope with this.
The files should only ever be data files - not executable code. Attempting to
execute downloaded files is likely to put your users at risk
(depending on the permissions your App was installed with) and is also likely to get your App marked as malware.
You should read the Android documentation on Data Storage to learn a bit more about it.

how can i keep a folder in my mobile storage and a folder in my dropbox space in Sync?

i have developed a android app for farmers. it is a informative app for indian farmer.The users will be sending me the images and video files to me through my app. here i used (integrated) dropbox to receive those files directly to my dropbox space. whatever the image or video taken by the user, it will be stored on a folder in my mobile storage. Here what i want is, i want the folder in my mobile storage to be in sync with the folder in my dropbox.
How can i do this?
there is a app in market called Foldersync which exactly fulfil my requirement. how they are doing it? How can i keep a folder in my mobile storage and a folder in my dropbox to be in Sync?
Note :
i have gone through drop-box api and created a simple app to send files directly to my dropbox space and i know how to download a entire folder from dropbox.
But here my question is unique from that... pls don't answer the above points which i already know..
Please help!
Thank You
You can use the Dropbox API to keep a local client in sync with Dropbox. There are two main pieces to this:
1) Metadata:
Assuming you're using the Core API, the best way to get information about all of the file and folders in an account (or optionally under a specific path) is to use /delta:
https://www.dropbox.com/developers/core/docs#delta
With this, you can get information about everything your app can see, and then easily stay up to date with changes. There are some useful blog posts on using /delta here:
https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/
https://blogs.dropbox.com/developers/2013/12/filtering-dropbox-delta-results-by-path/
2) File content:
Using the metadata retrieved from #1, you can download any files you need access to locally using /files (GET):
https://www.dropbox.com/developers/core/docs#files-GET
You can upload locally changed files using /files_put:
https://www.dropbox.com/developers/core/docs#files_put
Or, for larger files, use chunked uploading:
https://www.dropbox.com/developers/core/docs#chunked-upload
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
The main work here will involve programming the logic in your app to correctly receive changes from the server as well as upload local changes, in order to keep everything in sync.
Also, be aware that on mobile devices, bandwidth can be limited and/or expensive, so be careful to not accidentally automatically download a lot of data the user doesn't want or need.

Share data between users on multi-user Android (4.2 or later)

Android introduced the Multiple Users feature in 4.2 (Jelly Bean MR1) and its documentation states:
From your app’s point of view, each user is running on a completely separate device.
And here is a quote from the Environment.getExternalsStorageDirectory() and getExternalStoragePublicDirectory() methods doc:
On devices with multiple users (as described by UserManager), each user has their own isolated external storage. Applications only have access to the external storage for the user they're running as.
Could it be true that there really is no reliable way to communicate data between users on a single device without using the network as mediator? I'm looking for solutions that don't rely on quirks of how the device's file system is laid out by a manufacturer. Also, for security, the sharing should be internal to my app.
Even if file sharing is indeed impossible, is communication via intents somehow possible?
There are use cases for this. Use Case 1: let's say I'm writing an input method app that requires a 100MB dictionary file. I'd like to code things so that if User A downloads this file, then User B can access it also without needing to re-download. Use Case 2: let's say I'm writing a fun Leave My Wife a Note app that allows User A to type messages that will appear next time User B logs in (without using the network).
This thread on a separate site proposes a solution, but their method seems undocumented and possibly unreliable. And there are a few other SO questions that have a title similar to this one but are actually discussing different topics.
OBB Folder (/sdcard/Android/obb) is used to share files and folder between the multi users. But OBB folder not shown in my second user (One plus 5 mobile). So I have tried to create an OBB folder in Android folder (/sdcard/Android/) in second user and "BOOM" it worked. Now i am able to access the shared files in second user. Try this trick if OBB folder not shown in your second user.
OBB files (stored in /sdcard/Android/obb) and used as expansion files in Google Play are shared between all users by design, as they are fairly large. If you Input method uses expansion files, the downloaded data will be shared automatically. You can send broadcasts to other users but that requires the INTERACT_ACROSS_USERS permission, which is reserved for system applications.
I also had the same question, and have tried various approaches such as using /sdcard/Android/obb but it does not work in Android 10. So I followed below approach, and I am able to copy files seamlessly between users.
Login to the User from where you would like to copy files from (lets call U1)
Run FTP Server using any application of choice like MiXplorer / ES Explorer etc... Note down the details of the port#, username, password etc... and point it to /sdcard
Switch user, to where you want to copy files to (lets call U2)
Install the FTP browser. If you use MiXplorer / ES Explorer, they will allow you to add a FTP share
Use ftp://localhost:2121 assuming the port is 2121, if not change it accordingly and add the FTP share
Open the FTP share and you can see all the files & folders of U1 here
Copy across to your heart's content !

What kind of database/storage does google keep chrome app use?

Am looking to build an app that would function like google keep.
just a light brush of the features:
Chrome app with offline storage - save online when internet is available
Android app and ios that would sync with the web server and also update locally and online
-single user
Am thinking that I would have a bridge(SERVER) of some sort to handle the imports and exports of data between different platforms. Thus emulate a sync.
Keep uses IndexedDB as it is the standard datastore available to Chrome Apps. You should be able to right-click on the screen and see the code (visit the Resources tab).
Chrome Apps also has Synchronised Storage that will manage offline and cloud access to your data storage. This means you can set a key on one machine the user has and see it updated immediately on the other machine of the user. The problem is that if you as a developer want to access and manage this data you can't do it, which is why Keep chose to use IndexedDB and manage the synchronisation themselves.
Ay used Index DB but it saves the content somewhere as indexdb only saves to the local computer. SO needs to be saved somewhere else.

Categories

Resources