Closed AndrewVos closed 11 years ago
Holy smokes.
I'm experimenting with removing the server entirely. That's the ultimate goal.
Yeah I know :(
I had to remove it from my MBP cause of this!
Ok I just rewrote the server in Sinatra and it failed because launchctl likely uses the system ruby to execute the script. It did have a much lower cpu usage though.
What about using some sort of light weight server? That would probably break Windows support though. Do you care about windows support?
So, how about removing the ruby server entirely by taking this approach by jasonkit? I'm willing to try it, if you want.
This has the advantage of making this an OS-independent extension, which would be pretty nice. Just need to cross the hurdle of finding the right script path (~/.js symlink like mentioned?), and checking what happens on the update of the browser extension.
Symlinks probably won't work on windows.
Worth a try though. I might be wrong.
Yes, symlinks definitely won't work on Windows. But, Ubuntu and Mac support could pretty much be out of the box. Wonder if providing the path of the scripts location in the extension page or something would be enough.
Anyway, I'll try it out. Will let you know soon.
Yeah or you could inject the full path to .js into the config when running the rake install.
Quick update: Not as easy as mentioned, because the chrome://extension-id/script/blah.com.js URL access is considered a cross domain request, which content scripts are not directly allowed to do.
There are ways of getting past this. Will continue experimenting.
Hey Andrew, if you're around, you might want to try this. https://github.com/arvindsv/dotjs/tree/removeruby. The ext folder has the new extension. It'll need to be installed manually, and you might need to uninstall (or disable) the older dotjs extension.
@defunkt will need to build the extension (using the private key), if he agrees with this. I think this should just be a normal Chrome extension on the Extensions gallery of Chrome, and we can provide a page with a simple OS check and instructions to the location of the script files and instructions on adding a symlink.
What do you think?
I created a simple page, which can be hosted somewhere. All it does is a small OS check and gives some instructions about the dotjs script dir. Here it is.
@AndrewVos, I've opened a pull request for this change, so that we can have a conversation with @defunkt about this. Let's see where it goes.
Sorry we're in different time zones it seems. I'll try have a look at this if I get a chance today...
@AndrewVos What version of Ruby do you have? Can you do ruby -v
? This might be an issue with the OS X Ruby that Apple ships.
$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.7.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
chris 38652 0.0 0.2 2444384 6592 ?? S Fri08PM 0:08.55 ruby /usr/local/bin/djsd
@arvindsv I've gotten the "no server" approach to work using a scripts/
directory inside the extension, but removing or upgrading the extension would wipe all your scripts (right?). If there's someway around that we'll be a lot closer.
Also, I symlink ~/.js
into Dropbox (for backups) so I'm still trying to get a serverless approach that lets me continue to do that:
$ ls -l ~/.js
lrwxr-xr-x 1 chris staff 32 Apr 8 12:30 /Users/chris/.js -> /Users/chris/Dropbox/repos/dotjs
Well, the security around Chrome extensions makes that hard. I don't see any good way of getting both those aspects working. The update, might work somehow (not sure), but the other one, almost certainly not.
I don't know if creating a symlink from within the scripts/ dir back to a real ~/.js would work. What do you think? If that works, we can install the plugin and then create a symlink in the extension dir, where scripts/ links to ~/.js.
Then, the chrome:// file URL lookup should also support symlinks. I doubt it will.
I don't know if creating a symlink from within the scripts/ dir back to a real ~/.js would work. What do you think? If that works, we can install the plugin and then create a symlink in the extension dir, where scripts/ links to ~/.js.
Doesn't work :(
There might be a solution for your dropbox problem. Apparently, dropbox follows links outside. So, you can symlink /Users/chris/Dropbox/repos/dotjs to ~/.js (and subsequently, the scripts/ folder, let's say) and it should work. A reverse symlink, if you will.
Here's a reference to that: http://wiki.dropbox.com/TipsAndTricks/SyncOtherFolders
Have you considered this? http://www.html5rocks.com/en/tutorials/file/filesystem/
1.9.2 with rvm and I'm guessing 1.8.7 system ruby
On 4 Jul 2011, at 19:09, defunkt reply@reply.github.com wrote:
@AndrewVos What version of Ruby do you have? Can you do
ruby -v
? This might be an issue with the OS X Ruby that Apple ships.$ ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.7.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND chris 38652 0.0 0.2 2444384 6592 ?? S Fri08PM 0:08.55 ruby /usr/local/bin/djsd
Reply to this email directly or view it on GitHub: https://github.com/defunkt/dotjs/issues/37#issuecomment-1499326
-bump-
any fixes on this? I confirm that my env is like in the above AndrewVos' comment rvm 1.9.2, system ruby 1.8.7
Haven't found a clean solution yet so assuming WEBrick is gonna stay.
PID COMMAND %CPU TIME #TH #WQ #PORT #MREG RPRVT RSHRD RSIZE 64589 top 5.6 00:00.37 1/1 0 24 33 936K 264K 1516K 0- kernel_task 1.6 02:26:40 67/2 0 2 1006 17M 0B 257M
64583 ruby 1.3 00:00.26 2/1 0 20 60 4892K 244K 5936K 217 mongod 1.2 28:46.78 8 0 41 48 1468K 244K 3468K
Perhaps switching to another server would be better?