Does your code really need to be minified? Why do you fetch the HN front page using an external API (http://producthunter.awesome.io/hn.json) when you could easily scrape HN's front page directly?
Does your extension really need all those permissions?
"permissions": [
"webRequest",
"tabs",
"http://*/*",
"https://*/*",
"storage"
]
Good question - maybe you know ways to improve this
Storage is to cache results, webrequests to request the json, tabs to place the tab.
Im unsure if i access anything through http:// anymore - might just be a development relict.
I could limit to certain domains to avoid hacking vectors.
But that's a bit too much for an simple friday afternoon hack i guess.
Does your code really need to be minified?
I used grunt / yeoman for chrome extensions. Minifactions came out of the box and i didn't see any reason not to minify. Eg i also minify all JS on my websites
Why do you fetch the HN front page using an external API
when you could easily scrape HN's front page directly?
HN's html structure is quiet a pita so i wanted to keep this on the server site (updates through chrome app store can take days).
I could use inofficial HN JSON APIs but i needed to add my imgur links anyway and i don't know any safe way to make those on the client side without enabling people reusing my api keys.
Finally, you should probably disclose that you are tracking
people who use your extension through Google Analytics
Good idea.
It didn't came to mind because most extensions like this use GA to track usage/events/etc - some even use JS error loggers.
Where would you communicate this? TBH i hardly ever communicate this on my website projects neither (apart of in the wall-of-text-TOS)
I don't think I've installed any Chrome extensions other than the one for LastPass because of the "access your data on all websites" and even LastPass' made me pretty nervous.
I actually got rid of LastPass because of how poor the Chrome extension is. Between spamming the error console with errors, to injecting terrible HTML/CSS to pages for their little field 'star' icon, to terrible/broken notifications for innocuous things. (The yellow toolbar icon turning red could mean any number of things, from 'duplicate passwords detected' to 'please log into lastpass'.)
Could it be made to dynamically load more stories as I scroll? You know, to completely kill my productivity. It's just suffering now with this extension, and I'd like to finish it off.
I know this is just a joke, and I'm probably going to get shouted down for being too serious, but if Chrome really lacks a way of setting your default tab, surely an extension that lets you choose any URL, including the wonderful HN, would be preferable...
That extension does a simple redirect, which means Chrome populates the address bar with the target URL. So it's not possible to open a new tab and type a search term.
As a friday afternoon hack i build a little extension that shows the latest of HN in your default tab of chrome.
Hope you like it - it's a genius way to start procrastinating ;)
Let me know what you think!
Also if you are applying to the SummerBatch - all the best :)
intended to be run as cronjob and just spit the generated html into a file.
I guess you could also do it completely client side with the JSONP API. But I like my sites static. Less clicks in NoScript.
By the way I'm not in any way affiliated with wimg.ca, the just seemed to do the job.
A couple of months ago I looked for something similar as I really didn't like my most visited pages popping up on a new tab - non work things mixed in :-) I arrived at something showing those pointless 'apps for chrome' in big icons but completely blank is way better!
I don't know, just think of how much time I'll save by not actually having to "go" to HackerNews explicitly in order to avoid whatever else I'm working on :)
In the bottom of the page
"Disclaimer: some of the reviews above are meant to be sarcastic and not by real people. Please Google don't ban this app. Kthxbye."
Finally, you should probably disclose that you are tracking people who use your extension through Google Analytics (https://gist.github.com/anonymous/9847044#file-gistfile1-js-...).
Sorry for being a bit paranoid... Other than that, seems like a nice extension!