Forum Discussion

_anomDiebolt_'s avatar
_anomDiebolt_
Qrew Elite
8 years ago

New Feature: Custom Frontalot Bar!

New Feature: Custom Frontalot Bar!



Hey QuickBasers - if you are like me you like to listen to nerdcore artist MC Frontalot while working with QuickBase. I decided I liked MC Frontalot so much I wanted to put a custom Frontalot bar atop my QuickBase applications. that will allow me to bring up various MC Frontalot sites while working in QuickBase. 

Just click that green button labeled "reg.html" and all the pages under the path to Table #1 will sport a niffty Frontalot bar

My Frontalot Bar
https://haversineconsulting.quickbase.com/db/bnfetra9x

You can create your very own Frontalot Bar using this simple Service Worker (just modify the markup variable to customize):

self.addEventListener("install", event => {
  event.waitUntil(self.skipWaiting());
});

self.addEventListener("activate", event => {
  event.waitUntil(self.clients.claim());
});

self.addEventListener("fetch", event => {
  if (event.request.mode === "navigate") {
    event.respondWith(
      fetch(event.request).then(response => {
        return response.text().then(body => {
      
          var markup = "";
          markup += '<ul class="MenuBar">';
          markup += '<li><a href="https://frontalot.com/"; target="_blank">MC Frontalot Home</a></li>';
          markup += '<li><a href="https://en.wikipedia.org/wiki/MC_Frontalot"; target="_blank">Wiki MC Frontalot</a></li>';
          markup += '<li><a href="https://twitter.com/mc_frontalotmarkup"; target="_blank">Twiter MC Frontalot</a></li>';
          markup += '<li><a href="https://www.youtube.com/watch?v=fffQjrTCkLI&list=PL8DA214F9587E7F7D"; target="_blank">Youtube MC Frontalot</a></li>'; 
          markup  += '</ul>';

          var respModified = body.replace('<div id="navBars"', markup + '<div id="navBars"');
          return new Response(respModified, {headers: response.headers});
        });
      })
    );
  }
});

BTW here is my favorite MC Frontalot song:

Indier Than Thou by MC Frontalot:
  • Hi Dan,

    I just have a look there. But, could not see Frontalot Bar after registered.

    Thanks,

    Gaurav
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      Try it again. Apparently during the last step of the cleanup I renamed the service worker sw1.html instead of sw1.js. It should work now.