I am using <input type="file" webkitdirectory>
to select folders on Chrome. While I know that this feature works only on Chrome, I would like to hide this button on browsers like Firefox and IE that don't support it.
I found a post that suggested to do something like the below code, however it returns false both on chrome and FF.
$scope.isDirSupp = function() {
var tmpInput = $('#bulkyFolder');
if ('webkitdirectory' in tmpInput
|| 'mozdirectory' in tmpInput
|| 'odirectory' in tmpInput
|| 'msdirectory' in tmpInput
|| 'directory' in tmpInput) return true;
return false;
}
html:
<input type="file" webkitdirectory id="bulkyFolder" ng-show="isDirSupp">
What is the best way to show this button on chrome and hide it on Firefox and IE?