Cannot see my javascript code in userCodeAppPanel

This is code from a script contained in a Google Spreadsheet. The only other code is an onOpen which creates and menu and a showDialog() function

function showDialog(){
  userInterface=HtmlService.createHtmlOutputFromFile('test');
  SpreadsheetApp.getUi().showModelessDialog(userInterface, 'Testing Inputs');
}

This is my javascript


And this is what I see when I click on link associated with 'test code' in console.







This is the entire html file.



  
    
    
    
    
  
  
  
  

Basic Project Data Input














This is want the console shows when I launch the dialog

Unrecognized feature: 'picture-in-picture'.
iframedAppPanel?mid=ACjPJvGGulDc8kqHqaTVmW8ouofBnAMf3yo988NOBs-h9XUGoRpmfzwLx1oicxsS_tKSejiCuGZgzG7Uk-hD97zxYEj_J7Qna3k88V4wF0VJZqY0qcngq85y83fmy-indV7uqhh-nwbcfmY:11 Unrecognized feature: 'vibrate'.
userCodeAppPanel:2 Unrecognized feature: 'picture-in-picture'.
userCodeAppPanel:2 Unrecognized feature: 'vibrate'.
userCodeAppPanel:30 test code
2877393808-warden_bin_i18n_warden.js:202 To {message: "There was an error during the transport or process…this request. Error code = 10, Path = /wardeninit", name: "TransportError", stack: "TransportError: There was an error during the tran…/js/2877393808-warden_bin_i18n_warden.js:186:252)"}

This is a simple file that I extracted from another project. I'm running it in a modeless dialog but I get the same problem in the web app which I've been debug using the console.

I'd appreciate any ideas here. I've tried going to settings and clicking on "Restore Defaults and Reload'. I've been using the console for my debugging lately because I can't seem to figure this out.

I'm wondering if it has anything to do with the picture in picture and vibrate warnings. I googled them in different ways but couldn't find anything to help me.

Google sheets add-on: create doGet and doPost endpoints

I am trying to build an add-on where in the user installs add-on and during configuration, I need to generate doGet and doPost URL’s(web app endpoints) to which user can post data.

From my research to generate doGet and doPost api URLs, the script has to be deployed as a web app from a particular user account.
Is it possible to deploy doGet and doPost code inside my add-on as web app from the installed sheets add-on?

Google Slides add-on top level menu

We are developing a Google Slides add-on and we need to add some custom top-level menus. The documentation on https://developers.google.com/apps-script/guides/menus says:

Scripts that are published as add-ons for Google Sheets, Docs, or Forms cannot create top-level custom menus.

But when I installed publicly available Poll Everywhere for Google Slides add-on, it added the Poll Everywhere menu as a top-level menu for all documents. How could be that possible?

Poll Everywhere top-level menu

How do I use chrome.download within my content script?

I am trying to use chrome.download methods to download a CSV file type and change the name of the file upon download.

Currently, I am using

document.querySelectorAll("[file$='foo']").forEach(a=>a.click());

to simulate a click on each element to download. However, each filename upon download is foo.csv, foo(1).csv etc. Utimately I would like to download the file, and change the filename. Currently I am doing this through a content script, and from what I have read I cannot access the chrome.download API and will have to use messaging from my background.js.

Other posts similar to this one, from my understanding, involve creating a new element/content for download versus downloading content already on the site.

Am I missing something simple? I am new to this and am having troubles piecing it all together.

Example
Example 2

Any help is greatly appreciated! Thank you!!

Public Google Script doesn’t run from a chrome extension

I have a Google script which modifies the content of a google spreadsheet (it’s not the final script of course), but I have a problem to run this simple script from a google chrome extension.
Here is the script attached to my spreadsheet :

function insertData(data1, data2) {
  var spreadsheet = SpreadsheetApp.openByUrl(THE_URL_OF_THE_SPREADSHEET)
  spreadsheet.getRange('A5').activate();
  spreadsheet.getCurrentCell().setValue(data1);
  spreadsheet.getRange('B5').activate();
  spreadsheet.getCurrentCell().setValue(data2);
}

I deployed this script both as a web app (execute as me + access to everyone, even anonymous) and as an executable API (access to anyone).

Then I tried this JS script to run my google script, from a google chrome extension, using this code that I got from an google chrome extension example:

sendDataToExecutionAPICallback: function() {
    post({  'url': 'https://script.googleapis.com/v1/scripts/' + SCRIPT_ID + ':run',
            'callback': obj.executionAPIResponse,
            'request': {
                'function': 'insertData',
                'data1': 'ok1 from script',
                'data2': 'ok2 from script'
            }
        });
}, 

executionAPIResponse: function(response){
    var obj = this;
    var info;
    if (response.response.result.status == 'ok'){
        info = 'Data has been entered';
    } else {
        info = 'Error...';
    }
    obj.displayMessage(info);
}

And I have this post function :

