none
Catch event close when edit/open office file in browser use Office Web App Server 2013 RRS feed

  • Question

  • Hi, Can anyone help me, how to catch event close when edit/open file use Office Web App 2013?

    I found a [MS-WOPI] doc version [MS-WOPI] - v20161017,

    Method CheckFileInfo return JSON, It has 3 property

    "CloseButtonClosesWindow":{"type":"bool","default":false,"optional":true},
    "ClosePostMessage":{"type":"bool","default":false,"optional":true},
    "CloseUrl":{"type":"string","default":"","optional":true},

    CloseButtonClosesWindow: A Boolean value that indicates that the WOPI client SHOULD close the
    browser window containing the output of the WOPI client when the user calls the close UI.
    ClosePostMessage: A Boolean value that indicates that the WOPI client SHOULD notify the WOPI
    server in the event that the user closes the rendering or editing client currently using this file.
    CloseURL: A URI to a web page that the implementer deems useful to a user in the event that the
    user closes the rendering or editing client currently using this file.

    CloseButtonClosesWindow: show button X on the top right corner of screen

    But ClosePostMessage, CloseURL didn't run



    Thursday, January 5, 2017 11:45 AM

Answers

  • Hi HuanBui, 

    I've tested this using the sample WOPI handler from: 

    SampleWopiHandler

    And my conclusion after testing and discussing with our WAC team is that Office Online 2016 does support the UI_Close message but Office Web Apps 2013 does *not* send this message.

    Thanks,

    Tom

    Friday, January 27, 2017 9:59 PM
    Moderator

All replies

  • Hi HuanBui,

    Thank you for your question.  An engineer from the protocols team will contact you soon.


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team

    Thursday, January 5, 2017 5:49 PM
    Moderator
  • Hi HuanBui, 

    Take a look at the description for ClosePostMessage (excerpted below). It says:

    Perhaps you need to make sure that CloseUrl is *not* set so that the UI_Close PostMessage will be sent.

    Best regards,
    Tom Jebo 
    Sr Escalation Engineer
    Microsoft Open Specifications Support

    ClosePostMessage

    Boolean value that, when set to true, indicates the host expects to receive the UI_ClosePostMessage when the Close UI in Office Online is activated.

    Hosts can also use the CloseUrl property to indicate that the outer frame should be navigated (window.top.location) when the Close UI is activated rather than sending a PostMessage, or set the CloseButtonClosesWindow property to indicate that the Close UI should close the browser tab or window (window.top.close).

    If the CloseUrlClosePostMessage, and CloseButtonClosesWindow properties are all omitted, the Close UI will be hidden in Office Online.

    Note

    The Close UI will never be displayed when using the embedview action.

    Thursday, January 5, 2017 7:05 PM
    Moderator
  • Hi Tom,

    I tried but did not get, I'm not sure that in OWA 2013 SP1 support for this property
    What do you have other information on this problem in OWA 2013 SP1?

    Thank Tom,

    Sincerely,

    Friday, January 6, 2017 6:01 AM
  • Thanks for reporting back to me on this HuanBui, I can check to verify that the support is there and let you know tomorrow. 

    Tom

    Friday, January 6, 2017 6:07 AM
    Moderator
  • Hi HuanBui, 

    Thanks for your patience on this. I'm still confirming a couple of things but from what I see in the 2013 code, it looks like everything is in place. The only catch is that we only send the ClosePostMessage when the user closes with the close button. Other ways that cause Word to close will not send it. 

    Tom

    Saturday, January 14, 2017 1:27 AM
    Moderator
  • Hi HuanBui, 

    I've confirmed that ClosePostMessage is implemented in the 2013 code and should be working. 

    One thing to confirm with you is are you sending PostMessageOrigin as well? 

    Your code has to send a PostMessageOrigin too, otherwise the web app code won’t use them. 

    See wopi.readthedocs.io reference for PostMessageOrigin.

    Tom

    Wednesday, January 18, 2017 7:45 PM
    Moderator
  • Thank Tom,

    I tried, but it's still not running. And I have a another solution, that I use host page https://wopi.readthedocs.io/en/latest/hostpage.html and I catch event close in that page, that use javascript. It's not a good solution but I think It's a solution when I can't make ClosePostMessage run correctly


    • Edited by HuanBui Thursday, January 19, 2017 1:56 AM edit
    Thursday, January 19, 2017 1:53 AM
  • Hi HuanBui, 

    I've tested this using the sample WOPI handler from: 

    SampleWopiHandler

    And my conclusion after testing and discussing with our WAC team is that Office Online 2016 does support the UI_Close message but Office Web Apps 2013 does *not* send this message.

    Thanks,

    Tom

    Friday, January 27, 2017 9:59 PM
    Moderator