top | item 2708003

Dotjs — hack the web

309 points| duck | 14 years ago |defunkt.io | reply

58 comments

order
[+] gue5t|14 years ago|reply
This seems like it's a lot of overhead for what amounts, in terms of capability, to a reimplementation of greasemonkey. It also makes you implement finer controls on execution by url yourself, whereas greasemonkey has them in its syntax. The author states,

"GreaseMonkey user scripts are great, but you need to publish them somewhere and re-publish after making modifications. With dotjs, just add or edit files in ~/.js."

but this caveat is just as strong for files you maintain outside of your browser, and some browsers' implementations of userscripts/greasemonkeylikes actually have a similar filesystem-based model for managing scripts already.

While respectable, I had hoped to be more impressed by a tool that beckons me to "hack the web".

[+] defunkt|14 years ago|reply
That's all true, but dotjs is only for Google Chrome on OS X.

Google Chrome on OS X has no such filesystem-based model for managing scripts.

[+] seanp2k|14 years ago|reply
Yeah, already have greasemonkey and the only thing I have to do to "publish" files is to save them with the same name.

This project is a lot of work for zero benefit.

[+] holman|14 years ago|reply
I've sneakily been using this for months on Hacker News itself- I just .hide() stories past around story #15. More signal, less noise. And it's just jQuery, so it's really easy to whip up.

Bonus points for it being so easy to share, too: https://github.com/holman/holman-js/blob/master/news.ycombin...

[+] forgotusername|14 years ago|reply
It's interesting how perspectives differ on what is considered noise. On the average day I start my browsing here around link 15, or even the new queue.

You're pretty much guaranteed to hear of anything hitting the front page anyway if it was meaningful to begin with. If not, it's probably some momentary obsession or buzzword bingo (say, "Google", "Social", "Facebook killer", "Privacy", "Product launch" to take an ephemeral example :))

[+] yread|14 years ago|reply
I quickly scan http://hckrnews.com/ which makes sure I don't miss any upvoted story. It does have a lot of noise, but going through 20 or so articles since last time i looked doesn't take that long
[+] omaranto|14 years ago|reply
Doesn't Chrome have builtin support for Greasemonkey scripts? How is this better? Is it just the convenience of having jQuery preloaded?
[+] TheMiddleMan|14 years ago|reply
"GreaseMonkey user scripts are great, but you need to publish them somewhere and re-publish after making modifications."

Publish them where? I don't understand this. Whenever I change a user.js file and save it the browser updates it and it's ready to go next time the page reloads.

Side node: Scriptish is a fork of greasemonkey with many cool extras. https://addons.mozilla.org/en-US/firefox/addon/scriptish/

[+] reustle|14 years ago|reply
Requires Ruby? Why...
[+] defunkt|14 years ago|reply
Chrome extensions can't access the local filesystem so we have to start a tiny webserver in the background.

If someone knows a way around this limitation, or a simpler webserver to require / embed, I would be thrilled. But so far this is the best I've found.

[+] mgurlitz|14 years ago|reply
It looks like Ruby is only needed for the file server. You could easily substitute a Python file server (cd .js; python -m SimpleHTTPServer 3131). You could use a remote Apache server for synchronizing your scripts. I agree that Ruby is a little overkill, but it is simple enough to run easily on a Mac, and it is extensible for hackers.
[+] oldgregg|14 years ago|reply
I'm waiting for someone to build a social browser extension on top of something like this. Anyone could submit custom CSS/JS for a website and the most upvoted "theme" automatically gets loaded. Sure the JS security issues might be a nightmare, but the web would look soooo much prettier!
[+] jasonkit|14 years ago|reply
I think the ruby web server is not necessarily needed, simply change the dotjs.js's content to

$.get(chrome.extension.getURL("script/"+window.location.hostname+".js"), function(script){ eval(script); });

it will look for the js file in the extension directory instead of the local ruby web server, and this should work for any platform. To take the ~/.js convenience, a symlink in *inx system or shortcut in window will do the job.

[+] sim0n|14 years ago|reply
Sweet! Believe it or not I've been actually looking for something like this for Chrome over the past couple of days so this is great.
[+] __rkaup__|14 years ago|reply
The instructions given only work for Mac.
[+] rpearl|14 years ago|reply
Should work fine in Linux too, from looking at the instructions.

(Firefox user here... This looks like a poor man's greasemonkey).

[+] DanielRibeiro|14 years ago|reply
Reminded me a lot of Greasemonkey for FF.
[+] cleverjake|14 years ago|reply
greasemonkey scripts also work in chrome.
[+] blago|14 years ago|reply
Awesome, exactly what I needed. I was just about to create yet another "inject X.js" bookmarklet.
[+] antihero|14 years ago|reply
Why does this need OSX?
[+] pavel_lishin|14 years ago|reply
It seems like a pretty trivial little hack - I think the only reason it really requires OS X is to launch the toy web server that serves the scripts.