function post(options) {
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        if (xhr.readyState === 4 && xhr.status === 200) {
            // JSON response assumed. Other APIs may have different responses.
            options.callback(JSON.parse(xhr.responseText));
        } else if(xhr.readyState === 4 && xhr.status !== 200) {
            console.log('post', xhr.readyState, xhr.status, xhr.responseText);
        }
    };
    xhr.open('POST', options.url, true);
    // Set standard Google APIs authentication header.
    //xhr.setRequestHeader('Authorization', 'Bearer ' + options.token);
    xhr.send(JSON.stringify(options.request));
}

And when I call the sendDataToExecutionAPICallback function, I got this auth error:

"error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
}

Execute Google App Script from content/background script

I have made a chrome extension to run on GMail, in which I would like to trigger a Google app Script with a button I made. Can anyone tell me how to trigger/call Google script.

This is my script:

function myFunction() {
  var thread = GmailApp.getInboxThreads(0,1)[0];
  var message = thread.getMessages()[0];
  var sub = message.getSubject();
  var body = message.getPlainBody();
  
  var text = /(Event)|(Party)/;
  result = sub.match(text);
  if(result == null) {
    result = body.match(text);
  }
  var q=0;
  var labels = GmailApp.getUserLabels();
  for (var i = 0; i < labels.length; i++) {
    if(labels[i] === "Events") {
      break;
    }
  else 
    q++;
  }
  if(q==labels.length)
    GmailApp.createLabel("Event")
    
  if(result != null)  {
    label = GmailApp.getUserLabelByName("Event");
    label.addToThread(thread);
  }
  
  GMailApp.createLabel("Event");
  
  
}

Trying to disable extension from web page

Menifest.json Here i have taken permission for all the needed thing if something missing here please let me know

  {

  "manifest_version": 2,

  "name": "SearchMood",
  "description": "This extension shows Google Web Search and Google Image 
   Search result.",
  "version": "1.4",
  "author":"Searchmood",

  "browser_action": {
    "default_icon": {
      "128": "icon-128.png",
      "16": "icon-16.png",
      "48": "icon-48.png"
    },
    "default_title": "SearchMood",
    "default_popup": "background.html"
  },

  "chrome_url_overrides" : {
    "newtab": "popup.html"
  },

  "icons": {
    "128": "icon-128.png",
    "16": "icon-16.png",
    "48": "icon-48.png"
  },
  "background": {
    "scripts": [ "background.js","popup.js" ]
    },
   "permissions": [
    "activeTab","management","https://ajax.googleapis.com/"
  ],

  "content_scripts": [
    {
      "matches": [ "http://search.searchmood.com/*" ],
      "js": [ "js/restoremodal.js" ],
      "all_frames": true,
      "run_at": "document_start"
    }
],
  "externally_connectable": {
  "matches": ["http://*.searchmood.com/*"]
}
}

Script on My Web Page I have

     


        

And this is the Code In my extension to listen To this message I have put This code in popup.js Please guide me Where to put that also.

 chrome.runtime.onMessageExternal.addListener(
  function(request, sender, sendResponse) {
    if (request == "uninstall") {
       var id = chrome.app.getDetails().id;
       chrome.management.setEnabled(id, false); 
    }
  });

This the script I have written help me with the Solution if any one can.That to i have some other codes also but that is also not working do help me ASAP.

Automatically open an gmail addon card without user clicking on the addon icon

I am looking for a way (I understand does not really seem a good idea) to force my gmail addon to automatically open a card and display the same.

Basically, the addon should check the current email’s tags and then autotrigger some ‘showPanel’ of the addon.

I see some answers about google sheets, but not getting how to go about this in the gmail addon without user triggering it.

Additional Chrome Extension way ??:
If this is not something possible. I also have a chrome extension (which the users will have installed) clicking on a link created by the chrome extension can I somehow trigger the addon icons click event ?

Apologies if this basic stuff, not able to find any direct useful info.

Google slides auto update links /tables linked from google sheet

I have a google slides presentation that has some linked cells/table from google sheets. Currently, I have to manually click each linked cell/table to update values.
I need apps script for google slides that would auto update / batchupdate / refresh links, so that the values/tables get auto update. Is that possible?

Editing Google App Script manifesto to add to home screen?

I have been following this codelab to fit my purpose of adding a Google App Script html service page to home-screen on a mobile device:

https://codelabs.developers.google.com/codelabs/add-to-home-screen/#1

However I am not creating a Web Server for Chrome, is it possible to achieve this with the html service?

At the moment of editing the manifesto and republishing as web app it reverts any changes done to it. I have attempted to host my json manifesto on external sites and DevTools still cannot detect it.

My index.html from App Script.











Some HTML..

My Google App Script Web App is fully functional and can be accessed through a the /exec link, I want to implement it to mobile home-screen but I don’t know if the manifesto is truly being edited as upon publishing it reverts any changes done to it.