ccoenraets / forcejs

Micro library to use the Salesforce REST APIs in JavaScript Apps
175 stars 61 forks source link

Recognize the window.sforce object as an indication that we don't nee… #5

Closed abd3 closed 9 years ago

abd3 commented 9 years ago

We were experiencing issues in our Salesforce Support Console due to the wrong URL being used for a force.create() call. We isolated the issue to be that getRequestBaseURL() was pointing us to the proxyURL because useProxy was true. useProxy was true because window.SfdcApp was not defined in some parts of our console where we were using the forceJS library. window.sforce is defined however. So I've added a check to see if that property is defined and if so we determine the proxy isn't needed.