Live data from Hacker News

Chrome Extension Programming: Illustrating a Basic Survival Skill

karpathy.ca

1–10 of 25 posts

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#2
If all you want to do is execute your own js on a certain web page, you can just use greasemonkey or another userscript extension for your browser instead of writing a whole new extension each for each script.

Greasemonkey also appears to provide an interface for peristent local storage as well. [1]

[1] http://wiki.greasespot.net/GM_setValue

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#3
> "I wanted to share a few examples of a powerful skill that I’ve been gradually picking up over the last year. It is simply the ability to quickly hack together custom browser extensions in Chrome and using them to customize my favorite websites."

Having this ability on every platform you use can be very powerful indeed, which is why I always have a jailbroken/rooted phone to customize[1].

[1] http://www.cydiasubstrate.com

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#4

If all you want to do is execute your own js on a certain web page, you can just use greasemonkey or another userscript extension for your browser instead of writing a whole new extension each for each script. Greasemonkey also appears to provide an interface for peristent local storage as well. [1] [1] http://wiki.greasespot.net/GM_setValue

That's what i was thinking too... I've started making userscripts for a few sites I frequent. It's really useful for forums. Greasemonkey is awesome.

(shameless plug - http://userscripts.org/scripts/show/178736)

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#5
I also have a personalized extension I use for several sites and general browsing.

For viewing news.ycombinator.com on my larger monitor, I have it add 25% left and right margins. I also have it enlarge the article titles regardless of screen size so I don't have to zoom every time.

If you already know JavaScript, then it's really convenient and easy to pick up.

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#6

If all you want to do is execute your own js on a certain web page, you can just use greasemonkey or another userscript extension for your browser instead of writing a whole new extension each for each script. Greasemonkey also appears to provide an interface for peristent local storage as well. [1] [1] http://wiki.greasespot.net/GM_setValue

Yeah, GreaseMonkey/TamperMonkey/GreaseKit ... seems like a much easier way of doing what he is going for.

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#7
I've taken to using a simple server on a public IP that serves different JS based on the referrer, and a bookmark for inserting a script tag in the current page.

It doesn't auto run, but it is easy test, install on a new system (just a bookmark!), and extend with extra behavior that can be centralized. Additionally, an update immediately affects all clients.

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#8

If all you want to do is execute your own js on a certain web page, you can just use greasemonkey or another userscript extension for your browser instead of writing a whole new extension each for each script. Greasemonkey also appears to provide an interface for peristent local storage as well. [1] [1] http://wiki.greasespot.net/GM_setValue

A similar tool is Control Freak, optimised for quick CSS or JS tweaks and imo less mental overhead than GM/TM.

https://chrome.google.com/webstore/detail/control-freak/jgnc...

(Disclaimer: I wrote it originally, but no longer the maintainer.)

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#9

If all you want to do is execute your own js on a certain web page, you can just use greasemonkey or another userscript extension for your browser instead of writing a whole new extension each for each script. Greasemonkey also appears to provide an interface for peristent local storage as well. [1] [1] http://wiki.greasespot.net/GM_setValue

[deleted]

Re: Chrome Extension Programming: Illustrating a Basic Survival Skill

#10
post #7

I've taken to using a simple server on a public IP that serves different JS based on the referrer, and a bookmark for inserting a script tag in the current page. It doesn't auto run, but it is easy test, install on a new system (just a bookmark!), and extend with extra behavior that can be centralized. Additionally, an update immediately affects all clients.

You can drop scripts directly into the page context using Greasemonkey too. Its 'sandbox' is pretty easy to break out of.
Post reply on HN