<p>/*</p><p> Subversion v0.01</p><p> </p><p> */</p><p><br></p><p>subv = (function() {</p><p> var log = console.log</p><p> </p><p> var root = 'file:///bla/bla/bla'</p><p> // https://stackoverflow.com/a/10612311</p><p> root = 'chrome-extension://cffbdnelaahmhckckpgmdjjfekonhojn/subv.main.js'</p><p> var c = {}</p><p> </p><p> var exy = function(what) { if (typeof what != 'undefined') { return true }; return false }</p><p> </p><p> var init = function() {</p><p> // enslave Nexus</p><p> if (exy(Nexus)) { subv.c = Nexus; c = subv.c }</p><p> // inject external</p><p> inject(root, 'script')</p><p> }</p><p> </p><p> var inject = function(datum, type, cb) {</p><p> if (type == 'script') {</p><p> var head = document.getElementsByTagName('head')[0]</p><p> var elem = document.createElement('script')</p><p> elem.src = datum</p><p> elem.onload = function() { log('Completed loading.') }</p><p> head.appendChild(elem)</p><p> }</p><p> if (type == 'css') {</p><p> $('body').append('<div class="subv-rule">­<style>' + rule + '</style></div>')</p><p> }</p><p> }</p><p> </p><p> return {</p><p> c : c,</p><p> init : init,</p><p> inject: inject,</p><p> }</p><p>})()</p><p><br></p><p>subv.init()</p>
Comments
Don't think I'll be going back.
Come join the Achaea discord!
And you won't understand the cause of your grief...
...But you'll always follow the voices beneath.
Tecton-Today at 6:17 PM