Skip to content

Commit

Permalink
Include function for checking if application is using file protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfarljw committed Sep 26, 2016
1 parent c5a4ede commit ae657c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gelato.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ function isCordova() {
return _.isObject(window.cordova);
}

function isFileSystem() {
return location.protocol === 'file:';
}

function isLocalhost() {
return location.hostname === 'localhost';
}

function isWebsite() {
return _.includes(document.location, 'http');
return _.includes(['http:', 'https:'], location.protocol);
}

function setCookie(name, value, days) {
Expand Down

0 comments on commit ae657c4

Please sign in to comment.