I'm having a JS error when opening a share dialog in a Javascript application using the Google Drive API. The error is: Uncaught Error: Syntax Error: DOM Exception 12.
However, the sharing dialog works fine when I log out of all Google accounts and then log into just one account. As soon as I log into a second account in a new tab, the sharing dialog no longer works and fails with the above error.
This is very similar to Calling showSettingsDialog() on the Google Drive SDK throws a Refused to display document because display forbidden by X-Frame-Options. However, I have done the debugging shown in the accepted response to no avail, namely:
- The "open with" URL that you have setup in your Google Drive SDK settings in the Google APIs Console has to have the same domain that the page where you are using the sharing dialog.
- Currently you alos need your application to be installed on your Google Drive for the embeddable widget to work. We are currently working on removing this restriction as it does not always make sense since we launched v2 of the API.
The relevant code is:
var shareClient = new gapi.drive.share.ShareClient(rtpg.realTimeOptions.appId);
shareClient.setItemIds([rtclient.params['fileId']]);
shareClient.showSettingsDialog();
Is there some way to make this work with multiple accounts signed in?