Ticket Q520385
Visible to All Users

CommonFunctions.js file is throwing errors when DevExpress app hosted in iframe in a different domain

created 11 years ago

I have an xaf app that is being hosted within an iframe from a different domain. Meaning that attempts to access the window object from within the iframe will cause Access denied errors.

My app is a detail view with an associated list view. When I move my mouse over the listview, it raises an exception in the function xafMM() when it attempts to access the window object. When I debug the page, I can see that there are onmousemove events that call this function (as well as onmousedown and others).

The function is in the C:\Program Files (x86)\DevExpress\DXperience 13.1\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Web\Resources\CommonFunctions.js and there are several other references to the window object in this javascript file. Could those be wrapped in try catch to avoid javascript Access Denied exceptions when in this scenario?

Alternatively, is there a way I can hook into the cells and rows at the time of page creation to modify the onmousemove attribute myself? I was able to get into the Grid.HtmlRowCreated and add attributes to the row. I could also iterate through the cells, but it appears that when I add attributes to the cells, they get blasted by some processing that is happening later within the xaf framework.

I appreciate any help.

Thanks.

Comments (2)

    Correction. It appears that the access denied error is actually coming from the function: document.selection.createRange().text and is only appearing IE.

      Apparently it is a known issue in IE 9 that if the document.selection.type == "None" or if its a hidden element that it will throw an access is denied error. I found references to workarounds here: https://github.com/tinymce/tinymce/pull/122/files which basically wrap it in a try catch.
      So, I beleive this is still something DevExpress should address in their CommonFunctions.js. Agreed?

      Answers approved by DevExpress Support

      created 11 years ago (modified 11 years ago)

      Hello Chad,
      >>
      I have an xaf app that is being hosted within an iframe from a different domain.
      <<
      I am afraid this usage scenario is not officially supported by XAF. So, we cannot recommend you use XAF here because we have not run our internal functionality and unit tests under such circumstances, and thus there may be other problems further on road.
      Having said that, we cannot promise quick improvements to the CommonFunctions.js file, because it may fail in other places as well, although your suggestions look valid.
      However, we had a few customer requests about supporting this scenario in XAF and will take your feedback into account when planning future XAF releases. For now, I already added a link to your ticket at Embed XAF view in iframe, which you may find helpful as well.
      At this stage I can only recommend you recompile the XAF source code and modify the required script files according to your business needs: How to recompile the XAF source code.

        Comments (2)

          Thanks Dennis. Your response is what I figured it would be after reading through the forums. I had already started looking at recompiling, which is what I will probably decide to do.

          Dennis Garavsky (DevExpress) 11 years ago

            Thank you for the update, Chad. Let us know if we can assist you with anything else.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.