1

My code

I have a test spread sheet and I have an Apps Script project linked to it.

Here is the code for Code.gs

function onOpen() 
{
   var testMenu = SpreadsheetApp.getUi() 
      .createMenu('Custom Menu');

      testMenu.addItem('Show UI in sidebar', 'showSidebar');
      testMenu.addToUi();
};

function showSidebar(){
  var html = HtmlService.createTemplateFromFile('Page');
  SpreadsheetApp.getUi().showSidebar(html.evaluate());
}

function doWorkInAppsScriptFile()
{
    Logger.log("WORKING")
}

And the code for Page.html

<h2>google script run test</h2>
<div style="width:98%;margin:10px">
    <div style="width:98%;margin:10px;padding:10px;text-align:center">
        <input type="button"  id="saveButton" onclick="onSave()" value="Save" style="background:DarkGreen;color:White;font-weight:bold;margin:10px"/>
    </div>
</div>

<script type="text/javascript">

function onSave(){          
  google.script.run.doWorkInAppsScriptFile();     

}

</script>

Problem

In Microsoft edge: the Apps Script logger shows "Status: Failed" Microsoft edge failure (Not enough rep to post image)

While when running from google chrome it shows "Completed": Google completion

Other info:

  • OS: Arch Linux
  • Edge Version: Version 103.0.1264.37 (Official build) (64-bit)Version 103.0.1264.37 (Official build) (64-bit)
  • Chrome version: Version 102.0.5005.115 (Official Build) (64-bit)
Feelix343
  • 51
  • 1
  • 5
  • Click on the "Status failed" , it'll expand to show a error. – TheMaster Jun 28 '22 at 14:06
  • @TheMaster Only the logs that show completed expand. The ones that say failed do not – Feelix343 Jun 28 '22 at 16:18
  • Change your cloud project as described [here](https://stackoverflow.com/a/63851123) and see if you can capture the actual error. – TheMaster Jun 28 '22 at 17:19
  • Please add more details... are you signed in into multiple google accounts? have you tried using Edge in private mode with all the extensions / add-ins disabled? – Rubén Jun 29 '22 at 09:24
  • 1
    @Rubén It worked when in private mode. It is something with the google accounts. Thanks for the suggestion. – Feelix343 Jun 30 '22 at 17:28

1 Answers1

1

I figured it out. If I sign out of all accounts, it works.

Feelix343
  • 51
  • 1
  • 5