[Greasemonkey] Simple file-to-ide sync

Hi there.

I’ve made a simple userscript which automatically synchronizes selected file and codingame IDE. It adds file input near reload button.

Works with Firefox (with Greasemonkey) and Chrome (with Tampermonkey).

Just click Install and you should get confirmation window (try refreshing opened page if nothing appears). Confirm there and the new input should appear after you refresh an IDE page.

After that you can select a file using the new input and its contents will be automatically synced to the IDE.

Enjoy =)

7 Likes

Could you provide some installation steps?

I am not able to make it working.

@pawellabaj Sure.

  1. Install Greasemonkey using this link: https://addons.mozilla.org/en-Us/firefox/addon/greasemonkey/
  2. Go to the https://github.com/selslack/codingame-sync-userscript/raw/master/codingame-sync.user.js and you should get an installation window. Confirm there and the new input should appear after you refresh an IDE page.
  3. Then you can select a file using the new input and its contents will be automatically synced to the IDE.

Hope that’ll help!

Thank you, it works fine.

Hey guys =)

I’ve fixed a nasty bug which prevented input from showing up unless a page reload is made on the IDE page.

Script now uses MutationObserver API to catch appear and disappear events of the IDE.

Unfortunately, this script is no longer works in firefox 43/44+ (I don’t know the exact version).

Firefox now prevents reading changed files. =(

That’s sad :frowning:

It works for me in Firefox 49. However, I did notice it doesn’t continue to sync after clicking Play so you have to reselect the file. However, it’s still better than nothing.