OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
683 stars 95 forks source link

πŸ”₯😨 Excel: using Office.context.ui.displayDialogAsync wipes out contents of all iframes in the task pane #3006

Open wh1t3cAt1k opened 1 year ago

wh1t3cAt1k commented 1 year ago

Your Environment

Problem description

Using Office.context.ui.displayDialogAsync() wipes out all iframe contents in the task pane DOM.

Steps to reproduce

Use sample add-in in minimal repro: https://github.com/VelixoSolutions/office-js-reproduce-iframe-wipeout

  1. Click the "Run" button
  2. Observe iframe element added to the document

image

  1. After 3 seconds, observe "add-in wants to display a new window and click "Ignore":

image

Actual result:

Observe iframe body is gone:

image

Expected result:

No such thing happens. iframe contents should be preserved.

Provide additional details

This issue wipes out all real-time support opportunity we have with Intercom inside our add-in - its messenger uses an iframe to display the support chats.

Due to this issue, the support widget disappears from the app completely as soon as we display a single sign-on window.

There is no reasonable workaround - we have to use an external dialogue for single sign on, and it seems that the overlay logic for "add-in wants to display a new window" does crazy things.

DOM excerpt from the real world:

Before:

image

After:

image

ghost commented 1 year ago

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

RuizhiSunMS commented 1 year ago

Have forward this issue to heidi.

iotataru commented 1 year ago

@wh1t3cAt1k can you please make https://github.com/VelixoSolutions/office-js-reproduce-iframe-wipeout public or share it with me (email: iotataru@microsoft.com)

wh1t3cAt1k commented 1 year ago

@iotataru apologies, it was unintentionally private - this is public now :)

wh1t3cAt1k commented 1 year ago

Any update on this issue @iotataru @RuizhiSunMS ?

iotataru commented 1 year ago

The issue should be resolved. Let me know if it still reproduces on your end @wh1t3cAt1k

wh1t3cAt1k commented 1 year ago

@iotataru What is the fix version in the host / Office.js?

image

I cannot confirm that the issue is gone, it is still replicable on my side on the latest Chrome + Excel Online.

See the above screenshot, the iframe contents are replaced with empty head/body elements.

iotataru commented 1 year ago

It looks like the fix should be in Excel Online starting with version [16.0.16102.42304] Which version are you on?

wh1t3cAt1k commented 1 year ago

@iotataru my version 16.0.16330.42300.

The issue still replicates.

wh1t3cAt1k commented 1 year ago

@iotataru @RuizhiSunMS @Wenjun-Gong I have just verified that the issue replicates using the same exact reproduction step on the minimal repro repository, using Excel Online on Chrome. Therefore, it definitely has not been fixed.

image

(The IFrame initially contains "Foo" as text inside, after Office displays the dialogue prompt only empty head/body tags remain in the HTML, the contents are removed)

wh1t3cAt1k commented 1 year ago

Can we hope for any kind of feedback for this?..

iotataru commented 1 year ago

@wh1t3cAt1k yes the issue should be resolved. Can you confirm?

wh1t3cAt1k commented 1 year ago

@iotataru @RuizhiSunMS @Wenjun-Gong

I feel really silly - the issue still replicates and the steps did not change. (This is the second time the situation repeats πŸ™ˆ)

Can we hope for some serious attention to this problem?

Once again, the problem is not solved.

wh1t3cAt1k commented 1 year ago

@iotataru @RuizhiSunMS @Wenjun-Gong calling for your attention to this problem one more time...

RuizhiSunMS commented 1 year ago

@wh1t3cAt1k loatatru should be the owner actually.

iotataru commented 1 year ago

Deployment issue has been resolved a while ago, we should close this issue.