We're in the process of creating a Chrome Extension that communciates with the salesforce API using ForceTK.

The Callback URL needs to be on a secure link (https) and as you probably know chrome extensions are local. We have managed to upload the callback page to a secure server, but the problem is that chrome wouldn't allow our extension to communicate with the pop-up authorization window since the call back link is on a different directory and they will block access due to Cross-Domain restrictions. We need a way to save the session for the user (no sensitive information there, just a cookie to validate the user has been already authorized the extension so that pop-up won't show for them again in the future).

Question 1: What is the workaround to having the callback url points to the Chrome extension or to a link that can be accessible via the Chrome Extension.

Question 2: The majority of the examples provided by Salesforce on ForceTK are targeted for Cordova Phonegap developers and just one page is for Javascript (which isn't even complete). Is there any other official examples provided by Salesforce in this regards and where can we find them? If not, is there any trusted sources for similar examples elsewhere on the web? (We found some that weren't good enough or had lots of errors).

Question 3: The majority of the examples provided by Salesforce are about listing accounts & other information. Little has been mentioned on doing basic XHR Requests using Javascript. Nothing fancy we're looking for, just the basic operations of GET, PUT, POST and DELETE.

  • You have to use a chromium link. I posted a mini Q&A here on how to get a session token here. Does this look like it may help you? Note that XHR works correctly when you specify the appropriate permissions in your app's manifest. I'll post a more formal answer when I'm not mobile.
    – sfdcfox
    Commented Nov 27, 2015 at 19:48
  • Hi @sfdcfox. I came across the Webview work-around before. The only unclear part was setting the src value of the iFrame. In the example it is "login.salesforce.com..." Commented Nov 27, 2015 at 20:11


You must log in to answer this question.

Browse other questions tagged .