With a
Service Worker it is trivial to substitute one URL for another. In fact I created demo (non-QuickBase) for a local meetup group that does exactly this:
Demo 3 - Simple Service Worker - Network Proxy - Substitute Responsehttp://dandiebolt.com/sw/demo3.htmlHere is the URL for the
Service Worker and the code:
demo3_sw.js
self.addEventListener("install", event => { });
self.addEventListener("activate", event => {
event.waitUntil(self.clients.claim());
});
self.addEventListener("fetch", event => {
if (event.request.url.match("clubs")) {
event.respondWith(
fetch("images/red_joker.png")
)
}
});
https://dandiebolt.com/sw/demo3_sw.jsIn this case I was just listening for a club card image to be fetched and if so I responded with the red joker image instead. In general It would be simple to change the code to detect particular icon and substitute a custom one. The only issue I can think of off the top of my head is that the icons might be in a sprite so you might have to do a little more work generating the substitute sprite.