GitHub Repo Widget Update

GitHub Repo Widget was rejected during its review due to the GitHub library I was using doing JSONP which (quite legitimately) the add-on reviewers flagged as remote code injection. This was a setback as I relied on that library to do most of the work for me.

In response I started writing another GitHub library that used AJAX to hit the API and get the data back I wanted. I was stumped when I was getting a status of 0, status text of “error” and no explanation of why this was happening. Turns out it was being block for doing a cross-domain request. Next, I learned about CORS and thought that might be my savior, until I realized I wasn’t executing from my own context but from my tab’s context so it is that domain that things have to come from.

I gave up and asked in #jetpack on irc.mozilla.org and was pointed to the request module that is part of the add-on SDK. I was a bit bummed as I knew this would require quite a bit of rethinking how I do things. Fortunately it wasn’t too bad, two hours and a whole bunch of message passing later I had a module that would work with v2 of the GitHub API and filled all the needs of my add-on for now.

I’ll toss another update on my blog when it is finally accepted as a full add-on and is searchable.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s