I run a very quick test. ga('set', 'checkStorageTask', null);
did nothing for me, instead I found it necessary to set storage to none on tracker creation (which makes sense, since you cannot set cookies with the file protocol). This also means that you probably won't have session tracking, since each hit generates a new ID.
ga('set', 'checkProtocolTask', null)
seems necessary - else the debugger complains (naturally) that file is not a valid protocol.
After that data was sucessfully sent, but did not show up in the realtime view. I suspected that maybe the reporting engine does not like the file protocol and set the "location" field with a correct protocol. So I ended up with:
ga('create', 'UA-XXXXXX-5' , {'storage':'none'});
ga('set', 'checkProtocolTask', null);
ga('send', 'pageview' , {'location' : document.location.href.replace('file','http') });
and that displayed in the realtime reports. This was a real quick test, so you need to verify this independently. Notice that you do not need to set a cookie domain (the "auto" argument in your code example) since you cannot set a cookie in any case (there is no domain to set the cookie to).
Also if you work offline for most of the time GA will not work (you need to load the analytics.js file and you need sent calls to the tracking server), but then you are probably aware of that.