Office Add-in Javascript disabled? - outlook

Background
We have an Office Addin running in production and we've stumbled across a case with a customer where I suspect that his Mac computer won't run Javascript in Outlook. I haven't been able to confirm it but the symptoms point to that. For example, event handlers for buttons won't fire.
Questions
What browser is running the add-ins inside Office for Mac?
How can I confirm or deny that Javascript is running in Office?

You can run the command
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
from the terminal and relaunch outlook. When you launch Addin, you can invoke debugger tool using menu item Inspect Element (do right click).
It might help you to debug your Addin issues.

I'm not sure what is going on here but if the add-in properly launches then we can rule out JavaScript itself not running. Were this the case the Office.initialize event would fire and Outlook wouldn't report an error.
As to what is actually happening, I would need a bit more information. They primary questions I have would be:
Are they able to run other add-ins properly?
Are they using Outlook 2016 against a modern Exchange Server or O365?
Have the updated Outlook to ensure they have the latest bits installed?

Related

How to inpsect console logs of outlook add-in on mac?

Problem
I can't debug or inspect console logs on my outlook add-in while developing on my mac.
What I've tried
According to other questions (How to debug office add-in for mac?, debug office 365 taskpane app on Mac?), one of the following should work:
the Safari Web Inspector (this unfortunately doesn't work for me, I've asked about this on MS'Q&A Forum here)
the VSCode Debugger extension (this doesn't work for me either, I've filed a GH issue about this with a reproduction repository attached)
downloading a non-app store build as suggested here
I haven't tried VorlonJS because it seems overly complicated and I'd ideally not resort to a third-party plugin.
Please run this command in console- defaults write com.microsoft.Outlook OfficeWebAddinDeveloperExtras -bool true
This will enable inspect elements options in Add-in

Office Add-In for Outlook not sideloading on the app

I have created an custom outlook add in. When I side load it on using the website it works with no issues. When I go into the Outlook app and try to side load, it will install but not show up on the task pane. Is there a reason for this? Thanks!
There are multiple reasons why your add-ins may not be displayed in Office applications/task panes. One of them is the use of http protocol instead of https.
Another point is the privacy control setting in the registry that can be distributed by group policies. Especially the key:
HKEY_CURRENT_USER\Software\Policies\Microsoft\office\16.0\common\privacy -> controllerconnectedservicesenabled
if it is set to dword:00000002 (which is disabled).
You need to change it to dword:00000001 (enabled) and the add-in may immediately appear.The relevant information can be found in the article.
But I'd suggest starting from the Troubleshoot development errors with Office Add-ins article.

Is there a way to debug the function file in Outlook for Mac?

I'm building an Outlook add-in that utilizes the ItemSend event. The function I've written for it works well in Outlook 365 web, but not in Outlook for Mac (Insider Fast Preview). The function definitely runs because I can control whether to allow the event and that works, but I'd like to be able to debug it at a more granular level.
I've already followed the docs for setting up debugging on mac, which allows me to open the safari dev tools for the Taskpane, but there doesn't appear to be any equivalent for the function file. I also tried setting up vorlon, but it also doesn't appear to attach to the function file.
Is there any way I could attach a debugger or even just view console logs for the function file?

Outlook add-in to launch when using File Explorer Send to - Mail Recipient

I have a Outlook add-in that adds visual things to the email compose window and then catches the send-event, does stuff, and then let Outlook send or cancel it.
Works fine, but if I use the send file option from explorer, without outlook running, it will not start the add-in. The window is missing all the added UI elements. When I click send button it will start the add-in. I get a welcome screen we coded and it starts logging the add-in startup debug messages.
But it will not catch the send event or do anything else for that matter. The last log message shows init was completed. The Outlook process will be left in the task manager. If I open Outlook after that I will see that the email I sent is in outbox. Without any modifications the event handler would have done.
Is there anyway to get add-into run in this use case?
Looks like this problem was because I had only run the project in debug mode from Visual studio. I had never installed it from the package.
Once I had ran the installer it begun to start the add-in as soon as I chose "send to mail recipient" thus fixing the problem.

Is Office.context.ui.messageParent broken in Outlook 2016 for Mac?

I'm working on an Outlook addin using the new Office-JS apis, and in building out the authentication flow, I've found that in the Outlook 2016 for Mac case, the dialog system seems to not work properly.
To be clear, we're using the Office Insider Fast Track build as it has much improved support for the Office-JS API.
I've been through several iterations of this particular piece (most of which worked fine both in the Windows client and the web client on Mac and Win), and have had no luck. The scenario is:
List item
Open up the task pane in outlook.
Hit the sign in button
A new window opens, pointed at our authentication portal
User signs in.
On auth completion, the window redirects to a page in the office add-in scope, and calls back to the parent frame with the auth token, where it can be further processed.
Steps 1 through 5 work fine on all platforms. Step 6 refuses to work on Outlook for Mac. Initially, this flow was built using the native js window.open and window.postMessage apis. As mentioned above, this worked everywhere but Outlook Mac, where, the API seemed to ignore the window options and just open the url in a new tab in whatever browser was open and never setting the child window reference (result of window.open being null).
Failing this, I followed the advice found here on SO to use the Office functionality, displayDialogAsync and messageParent. After some initial hurdles, this too was setup and working on every platform save Outlook Mac.
As there is no dev tools or JS console support in Mac Outlook, I followed the advice found here Howto: Outlook 2016 for Mac - Debugging/View Console Logs in Outlook Add-in and setup Vorlon to attempt to get some context, adding numerous logging points to try and get some context. Unfortunately, while Vorlon does pick up my auth landing page as a client, and sees the Office interfaces, none of my console outputs are presented, making it seem as though the JS isn't running at all.
At this point I'm not sure what to try next. Has anyone run into this issue, or gotten this to work on the Outlook 2016 for Mac client?
Clarifying context:
All auth pages are listed in the AppDomains section of the Manifest.
While initial versions pointed directly at our auth service (this worked on not Mac), the current version first opens up an in scope pre-auth page that redirects to the auth service.
The Office-JS api's block alerts, preventing their use in displaying useful information.
Authentication through all versions of this app have worked on both Outlook 2016 on Windows and OWA on both Win and Mac.
Thank you.
This issue in Outlook Mac has been fixed a few months ago. If anyone still encounters this issue with a recent Outlook Mac build, please reply with the build number.
The Office.context.ui is undefined in v16.17 (180909) build of Outlook for Mac 2016 using the following OfficeJS dist:
https://appsforoffice.microsoft.com/lib/1/hosted/office.js

Resources