right-click-then-open-with works but simple left-click does not - google-drive-api

At some point in the last couple of days a bug seems to have materialised in my app's Google Drive integration, despite me not having changed anything, and usage remaining fairly constant.
When you left click one of the app's documents in Drive a new about:blank tab opens showing the app's icon and the text "Sorry, an error occurred while opening this file. Please try again. [XXXXX]" where [XXXXX] is a short string that seems to be different every time. The create new works fine, and if you use the right-click menu and open with it also works fine.
All of this makes me think that there is a bug in the latest javascript update to Google Drive's main interface.
In terms of debugging, in the apiconsole the app has...
The initiate oauth2 option unchecked
The allow multiple files option unchecked
Mobile browser support checked
24 mime-types, 61 primary extensions, and 1 secondary extension registered

If it is a bug as Claudio has mentioned, I believe Google Drive SDK documentation needs to be updated too, since 'open' action is described only for "Open With" option:
https://developers.google.com/drive/integrate-open
I'm wondering how to trigger the proper action when registred mime-type can be managed by more than one installed application? Is there a way to set the default open action - or the application which created it will be used as the default? What's happen if you reach the application web by typing the url (not from UI Drive UI create action) and save the content on Drive, since you may be already authorized to do it?

Related

How long will a Google Form's public url last?

I have a google form that I am having pushed out through a Kiosk App and that google form is going to be used for the foreseeable future. Since I am not a Network Engineer or Systems Administrator in my network, the only way of getting the webview element in my App to display the Google form is to hard code it's URL because I have nowhere from which to dynamically update the URL in my App at the moment.
I am also not the Chrome Administrator and because of this I need to send my packaged Kiosk App off site to have it pushed out to my building's Chromebooks which means that for every update that I do, I need to re-package it and have the Chrome guy update it manually.
Since I and many others would prefer to not perform the task noted above on a frequent basis, I am trying to find out how long the Google Form's url will last and/or how often we can expect it to change if it does ever change.
Surely if you have any concerns over the link changing, you can just set up a redirect from a domain you control.
That way even if the kiosk form gets upgraded from Google to something else, you can just change your redirect without recompiling and redistributing your application.

Facing issue while trying to run Robot framework script in google chrome browser

I am facing a Chrome popup while trying to run Robot Frame work script:
Microsoft Security Essentials wants to restore your Chrome settings to their
original defaults.
This will reset your homepage, new tab page and
search engine, disable your extensions, and unpin all tabs. It will
also clear other temporary and cached data, such as cookies, content
and site data.
In chrome extension, my developer mode is unchecked, whereas it should be checked.
The Robot Framework automation script is just to open the google Chrome browser and load google search page.
I am using Win 7 Home Basic OS.
I have attached screenshots.
It appears that most Chrome support specialists will ask you to run an anti-malware tool to verify that your system is running normally. These can be found by searching on the popup message.
One Reddit user commented that in his case the problem was resolved by altering the Windows registry:
I finally found a fix for this. There is a setting in the registry
that's causing it.
In the registry it's under
HKEY_CKU\CURRENT_USER\Software\Google\Chrome\TriggeredReset
Delete the TriggeredReset key and then close regedit. Fixed.
This is an API for 3rd party programmers who want to create cleaning
tools. But if the tool isn't written properly, the triggered reset
never gets deleted and we have it always asking.

Can't log in to Google Apps Scripts

