I am designing an application that must work regardless of whether or not there is an Internet connection. Most of the time (90%), there will be an Internet connection, in which case it will behave like normal. However some of the time the user will not have Internet, in which case I would like to store all their in-session data to the file system, and whenever an Internet connection becomes available again, allow the user to synchronize the saved data from there disk with the backend server.
My thinking was to have a single-page web app that compiles down to a JS file and in "online mode" gets served up from a web server. But in "offline mode", the user will have to have the JS file saved locally to their machine, and then open it in a browser. The app could auto-detect what mode it is in and either save data to the server (via AJAX) in online mode, or save the data to HTML5 local storage in offline mode.
Is this feasible, or is my total approach incorrect?
The only caveats I can see with it are:
Limited to browsers with HTML5 Local Storage capabilities, but I'm fine with that
Limited to the size of the HTML 5 Local Storage available on the machine
Any other thoughts?
Related
When the user starts my PWA from the iOS start screen (installed PWA) it accesses one instance of storage (IndexedDB, cookies, etc). When he starts the same PWA through Safari it accesses a different storage instance. It is very inconvenient, because from the user perspective he opens the same app, but he doesn't see the same data.
How can I make sure each PWA's data storage is updated when the other makes a change?
To make things more complicated, I can't rely on having an internet connection, so I can't sync my data with a server. And I can't force the user to only start the PWA from the start screen. And I can't use the new File System Access API, because it will annoy the user with file access prompts.
I have a feature in my upcoming web project where I will have to get the UserID/Email ID of the user currently logged in to the machine/PC. Target OS is Windows 10 and logins to the machines are done via Smart Card only. User Data is stored inside MS-AD.
This UserID will be used passed further for Authorization and load the app in browser. The target browser is IE and Chrome.
Is there a way i can fetch the EmailID/UserID of the User logged in via Smart Card to system in Javascript?
ADDITIONAL INFO: The website is setup in private environment. There is no public URL to access the webapp from outside Intranet. The client and backend code is hosted inside VM in Cloud. In nutshell, the is all sitting in private environment in Azure.
Thanks!
Not with JavaScript. JavaScript is run inside the browser container, and more specifically run inside your current webview. Letting JavaScript get access to settings and data on the local machine be a nightmare if phishing, malware and virus sites.
If you know which computers will run your website you could create an application with a server that's running idle on the machine, much like how Spotify's client is doing (the windows client can take commands from the webpage).
The application/server could then try to get the EmailID/UserID from the computer, and then having the server running on some specific port, your JavaScript could then use AJAX-requests to communicate with the local machine from the browser.
I could get the Windows Logged in user using the ActiveX script in IE.
var WinNetwork = new ActiveXObject("WScript.Network");
alert(WinNetwork.UserName)
Will this be a good approach to solve this issue?
I'm just in the design stage of a new project. I'm wondering what technologies one would use to implement a small Progress (or MySQL) database that would allow browsers (on an iPad/iPhone/android or laptop etc) to download the database after they sign into the web page, then they could edit it while online or offline.
If they're online, changes could be updated immediately, but if they're offline they can modify the data locally and as soon as the connection is restored it can upload the data to the server.
Is there a technology available in HTML5 that would allow this to occur?
Are there limits on file size for the data that can be stored locally?
I believe the database will be small, but it may grow in some areas. Because we only need to fetch the data for that specific user, it should be quite minimal. We really want to do this as a web app to ensure cross platform compatibility, perhaps jQuery Mobile or just HTML5 and JavaScript. We would prefer not to have to develop an iOS app, Windows Form program, android app, etc.
I'm creating a mobile application (For IOS, Android) and I first develop it in my browser. I need to use the local storage. I understand that local storage is working for a specific domain (A bit like cookies). The thing is that now when I'm working on the development server I have a domain and local storage is working correctly. What i'm a bit worried is that when I move to Phonegap and run the files locally I might not have access to local storage as there is no domain (a bit like not having cookies when you develop on an IP instead of a domain).
I know that phonegap has it's own storage but I rather not use it now as it's web sql based which is depricated as far as I understood by researching).
So, if the HTML files are local in the Phonegap webview application (not opened from a remote server, but stored locally) can I still use the local storage?
Thanks.
LocalStorage works just fine in a PhoneGap/Cordova app.
Using Dart lang, I've generated an application that stores several list of objects. I'm very happy with the result, congrats to Dart Team, but I have a question:
If I store several data using Chrome, is there any way to read this info from other web browser, i.e. Firefox.
That's why the user works with several web browsers in the same machine, he/she doesn't care which browser is open at that time, he/she wants to use the application in the current opened web browser.
Browsers can't access each other's data directly, but, given your diagram, it looks like IndexedDB is on the shared server and not in the particular browser so I can't see the problem.
If you have your database running on local server and it is accessible only with Dartium and for some reason you don't want or can't compile the browser part to JS(with dart2js) or do something else to make it accessible from the browsers without DartVM. then I can think of 3 ways how to perform browser to browser data transfer without the server(on which application is hosted):
With HTML5 Drag and Drop between browser windows.
Creating WebRTC client\server and transferring the data this way.
Using remote server and simple authentication with Gmail,Facebook etc. [the reasonable way]