2

We're developing an AppExchange package and one of our customers has complained that our custom page freezes when he tries to open it.

They provided access to their sandbox where we found many custom VF homepage components in the standard sidebar. All of them were failing because of incorrect URL address of iframe only when our page is active.

We continued our research and found that SF sets 2 important attributes in iframes that are used for VF homepage components:

  • src="/blank.html"
  • onload="initContentFrame('URL_TO_VF_PAGE');

and the problem appears, because URL_TO_VF_PAGE may be absolute (in the most of cases) OR relative. Absolute URLs work good, but relative URLs (something like '/apex/OwnPageOfCustomer') do not work since a top page from an AppExchange package is based on another domain than other SF functionality (something like 'https://PACKAGE_NAME.eu2.visual.force.com/apex/PageInPackage1'). As a result, a browser tries to open the following URL in iframe: 'https://PACKAGE_NAME.eu2.visual.force.com/apex/OwnPageOfCustomer'.

Since OwnPageOfCustomer is not a page of the package, the "URL does not exist" error is shown.

So, my question: does anybody know what SF configurations may affect this? Why does SF use absolute URLs in the most of orgs and relative URLs sometimes in several orgs? We tried to reproduce this issue in our dev org, but didn't succeed.

p.s. One guy talked about a similar problem, but he didn't find an answer: Sidebar visualforce iframe “sometimes” served from force.com instead of saleforce.com?

[UPDATED]: Concrete examples of URLs:

1) URL of a Visualforce page from a package: https://mea.cs52.visual.force.com/apex/MassEditAllActivities

2) Bad IFrame for the sidebar generated by SF in one org (it was extracted via developer console in Google Chrome). It does not work, because relative URL is used:

<iframe
    frameborder="0" id="contentPane" name="contentPane"
    onload="initContentFrame('/apex/SalesResource?core.apexpages.framework.ApexViewServlet.getInlinedContentRequest=1&amp;sfdcIFrameOrigin=https%3A%2F%2Fcs52.salesforce.com%2Fhome%2Fhome.jsp&amp;inline=1&amp;autoMapValues=1&amp;sdfcIFrameOrigin=https%3A%2F%2Fcs52.salesforce.com%2Fhome%2Fhome.jsp&amp;core.apexpages.devmode.url=1', true, false , 'https://cs52.salesforce.com' );"
    src="/blank.html" style="width: 100%; height: 100%" title="Content Pane">
</iframe>

3) Correct IFrame for the sidebar generated by SF in another org. It works, because absolute URL is used:

<iframe
    frameborder="0" id="contentPane" name="contentPane"
    onload="initContentFrame('https://gs-test.na14.visual.force.com/apex/SalesResource?core.apexpages.framework.ApexViewServlet.getInlinedContentRequest=1&amp;sfdcIFrameOrigin=https%3A%2F%2Fna14.salesforce.com%2Fapex%2Fsharem__Folderize&amp;inline=1&amp;autoMapValues=1&amp;sdfcIFrameOrigin=https%3A%2F%2Fna14.salesforce.com%2Fapex%2Fsharem__Folderize&amp;core.apexpages.devmode.url=1', true, false , 'https://na14.salesforce.com' );"
    src="/blank.html" style="width: 100%; height: 100%" title="Content Pane"
</iframe>
  • Could you provide example code of a link that fails? It might help us help you. – sfdcfox Jul 2 '16 at 21:45
  • Hi @sfdcfox. I think a concrete example does not matter, because when we create a new Visualforce homepage component we select only a page. Then Salesforce decides how to show this page in the sidebar: it shows the page in an iframe. And the problem is in a place where Salesforce generates a URL for this iframe. But in any case I've added examples in the original post. Please take a look at the updates. – Gennadiy Jul 4 '16 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.