diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js index 09646e90..5ceb53d7 100644 --- a/src/main/webapp/js/directives.js +++ b/src/main/webapp/js/directives.js @@ -43,13 +43,6 @@ module.directive('favicon', function() { template : '', controller : ['$scope', function($scope) { - var firstLetterDomain = function(url) { - url = url.replace('http://', ''); - url = url.replace('https://', ''); - url = url.replace('www.', ''); - return url.substring(0, 1); - }; - $scope.iconUrl = function() { var url = $scope.url; @@ -60,10 +53,9 @@ module.directive('favicon', function() { return defaultIcon; } - var prefix = firstLetterDomain(url); var index = Math.max(url.length, url.lastIndexOf('?')); - var iconUrl = 'http://' + prefix + '.getfavicon.appspot.com/'; + var iconUrl = '//getfavicon.appspot.com/'; iconUrl += encodeURIComponent(url.substring(0, index)); iconUrl += '?defaulticon=none'; return iconUrl; @@ -362,4 +354,4 @@ module.directive('spinner', function() { }); } }; -}); \ No newline at end of file +});