defunkt/dotjs

Don't throw 404 if script doesn't exist.

sheerun opened this issue · 8 comments

Good call. If I'm reading this right, that'll also remove the requirement of a server, and allow this to work cross-platform and without Ruby as a dependency. 👍

Hmm, that would make only the extension (which would be totally rewritten) necessary indeed. Seems like a much more elegant way of solving the problem, but I dont't know if there's any hope for this to be implemented, since the repo is kind of abandoned :(

That doesn't mean nobody can fork this and make it happen.

Even if it sits as a pull request for a while.

Sure, but look at the PR page: there are some lingering for more than a year :(

I think everyone would like to see #56 merged (or at least implemented in some way or another).

Well in that case, everyone just needs to switch to using the fork. It happens.

Nevermind, this breaks the plugin, so it won't even work. But it could be fixed if the plugin itself would be updated to use a try..catch block, which disables exception to be printed in the console.


You can fix it yourself, it's really simple.

I figured it out thanks to @diffsky's hint of extension location, from thread about failed loading jquey.min.map (I didn't know that since I have never tried to learn about chrome plugins).

How to fix it (assuming using mac):

Edit file: ~/Library/Application Support/Google/Chrome/Default/Extensions/<ID>/2.0.1_0/dotjs.js

The <ID> is id number of extension, explained in @diffsky's comment. To save you time searching, run this command in your terminal - I'm assuming you have set the $EDITOR variable (if not, replace it with your favorite editor command), or replace it with echo and open outputted path in your editor.

$EDITOR "$(find "$HOME/Library/Application Support/Google/Chrome/Default/Extensions/" -name '*dotjs.js')"

Wrap the whole code (ajax request) in try..catch:

try {
  $.ajax({
    //...
  })
}
catch (e) {}

I know it's a dirty fix, but it works and not nearly as complicated as using fileSystem.

The filesystem api is only allowed in apps, not extensions. Trying to register it in an extensions manifest results in an error:

'fileSystem' is only allowed for packaged apps, but this is a extension

The tabs api, however, has some functions to inject js and css, so I made a quick attempt to reproduce dotjs functionality using that: https://github.com/diffsky/chromedotfiles