Skip to content

Commit

Permalink
Merge pull request #58 from elribonazo/master
Browse files Browse the repository at this point in the history
[WIP] Creating support for OSX using browser localstorage.
  • Loading branch information
GillesC authored Jan 2, 2017
2 parents 736de90 + b3ca11d commit 0ca56c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"android",
"ios",
"browser",
"windows"
"windows",
"osx"
]
},
"repository": {
Expand Down
9 changes: 9 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
</config-file>
</platform>

<!-- osx -->
<platform name="osx">
<config-file target="config.xml" parent="/*">
<feature name="NativeStorage">
<param name="osx-package" value="NativeStorage" />
</feature>
</config-file>
</platform>

<!-- windows -->
<platform name="windows">
<js-module src="src/windows/NativeStorage.js" name="NativeStorage">
Expand Down
2 changes: 1 addition & 1 deletion www/mainHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var NativeStorageError = require('./NativeStorageError');


function isInBrowser() {
inBrowser = (window.cordova && window.cordova.platformId === 'browser') || !(window.phonegap || window.cordova);
inBrowser = (window.cordova && (window.cordova.platformId === 'browser' || window.cordova.platformId === 'osx')) || !(window.phonegap || window.cordova);
return inBrowser;
}

Expand Down

0 comments on commit 0ca56c8

Please sign in to comment.