6 ms·
Dotjs — hack the web
- __rkaup__ 15y agoThe instructions given only work for Mac.
- rpearl 15y agoShould work fine in Linux too, from looking at the instructions. (Firefox user here... This looks like a poor man's greasemonkey).
- __rkaup__ 15y agoNah, it tries to install some OS X "launch agent" thing. Should be quite simple to get it to work in Linux, but it doesn't yet.
- defunkt 15y agoTry https://github.com/glenbot/dotjs/tree/ubuntu-support-merged https://github.com/glenbot/dotjs/tree/ubuntu-support-merged
- deleted 15y ago[deleted]
- rpearl 15y agoThere's a firefox version too: https://github.com/rlr/dotjs-addon https://github.com/rlr/dotjs-addon And Safari: https://github.com/wfarr/dotjs.safariextension https://github.com/wfarr/dotjs.safariextension
- deleted 15y ago[deleted]
- DanielRibeiro 15y agoReminded me a lot of Greasemonkey for FF.
- cleverjake 15y agogreasemonkey scripts also work in chrome.
- inconditus 15y agoIn fact, Chrome built them into the web browser so they work without installing any Greasemonkey extensions.
- alxeder 15y agogreasemonkey for chrome doesn't support the full thing @require for example
- holman 15y agoI'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.ycombinator.com.js https://github.com/holman/holman-js/blob/master/news.ycombin...
- sant0sk1 15y agoSame here. Mine: 1) sniffs out urls in submissions and auto-links them 2) adds comment thread folding. https://github.com/sant0sk1/dotfiles/blob/master/js/news.ycombinator.com.js https://github.com/sant0sk1/dotfiles/blob/master/js/news.yco...
- pavel_lishin 15y agoI use https://chrome.google.com/webstore/detail/hockhafcdegocajmjhafgjncjpodihkd https://chrome.google.com/webstore/detail/hockhafcdegocajmjh... for (2)
- forgotusername 15y agoIt'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 :))
- blago 15y agoAwesome, exactly what I needed. I was just about to create yet another "inject X.js" bookmarklet.
- oldgregg 15y agoI'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!
- mburns 15y agohttp://userscripts.org/ http://userscripts.org/
- reustle 15y agoRequires Ruby? Why...
- defunkt 15y agoChrome 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.
- seanp2k 15y agoahahahahah what? Dude, do you work for Microsoft? "Well see, we just have to run MS-SQL server (DESKTOP OMG EXPRESS ENGINE) here, and then we run IIS on top of it to serve this file listing..."
- vijaydev 15y agoHe co-founded GitHub and is the CEO presently. That will be good enough for you?
- pyre 15y agoIt's a limitation of Chrome. This isn't the first time that someone tried to use a local webserver to do something that Chrome doesn't allow. IIRC, there was someone that used a webserver to implement a hacky version of It'sAllText! for Chrome.
- aboodman 15y agoDid you investigate requesting the files directly from the filesystem, like "file:///home/monkey/.js/google.com.js". You'd need to tell users to enable file access for the extension though chrome://extensions/, since that isn't enabled by default and users have to opt into it. I also don't know if there is a way to get the current user's homedir without hardcoding it. Also: you're being super careful to not allow arbitrary reading of the filesystem, right? A good sanity check would be to ensure that realpath() of any file served is under ~/.js before handing it off.
- gue5t 15y agoThis 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 15y agoThat'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.
- wahnfrieden 15y agoTrue, and this is why I love dotjs. Thanks for making it! Maybe a good followup project would be to use some of the dotjs code to help make a filesystem-based GreaseMonkey system for Chrome, which would be just as easy to manage as dotjs scripts are.
- seanp2k 15y agoSo actually it's much worse than Greasemonkey. Also, with GM you can just save the script with the same filename and it'll use that instead. This project is 100% useless.
- dasil003 15y agoUnless you don't use Firefox and you tend to have a lot of dot files that you hack around with in your home directory. Then it starts to seem pretty awesome.
- 15y ago
- TheMiddleMan 15y ago"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/ https://addons.mozilla.org/en-US/firefox/addon/scriptish/
- deleted 15y ago[deleted]
- cdcarter 15y ago"Protip Keep ~/.js under version control and share it with the world." This could result in a really cool network graph on github, couldn't it? Also, when defunkt says protip, take it.
- omaranto 15y agoDoesn't Chrome have builtin support for Greasemonkey scripts? How is this better? Is it just the convenience of having jQuery preloaded?
- Brewer 15y agoThis just made my day, keep up the good work.
- meow 15y agoUmm.. is there a way to run it on windows :( ?
- pavel_lishin 15y agoLooks like you'll have to modify the Rakefile to use whatever Windows uses to launch the webserver. If you don't have ruby, you could probably write one in your local language of choice.
- sim0n 15y agoSweet! 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.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- antihero 15y agoWhy does this need OSX?
- pavel_lishin 15y agoIt 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.
- robinduckett 15y agoSorry, how is this different to greasemonkey?
- deleted 15y ago[deleted]
- JackWebbHeller 15y agoGreat work! But I had some trouble getting it to run on my Mac. I think it might be because I use VirtualHostX - http://clickontyler.com/virtualhostx/ http://clickontyler.com/virtualhostx/ - which alters my hosts file. I had to create a host - http://dotjs/ http://dotjs/ - pointing to my ~/.js/ folder - then edit the Extension JS to point the Ajax to http://dotjs/ http://dotjs/ instead of http://localhost:3131 http://localhost:3131. A bit of pain but it might just be who this affects.
- mph 15y agoI added CoffeeScript support if anyone's interested. just change your file extension from .js to .coffee https://github.com/eightbitraptor/dotjs/commit/20c97774eb29f2a737facd8a12ed9b872dbea47b https://github.com/eightbitraptor/dotjs/commit/20c97774eb29f...
- tung 15y agoSee also jsshell[1] for Chrome. Press the button and you can run jQuery-powered JS on the fly, save snippets and run them, even automatically on regex-matched URLs. [1] https://chrome.google.com/webstore/detail/kmgmkbicahmbceidoidjbkbpkfogaldh https://chrome.google.com/webstore/detail/kmgmkbicahmbceidoi...
- jasonkit 15y agoI 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.
- Sym3tri 15y agoI wrote a simliar extension for CSS. It's free in the Chrome store: http://goo.gl/vWcqr http://goo.gl/vWcqr