Forum Discussion
SystemsBVI
8 years agoQrew Assistant Captain
Hi Dan,
So, we can take this javascript as is and add it just like the IOL technique or is there a different way to ingest this javascript into quickbase ?
Thx!
So, we can take this javascript as is and add it just like the IOL technique or is there a different way to ingest this javascript into quickbase ?
Thx!
- _anomDiebolt_8 years agoQrew EliteService Workers have to be registered using code similar to this:
navigator.serviceWorker.register('DBID?act=dbpage&pagename=sw.js');
Once registered a Service Worker sits between your browser and the QuickBase server and listens for domain events and can replace or modify the request and response or processes other events such as going offline, caching, syncing, notifications etc.
The above graphic needs to be updated as Service Workers also work in Edge, UC Browser and are in development for Safari.
Nothing like this has ever been possible before without installing a client side proxy. Service Workers is like god mode for QuickBase and it can modify any aspect of the application. - SystemsBVI8 years agoQrew Assistant CaptainThanks Dan! Do you have a full working demo somewhere on how this registration needs to be done etc ? I am confused on where exactly we would call the registration code?_
- _anomDiebolt_8 years agoQrew EliteThere is a series of posts I wrote called Service Worker Travel Log you can find in the forum. I sort of stopped midway posting to the series as these suckers are so powerful they are difficult to live demo without having an account dedicate to just to the Service Workers. But I assure you the are rightfully called god mode for QuickBase as there is nothing they can't do. But I get tired extolling their virtues as it takes years of promoting techniques such as IOL before it sinks in how powerful these scripting techniques are.
- _anomDiebolt_8 years agoQrew EliteAlso there are four demos I created for a local meetup that demonstrate some basic operation of Service Workers for caching (off line), modify network response and substitute network response. They might not be too useful without the video (it was not recorded) but you might be of some help for your learning.
https://dandiebolt.com/sw/demo1.html
https://dandiebolt.com/sw/demo2.html
https://dandiebolt.com/sw/demo3.html
https://dandiebolt.com/sw/demo4.html
Hint: you have to expose the console and play around with the Service Worker tab in Chrome. - SystemsBVI8 years agoQrew Assistant CaptainIs there an example on how exactly we could bootstrap this within quickbase ? I am trying to go through the series you wrote but am having a difficult time finding the bootstrapping code for this. Anyway you could point me where to see how to bootstrap this in quickbase and then i am sure i can take it forward. Thanks!
- _anomDiebolt_8 years agoQrew EliteOn the dashboard there is a web widget that does the registration of several Service Workers which are individually scoped to a particular table:
view-source:https://haversineconsulting.quickbase.com/db/bmtpmup9q?a=dbpage&pagename=reg.html - _anomDiebolt_8 years agoQrew EliteI just noticed there is some code in the registration page that attempts to register a periodic sync domain event. This is one feature that I do not think is implemented by any browser yet and I probably should remove the code. the sync event (one off) is implemented but periodic sync is not. I think you can just ignore that code.
ServiceWorkerRegistration.periodicSync
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/periodicSync
Background synchronization explained
https://github.com/WICG/BackgroundSync/blob/master/explainer.md - _anomDiebolt_8 years agoQrew EliteBTW here is a presentation I gave two years ago:
QuickBase Service Worker
https://www.dropbox.com/s/j9uum5x66hoef11/QBSW.pdf?dl=0
Some of the information may be stale as there have been a lot of changes since I wrote it.