define('polyfill', [], function() {
    // polyfill window.location.origin only available in FF21+
    if (!window.location.origin) {
        window.location.origin = window.location.protocol + '//' +
            window.location.hostname +
            (window.location.port ? ':' + window.location.port: '');
    }
});

@@ -100,13 +100,18 @@
     
-if (!
+var loc = 
 wind
@@ -117,24 +117,38 @@
 dow.location
+;%0A    if (!loc
 .origin) %7B%0A 
@@ -158,173 +158,51 @@
     
-window.location.origin = window.location.protocol + '//' +%0A            window.location.hostname +%0A            (window.location.port ? ':' + window.location.port: '')
+loc.origin = loc.protocol + '//' + loc.host
 ;%0A  

bump polyfill