Hacker News new | ask | show | jobs
by oefrha 2253 days ago
> how to structure a Chrome Extension

In the true spirit of JavaScript, you just structure it however you damn well please. Well, not completely, usually you have a background page, a popup page with associated scripts, an options page, optional content scripts, etc. You can learn from examples but in general they’re just structured in whatever way the author feels like.

> I find the API very difficult to grok.

That’s surprising because most APIs are really simple as long as you’re comfortable with callbacks. Sometimes there’s a bit of trial and error (messaging might be one pain point when you write your first extension), and sometimes details might slightly differ from the docs as certain features are tightened up (usually in the name of security), but I’ve never encountered anything that defies a bit of debugging.