I'm using multiple Google accounts. In one of them (not default) I created Google Spreadsheet file and I want to create Script connected to it. Nothing complicated. But the problem is that after clicking Tools > Script Editor I'm being redirected to default user or I see this screen:
The same problem I have when trying to use: script.google.com
What can I do to enable Script editor?
I know you asked this 9 months ago, but here is my solution;
Sign out of all google accounts except the owner of the spreadsheet
You can now access the scripts and macros pages (go there)
Create a bookmark of them (this saves which profile is logged in)
Now sign back into all your profiles
Voila!
You will be able to access the scripts or macros via the bookmarks without getting the error page.
This is a reported bug.
Go give it a ☆ if you want to let Google know that this affects you.
You can consider appending authuser=email to the URL to open the script with a specific Google account.
For example, script.google.com...?param=value&authuser=email#example.com
I was not able to reproduce the problem. Perhaps it's a glitch or there is something wrong that requires some troubleshooting techniques that are off-topic on this site.
As a workaround, for the account having problems, use another Google Chrome profile, Incognito mode, or another browser.
By the other hand, it's possible that there isn't any wrong and it's just something related to your specific scenario.
From Sign in to multiple accounts at once
Sometimes settings might carry over
If you're signed in to multiple accounts at the same time, sometimes we can't tell which
account you're using. For example, if you're signed in to two accounts
and you open a new browser window, we aren't sure which account you
want to use. In cases like these, Google might apply settings from
your default account, like its Web & App Activity and Ads
Personalization settings.
google's default account (the first one you sign on with) has to be the owner of the sheet
Based on #iansedano's answer, you can share the file with the default chrome user and open the same link in a new tab again to resolve the issue.
If someone needs a quick fix for this :
At the end of the url change the "authuser=1" by the index of the Google Account you want to log with. (0 is the first one, 1 is the second)
https://i.stack.imgur.com/qJows.png
You can also open a new incognito window, paste your sheet url there (you'll need to authenticate). Then you can open Tools -> Script Editor

Sharing the Realtime Documents

I have created a playground application. I see that it creates shortcut files in my google drive. I tried to share it with incognito (because I want the doc to be available to anybody and do not know how to create another google account, so I log out into incognito). The shared link looks like https://drive.google.com/open?id=0B00--A0eRH1JLTdsX2t0LWw5RE0. But, incognito fails to view it. It says that "No preview avaialable" in what is supposed to be its google drive window and offers the log in
The key problem that I see is that playground application has the following structure, which comes from the official demo
function onAuthorized() {
function onFileLoaded(doc) {display(doc)}
gapi.drive.realtime.load(your_doc_id, onFileLoaded)
}
// App entry point -- start by authorization
gapi.auth.authorize({
client_id: rtClientId, scope: ['install', 'file'],
//user_id: userId,
immediate: !popup }, onAuthorized
);
which seems to demand authentication in the first place before displaying any doc. Authorization is problematic for the unsigned mode that I want my app to be available. I want to share a file and make it viewable to the general public, without the need to log in. This raises a question if incognito users are able to view or event edit my document. I also concern how to copy the doc to their account if desired: one thing is when you have created a file on your drive with my app, you can probably list the files and use drive.copy api to copy desired one and other thing when you want to copy a file that is not available on your google drive and the only thing you have is its id.
BTW, can you tell me which account to use for non-incognito testing from another account? If I create the document in one account I want to see how it looks/accessible from the another.
The Realtime API does not provide anonymous access by default. See https://developers.google.com/google-apps/realtime/faq#does_the_realtime_api_support_anonymous_access
"BTW, can you tell me which account to use for non-incognito testing from another account? If I create the document in one account I want to see how it looks/accessible from the another."
Use Chrome for one account. Use Firefox and other browsers for succeeding accounts.
Additional note:
Just so you have a clear understanding what Incognito is all about. What it can and cannot do so you don't mix things up.
How incognito mode works
What you view
Incognito is a mode that opens a new window where you can browse the
Internet in private without Chrome saving the sites you visit. You can
switch between an incognito window and any regular Chrome browsing
windows you have open. You'll only be in incognito mode when you're
using the incognito window.
Be careful. Incognito mode only prevents Chrome from saving your site
visit activity. It won't stop other sources from seeing your browsing
activity, including:
Your internet service provider Your employer (if you're using a work
computer) The websites you visit themselves What you've downloaded
Chrome won’t save a record of the files you download in incognito
mode. However, the downloaded files will be saved to your computer’s
Downloads folder, where you and any other users of your computer can
see and open them, even after you close your incognito tabs.

Launching the Google Drive sharing dialog in an app. What should be the APP_ID value?

I'm following this article, trying to add a sharing dialog in a web app.
I got the button working in opening the modal popup, but it just prints this error in the console:
Refused to display 'https://drive.google.com/share?id=SOME_LONG_ID&foreignService=explorer&shareService=explorer&shareProtocolVersion=2&command=init&subapp=10&popupWindowsEnabled=true&shareUiType=default&rand=1386925457304&theme=2&client=postMessage&appId=MY_APP_ID&embedOrigin=http%3A%2F%2Fmy_app.appspot.com'
in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
And the modal itself just shows the message "Sorry, sharing is unavailable at this time. Please try again later."
For the checklist at the bottom of the article:
The user is signed in to Google True
The user has installed your app False How do I ask them to install?
The URL of the page that launches the dialog must have the same origin as the Open URL registered for the app. True
So I have 2 questions:
How do I ask them to install my app? It's supposed to be a web app, where there's 1 button to select Drive files via the Picker API (which is now working), and then another button which will sow this Drive sharing dialog to set the permissions of the selected files. There's no need for installation. Will it work for this setup?
What should be the value for the APP_ID? I'm guessing it's the ID in the "Drive SDK" section of the Cloud Console? The console is so confusing and there's so many values for keys, ids, etc. that I have no idea which to use. Here's a screenshot of what I mean by the ID and what I'm trying to use.
(1) Installing means you have to get the user to accept the drive.install scope - instructions here. This will integrate your app with the "open with" menu in Google Drive. But before that can work you will need to tell the Google Cloud Console what url to go to when the user clicks "open" - more instructions. In your case, since you don't actually want to allow the user to open files from Drive you won't be defining any file types, so in reality there won't actually be any visible integration with Drive.
Note that the share dialog will only work on the one page which has the url you specify as the target for "open" (the instructions say this and from experience it seems to be true).
(2) Client ID You can find this in the Google Cloud Console - see above. Mine is a 12 digit number, so yours will probably be too.
I had the same problem. The iFrame error shows up when you call setItemIds if your app_id is wrong. No idea why. Anyway, it started working for me when I used the right app_id -- the one that shows up like in your screenshot.