How I built my first Chrome Extension, AstroBook, in less than a day.

{
"manifest_version": 2,
"name": "AstroBook",
"description": "Are you compatible with your Facebook Friends?",
"version": "1.2.1",
"icons": { "128": "icon.png" },
"content_scripts": [
{
"matches": [
"*://astrobook.co/*",
"*://*.facebook.com/*",
"*://twitter.com/*",
"*://*.twitter.com/*"
],
"js": ["jquery.min.js", "app.js"],
"css": ["app.css"]
}
],
"permissions": [
"tabs", "http://*/", "https://*/", "storage"
],
"web_accessible_resources": [
"matches.json"
]
}
setInterval(function () {
if (currentURL !== encodeURIComponent(location.href)) {
currentURL = encodeURIComponent(location.href)
setTimeout(function () {
var birthdayDayCell = $('span:contains("Birthday")')
if ($('.astrobook').length > 0) {
return console.warn('AstroBook is already initialized.')
}
if (birthdayDayCell.length === 0) { return }
if (birthdayDayCell.length > 1) {
bDayCell = $(bDayCell[1])
}
initWidget(birthdayDayCell.parent().parent()) // Magic!
}, 1000)
}
}, 500)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store