I have been using the excellent ScriptDB visualiser to help develop a google-apps-script.
This uses the HTMLService and worked last week, but now I cannot get it to work.
The HTML still is served & loads, but no javascript runs. When a button is clicked the error console (in firefox) gives the error;
Error: shouldn't happen: ES5/3 object passed to makeDOMAccessible
Source File: https://ssl.gstatic.com/caja/5346m/es53-taming-frame.opt.js?debug=1
Line: 1788
I suspect some Caja issue, but I went to the Caja playground and could not make any headway.
Any suggestions how to get this working again.
As the message suggests, this shouldn't happen.
That is, this is an internal bug in Caja or possibly Google Apps Script's use of Caja. Please report it on the Caja issue tracker including a (preferably as short as you can make it) example of HTML which causes the error (preferably when run in the Caja Playground, but if not then in Google Apps Script).
Related
i've been learning with google app script, and tried to make a web form because of the limitation of google form. I tried making it by following this example, and it works. However when I tried using incognito or other browser without a google account log on to it, it failed, showing this error
"Maaf, terjadi error pada server saat membaca dari penyimpanan. Kode error INTERNAL."
Which is in Indonesian that basically states the server failed to read the file, and there is an internal error. This is the web app script.
Settings for the web app deployment
Also in the spreadsheet linked is set to anyone with link is able to edit. When this is changed to anyone with link is able to view only, causes a log in prompt to appear in incognito mode.
Any help is greatly appreciated. I also found out earlier that this problem occurred previously because of a bug by google, but it has been resolved. So did I do something wrong?
According to the Apps Script Web Apps documentation:
The first is labeled Current web app URL and ends in /exec. This URL is for the published version of your app, based on the last version you saved and deployed.
The second is the link labeled latest code and ends in /dev. This URL can only be accessed by users who have edit access to the script. This instance of the app always runs the most recently saved code — not necessarily a formal version — and is intended for quick testing during development.
Therefore, when sharing the web application, you should be sharing the /exec link.
There is an open bug for this: https://issuetracker.google.com/issues/160665120
First I have to apologize because English is not my native language and also because I'm just starting in developing. Sorry for all of that.
My question is that when I deploy my app script as a web app the page does not work; but when I used the "Test web app for your latest code" it does work. I don't understand why in the first case (the url finishes with a \exec) appears an error and in the second works nice (the url finishes with a \dev).
The Google Drive error is : The file cannot be opened at this time. Please check the address and try again.
I'm so confused because the web app was working nice, and suddenly it started to show that error, but I did not change anything in the code.
I don´t know if it is related with permissions. I've tried to create new versions but it does not solve it.
Any idea how can I solved it?
When attempting to embed Google’s sample provided for the Tasks API (code found here) into Google's Classic Sites I get the dreaded “script.google.com refused to connect”. The logging error is "Tasks" is not defined at getTasksLists(simpleTasks:15). Details:
When I embed this same script into Google's New Sites, the UI does show, but the drop-down continues to display “Loading…” (see screenshot below), however if I click on the link provided to view my “Google Tasks” it does go to my Tasks in a new window.
This runs successfully directly from Google Apps Scripts, showing the “Authorization required” pop-up and allowing me to sign in and accept permissions. However, when embedded into both New and Classic sites, it does not request any authorization.
Steps I've taken embedding into Classic Sites (where it needs to be):
from URL provided above: copied code exactly as is into a new Scripts project (nothing altered or added).
from Scripts: deployed it as a Web App, copied the URL provided (the code provided in the link above has not been altered in any way by me)
from Scripts: enabled Tasks API though Resources, Advanced Google Services
from Sites: edit page, Insert Apps Script, pasted URL (i.e. https//script.google.com/macros/s/...5Ym41qn/exec)
Other things I've tried:
from Sites: embedding URL as an iFrame gadget (same results)
solution given here: How to add Google Drive Scripts project into Google Sites? (same results)
days of research into Google's documentation (for Sites, APIs, Scripts, Cloud Platform, you name it)... (various results but nothing productive)
I am very new to working with Sites, Scripts, the Cloud Platform, etc. so apologies if I am missing some obvious steps here. Any guidance would be truly appreciated!
Leora
UPDATE [03-21-19]:
I was able to get this working finally! Although not posting as answer just yet as I haven't figured out the exact change that was brought success.
I thought it was by changing the option within Sites' Publish / Deploy as web app... / Execute the app as: from 'ME' to 'USER' (after doing that it worked), but when I changed it back to make sure that was it, it still worked?
I will play around with it more this weekend and update when I come to a definitive solution.
Thanks to anyone who took the time to help me out here, and if anyone does have any guidance on what's happening here, I'd love to know.
A few days ago this started appearing in my Google Apps Script Web App Consoles:
Uncaught (in promise) ReferenceError: currentURL is not defined at then.catch.e (content_script_bundle.js:13)
What might this be?
content_script_bundle.js is likely a script within a Chrome Extension. Ghostery has such a js file. Basically, it has caught an error of some kind
window.console.error("Could not run content script", e, currentURL())
Unfortunately, the line in the script that pushes the error to the console itself has a minor bug whereby currentURL has not been defined so it squawks.
Just turn off Ghostery or whatever and the error will disappear. Although, you can just ignore it. Easiest though is to right-click the console message and select "Hide messages from content_script_bundle.js" if it's bothering you. If it is Ghostery then mark your site as trusted as noted in the comment below. Probably the best solution.
This is a screenshot from Chrome Inspector.
I hope someone has some insight into this issue. I'm trying to execute script in google sheets. The script runs fine when manually executed. We need to use service account for this purpose. API executable was published, I have .p12 file for authentication, there is only 1 function to run and we're getting the 404. I'm using some c# code from DEVs site and that should work as per the article. Has anybody else run into this? Is there an example that shows how to do it correctly? This is what i've based my code on, to no avail... https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth
Thanks for any ideas!
Edit: Thanks Ares - my specific problem is that while following devs example code, I can't execute google script and receive the before mentioned 404 error.
You cannot use C# in GAS. Google Apps Script is based on Javascript. The link you provided shows how to code an example in .NET, which is neither GAS or C#, so I'm confused at why you would follow that example at all.
Regardless, any code that can be used in a Google Script site will say that it is for a .gs or an HTML file.
Remember that Google has many API's that work across multiple languages. GAS is what they want to push, but not every guide they make is aimed at GAS.
I assume the 404 is from using unreadable code.