bytespider/jsOAuth — Issue #32: Using requirejs breaks jsOAuth
Author: raoulmillais
Created: 2012-02-23 18:06:26+00:00
State: open

Hi,

I'm writing a chrome extension and currently chrome has no support for commonjs modules. I am using requirejs to manage my dependencies, but due to the shims to support CommonJS modules, jsOAuth willl not work (xhr is "require"d and require exists but does not have a module named xhr. Adding a check for define being a function and define.amd gets us someway to fixing the issue but we also need to the new up window.XMLHttpRtequest explicitly when define does exist. I have this working and would be happy to submit a pull request with tests if you would consider accepting this. Unless of course you thought there might be a better approach? I thought I would test the water given the currently highly politicised debate surrounding AMD vs CommonJS.

Regards,

Raoul