dotjs icon indicating copy to clipboard operation
dotjs copied to clipboard

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

Open sheerun opened this issue 12 years ago • 8 comments

Just use filesystem API: http://developer.chrome.com/apps/fileSystem.html

sheerun avatar May 14 '13 18:05 sheerun

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. :thumbsup:

ticky avatar May 15 '13 00:05 ticky

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 :(

fuadsaud avatar May 15 '13 00:05 fuadsaud

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

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

ticky avatar May 15 '13 00:05 ticky

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).

fuadsaud avatar May 15 '13 00:05 fuadsaud

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

ticky avatar May 15 '13 00:05 ticky

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.~~

markogresak avatar Feb 05 '15 10:02 markogresak

W2g

kikigotit4u avatar Feb 08 '15 16:02 kikigotit4u

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

matthewhadley avatar Feb 09 '15 02:02 matthewhadley