Q:

AngularJS routing doesn't work in Safari Extension

I have a very simple AngularJS app that I'm using to test the creation of a new Safari Extension. When I run it from localhost in a regular Safari page all works, but when I run the same code in the context of an extension routing is not working. 
I have spent some time tracing the Angular routing code in both scenarios (which is kind of fun) to try to find differences but have not been able to except for the redirect path (http://localhost/.../helloworld.html#/login vs. safari-extension://com.yourcompany.../helloworld.html#/login). Hitting the extension path directly in a browser window renders the same thing I'm seeing in the extension - basic AngularJS functionality is working (updating "sometext") but routing is not (the route specification doesn't replace the ng-view). No errors are being thrown. 
helloworld.html
<!DOCTYPE html>
<html ng-app="obApp">
<head>
  <title>Hello World, AngularJS</title>
  <script type="text/javascript" src="angular.js"></script> 
  <script type="text/javascript" src="angular-route.js"></script> 
  <script type="text/javascript" src="app.js"></script> 
  <script type="text/javascript" src="controllers.js"></script> 
</head>
<body>
  Write some text in textbox:
  <input type="text" ng-model="sometext" />

  <h1>Hello {{ sometext }}</h1>

  <div ng-view></div>
</body>
</html>

app.js
var obApp = angular.module('obApp', ['ngRoute', 'obControllers']);

obApp.config(['$routeProvider',
  function($routeProvider) {
    $routeProvider.
        when('/login', {
            templateUrl: 'login.html',
            controller: 'LoginCtrl'
        }).
        otherwise({
            redirectTo: '/login'
        });
}]);

controllers.js
var obControllers = angular.module('obControllers', []);

obControllers.controller('LoginCtrl', ['$scope',
    function($scope) {
        // do stuff
    }
]);

login.html
HERE I AM!

UPDATE:
It has something to do with the XHR request to get the routing page - from a regular web page the XHR.send() returns readyState=4 and status=200, from the extension it returns readyState=3 and status=0 (when it moves to readyState=4 status is still 0). It makes me suspect cross-origin XMLHTTPRequest restrictions but it's definitely requesting the page from the exact same domain (safari-extension://...)
HELP!  :-)

A:

I'm answering my own question here because it looks like this is how I'm going to need to proceed, but if someone has a better idea please let us know. 
I've hacked the AngularJS core library (ugh) to return a status of 200 if there is a response to the request under the condition of the location protocol being "safari-extension" (otherwise return 404). The authors did the same for the condition of the protocol being "file" because it also always returns a 0 status in that case too so I don't feel too bad.
I'll see if I can bring Google's attention to it, either so they can enlighten me as to what I'm missing or else possibly have them add it in a future rev.
UPDATE:
Looking at the history of this code in the GitHub project I see that they implemented the identical fix I was going to propose in a later version of AngularJS.  :-)

