Check if badges are available in js

Change-Id: Ied57a511c73e86f156efef5086f3724f2afbb917