๐Ÿ“ฆ gschier / aws-favicons

Chrome extension to set the favicons for AWS to the icon for each service

โ˜… 6 stars โ‘‚ 1 forks ๐Ÿ‘ 6 watching
๐Ÿ“ฅ Clone https://github.com/gschier/aws-favicons.git
HTTPS git clone https://github.com/gschier/aws-favicons.git
SSH git clone git@github.com:gschier/aws-favicons.git
CLI gh repo clone gschier/aws-favicons
Gregory Schier Gregory Schier Hard clear cache d0eb003 9 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ builds
๐Ÿ“ package
๐Ÿ“ resources
๐Ÿ“ scripts
๐Ÿ“„ .gitignore
๐Ÿ“„ README.md
๐Ÿ“„ README.md

// Print all the services and the offsets
var services = [];
var items = document.querySelectorAll('.servicesContainer a.service');

for (var i = 0; i < items.length; i++) {
    var item = items[i];
    var href = item.getAttribute('href');
    var slug = href.match(/console\.aws\.amazon\.com\/(\w+)\//)[1];
    var x = parseInt(item.children[0].style.backgroundPositionX.replace('px', ''), 10);
    services.push([x, slug]);
}

services = services.sort(function (a, b) {
    return a[0] < b[0] ? 1 : -1;
});

var js = 'var paths = {\n';
for (var j = 0; j < services.length; j++) {
    var service = services[j];
    js += '\t"' + service[1] + '": ' + '"/favicons/' + j + '.png"';

    if (j < services.length - 1) {
        js += ',';
    }

    js += '\n';
}
js += '};';
console.log(js);