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

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

Related

"App not found, Please verify..." when launching from Visual Studio, but installs normally from Developer Portal

I'm currently learning Teams development and I just installed the Teams Toolkit extension. Following the quickstart guide, launching the app opens my browser with the Teams web app and the message
App not found, Please verify the app and it's[sic] access
permissions.
Fortunately, this app can still be launched when selecting the "Preview in Teams" option in the Developer Portal.
Quoting the GettingStarted.txt:
If you Start Debugging in a browser and Teams shows the message "App not found, Please verify the app and it's access permissions", it means the app hasn't been uploaded to Teams Dev Portal. To resolve this, follow the steps in the Quick start section above. The Project > TeamsFx > Configure for SSO menu command will do this step for you.
Except it was successfully uploaded to Dev Portal.
What I did
Did this "Configure for SSO" thing. No problems with that and the app was successfully added to the Developer Portal.
Where I searched for an answer
VS Marketplace page for Teams Toolkit (Reviews, Q&A)
Github page (issues) for Teams Toolkit
This very site - Stack Overflow.
Obviously, I'm not 100% sure that I haven't missed anything.
Temporary solution
In the meantime, I set the "launchBrowser" property to "false" in launchSettings.json. However, it's a waste of time to constantly go back to the Developer Portal to launch it, especially when the functionality is there.
Visual Studio 2019, Microsoft Development Account.
Thanks in advance.
We tried to repro this issue at our end and it is working fine for us. Could you please make sure app is opened in same tenant with which you configured for SSO. Also please remove all credentials from cache to make sure its not taking another credentials and try again.
Assuming nothing else was changed from the new project template, there are a few things you can try to narrow down the issue.
Open your browsers web dev tools and watch the console after clicking the Add button (before you see the error message). Sometimes a useful error message from the developer portal helps identify the issue.
Verify that when Visual Studio launches the URL, the correct tenant is loaded in Teams.
Run the project in VS, then manually navigate in your browser to the endpoint of your tab that you expect to work. It would be something like https://localhost:44357/tab by default (the value is in the manifest.json). The sample won't work completely because it's not running inside Teams, but you should be able to verify it's working locally.
If none of that helps, please log an issue on the GitHub page and we can investigate a bug.

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?

debug office 365 taskpane app on Mac?

I am trying to debug task pane app on a Mac. Already tried https://dev.office.com/docs/add-ins/testing/debug-office-add-ins-on-ipad-and-mac. I can see it detects browser instances but it CANNOT detect task pane app.
I followed all steps properly. Except, that I don't have "Staff" user group on my mac. Should that make difference?
How do I detect/debug office task pane app on a mac?
I used chrome before that allowed me to access vorlon by choosing option to navigate to untrusted https website. So I never got to go on step 13 in the documentation. This time I used safari and then I had to trusted certificate and then after it worked like charm.

Office Add-in Javascript disabled?

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?

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