How to test service worker background sync - service-worker

I'm making a small PWA where a user can type in a text box, and if they lose internet connection for some reason, they can continue typing, leave the page, and then once connection is restored, their latest typing will have synced.
I'm unsure of how I can actually test this on my devbox though. I'm using a node js server and developing using Chrome and Win10.
If I go offline using Chrome's offline toggle in the network tab, the requests are rejected straight away and not queued up (I verified this wasn't just my issue with by using the examples of background sync from the chrome developers page). Windows 10 also won't let me go off a wired connection very easily, and even if I did, the server is still running on localhost, so I would be able to make requests right?
Is the best thing to do deploy it to somewhere like GitHub pages and then remove my ethernet cable? A bit unsure about how I can actually test this.

Switching Network throttling to Offline doesn't have any effect either in Chrome or Chrome Mobile.
Chrome's network status monitor doesn't know about devtools throttling, sadly.
ref: Chromium Issue 609081
However since Chrome 63 it's possible to trigger sync event manually from DevTools > Application > Service Worker > Sync
ref: Chrome 63: Trigger background sync events with custom tags
I'm able test trigger service worker sync event only on Chrome Mobile (inside an emulator) and only by switching Airplane mode to on and later back to off.
For Windows 10 I've filled Issue 803803

Related

Twilio javascript. hourglass shows every few seconds

When we activate a Twilio Client connection using Javascript library, every few seconds the hourglass icon shows up in the pointer. If we destroy the session via code and then reconnect it, the hourglass does not show any more. But a reload of the page brings the problem back. The periodic hourglass distracts the user. Is there any way to turn it off?
We have tried it in Chrome, Edge and Firefox under Windows, with similar results.
The problem does not occurr in OSX Chrome or Safari

I want to block electron app from communicating with outside world

I've developed an electron application and packaged it for windows x32. It's a standalone desktop app, and I want to make sure it doesn't communicate with the outside world. When I launch the compiled application for the first time, I get a prompt message asking me if I'd like to "Allow incoming network connections"
If i say no, I believe the app doesn't run properly as it will be added to my firewall's blacklist. Any advice on what the proper practices for achieving this are?
I want to block any incoming/outgoing traffic to/from my electron app, while ensuring tit runs smoothly.
by allowing incoming connection ,you may get trouble .as you have the Proper firewall to prevent it and you proceed

Can't debug specific app network on iOS

I have used Burp Suite and Charles to debug network using my computer as a proxy. It works with every app and it tracks all network requests, but there's a specific app where it's requests doesn't show up no matter what, does someone have any idea why? If the reason of this is the fact that the app makes SOAP requests, is there a way to track it?

iOS 9 - open resource in web browser on another computer, triggered by tablet

If you had to open a resource from a database in a web browser on another computer, using an Apple tablet app as a remote control, how would you implement such a feature? This is basically what WhatsApp Web does, so it should be technically possible. But how would you go about it?
I'm assuming that you mean a situation where the app modifies something on the server, and the browser then updates automatically to reflect this. If you mean something like the iOS Remote app, then you may have to use another method (and you may not be able to do it from the browser).
To do this you'll have to have a server that both the iOS app and the browser are connected to. When the app does something, it updates the server, e.g. by submitting an HTTP request to a REST API. The server then updates the database.
Now you have to get the browser to update, and there are two ways of going about this. One is by polling the server periodically, using AJAX to update parts of the page dynamically without refreshing the whole page. This works, but there's a lot of overhead and it can be a drain on a laptop battery.
The better, but slightly more difficult to setup, alternative is to use WebSockets. WebSockets allow for two-way communication between server and client, and the connection stays open until one party closes it (or it times out after a long time). The client can submit information to or pull information from the server as before, but the server can also push information to the client without the client having to request it. This would typically be how games, chat clients, etc. can operate nearly in real time.
Setting this up isn't necessarily that difficult, but it's a very broad, open-ended topic that's beyond the scope of just iOS development. Beyond the iOS app and the web client, you'll also need a backend that's capable of using sockets. Node.js is a popular JavaScript-based backend for this sort of application; there are numerous others out there as well. You'll have to do your own research to determine what's right for you.

How to develop a remote access tool for BlackBerry

I need to develop a remote access too so that our support staff can take control of users' devices and fix problems.
I'm not sure where to start. Can anyone please point me in the right direction?
First of all, connectivity, you can try udp connection but it may be
unavailable since there are issues with carrier support, static ip, firewall blocking etc (still if it's internal project, there are BES, BIS and everything, it's the best choice). You can try to listen for data from device over tcp or even http, check for changes and proceed new commands. This may be also achieved over web-services.
Next I would advice to focus on the security, crypting and privileges.
And of course stuff you may need to implement this support:
Scanning active applications
Event logging (and sending to server)
Screen capture (and sending to server)
Event injections (to control user input from server)
After all you will have to setup application permissions.
SO - Sockets and Processes in Java
SO - Web services Security
SO - BlackBerry - background application to listen starts and foreground app
SO - Get a list of all installed applications on Blackberry
SO - BlackBerry - Simulate a KeyPress event
SO - Screenshot tool for BlackBerry?

Resources