Solving chrome app problems
This commit is contained in:
parent
bbd00cf2d6
commit
40910c3b34
11 changed files with 204 additions and 45 deletions
13
js/routes.js
13
js/routes.js
|
|
@ -118,6 +118,19 @@ angular
|
|||
uriHandler.register();
|
||||
}
|
||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||
|
||||
var localStorage;
|
||||
if (window.chrome && chrome.runtime && chrome.runtime.id) {
|
||||
console.log('Is a chrome app!');
|
||||
localStorage = chrome.storage.local;
|
||||
|
||||
console.log('chrome.storage', chrome.storage);
|
||||
console.log('localStorage', localStorage);
|
||||
} else {
|
||||
console.log('Is web!');
|
||||
localStorage = window.localStorage;
|
||||
}
|
||||
|
||||
if (!localStorage || localStorage.length < 1) {
|
||||
$location.path('unsupported');
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue