How can Meteor apps work offline?

Yes! This is already implemented in Meteor, for the most part. If the connection to the server is lost, the client can still function locally. Database writes will appear to succeed on the client and reflect instantly on the screen. Once the connection is re-established Meteor will re-send all the pending method requests to the … Read more

How to check if the user is online using javascript or any library?

I just got this bit of code functionality from a Mozilla Site: window.addEventListener(‘load’, function(e) { if (navigator.onLine) { console.log(‘We\’re online!’); } else { console.log(‘We\’re offline…’); } }, false); window.addEventListener(‘online’, function(e) { console.log(‘And we\’re back :).’); }, false); window.addEventListener(‘offline’, function(e) { console.log(‘Connection is down.’); }, false); They even have a link to see it working. I … Read more

How to install VS2015 Community Edition offline

edit: Starting from visual studio 2017 Microsoft is no longer offering .ISO images. For the new visual studio 2017 you have to download vs_community.exe from here and create an offline instalation folder: vs_community.exe –layout c:\vs2017offline Then, in order to install from that folder you have to first install certificates from \certificates in the download folder … Read more

Dynamically Trigger HTML5 Cache Manifest file?

You dynamically trigger caching by adding an iframe that points to an empty page containing the actual cache manifest. offline.html: <!DOCTYPE html> <html manifest=”offline.appcache”> <head> <title></title> </head> <body> </body> </html> Make sure to add index.html to the cache manifest. Then just add something like: <iframe src=”https://stackoverflow.com/questions/4548342/offline.html” width=”0″ height=”0″> to document.body dynamically to trigger caching.

Best practices for detecting offline state in a service worker

navigator.onLine and the related events can be useful when you want to update your UI to indicate that you’re offline and, for instance, only show content that exists in a cache. But I’d avoid writing service worker logic that relies on checking navigator.onLine. Instead, attempt to make a fetch() unconditionally, and if it fails, provide … Read more

Detect if the internet connection is offline?

Almost all major browsers now support the window.navigator.onLine property, and the corresponding online and offline window events. Run the following code snippet to test it: console.log(‘Initially ‘ + (window.navigator.onLine ? ‘on’ : ‘off’) + ‘line’); window.addEventListener(‘online’, () => console.log(‘Became online’)); window.addEventListener(‘offline’, () => console.log(‘Became offline’)); document.getElementById(‘statusCheck’).addEventListener(‘click’, () => console.log(‘window.navigator.onLine is ‘ + window.navigator.onLine)); <button id=”statusCheck”>Click … Read more

Whats the easiest way to determine if a user is online? (PHP/MYSQL)

Don’t bother with figuring out the differences between timezones. That’s not necessary. Whenever the user accesses a page, update a field in their record of the Users table last-updated-time. Then do a query for all users having a last-updated-time within the last 5 minutes. Anything more than this, and they are considered “offline.” If you … Read more