News for hackers. Stuff that matters.
Re:Show HN: Built an extension to put an end to paywalls and... by adatavizguy on Monday April 13, 2020 @01:34PM (#22857943)
What are the best resources to learn how to structure a Chrome Extension? I find the API very difficult to grok.
Re:Show HN: Built an extension to put an end to paywalls and... by ArmandGrillet on Monday April 13, 2020 @01:37PM (#22857968)
The https://developer.chrome.com/extensions/devguide is easy to parse and the https://developer.chrome.com/extensions/samples are quite useful to kickstart the development of a Chrome extension.
Re:Show HN: Built an extension to put an end to paywalls and... by oefrha on Monday April 13, 2020 @01:54PM (#22858145)
> 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.

Re:Show HN: Built an extension to put an end to paywalls and... by adawg4 on Monday April 13, 2020 @01:36PM (#22857963)
Heres a whole repo of extension examples you can probably work with https://github.com/orbitbot/chrome-extensions-examples