Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sheerun opened this issue May 14, 2013 · 8 comments
Open

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

sheerun opened this issue May 14, 2013 · 8 comments

Comments

@sheerun
Copy link

sheerun commented May 14, 2013

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

@ticky
Copy link

ticky commented May 15, 2013

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

@fuadsaud
Copy link

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

@ticky
Copy link

ticky commented May 15, 2013

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

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

@fuadsaud
Copy link

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

@ticky
Copy link

ticky commented May 15, 2013

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

@markogresak
Copy link

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.

@kikigotit4u
Copy link

W2g

@matthewhadley
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants