Open machawk1 opened 6 years ago
So far, SW is generally being used for enhancement of the experience and not essential for the page to function. However, we need to mask any SW registration in the page for now for the replay to avoid any unwanted behavior.
@ibnesayeed But it could be used for essential functionality, correct? It likely is not now due to its newness, support, accessibility, etc.
It would be interesting to set up some tests for the ipwb SW to evaluate how it behaves with different levels of essentiality mementos' respective SWs.
Perhaps a first step would be to check for the existence of SW code in the memento. This is reminiscent of @N0taN3rd's CNN investigation: http://ws-dl.blogspot.com/2017/01/2017-01-20-cnncom-has-been-unarchivable.html
Yes! (to all your points)
I have added three files in c0507881cac51fd9a73b58fda457ff62d9200d49 (issue-386 branch, in tests/serviceWorkers-386/
) that fundamentally use a service worker when invoked through a user interaction. To use the files:
php -S localhost:8081
http://localhost:8081/sw.html
The DOM should change with the contents of the message returned from the SW after sending it a message.
The next step will be to create a WARC of these three resources then determine how the ipwb serviceWorker interacts/affects the memento's SW. Note that SWs typically requires HTTPS if not on localhost.
A caveat that's bitten me a few times: Chrome is aggressive with caching SWs. Even when told to clear them using devtools, old SW code is used. Incognito helps so long as there are no other incognito windows open, else the same scenario of cached SWs results.
Given we use ServiceWorkers for rewriting, if the JavaScript of a memento uses ServiceWorkers, will the ipwb replay SW still function as expected?