[SalesForce] Visualforce page in service console as a tab

Click here for the code for reference

Why is it appearing blank in my tab and goes for indefinite processing?

I am not getting anything on the click of the link available on the page in Preview.
Moreover, when I try to access it via a tab in console I am not able to do so…. Am I doing something wrong.

<A HREF="#" onClick="testOpenSubtab();return false">
    Click here to open a new subtab</A> 

<apex:includeScript value="/support/console/22.0/integration.js"/>
<script type="text/javascript">
    function testOpenSubtab() {
        //First find the ID of the primary tab to put the new subtab in
        sforce.console.getEnclosingPrimaryTabId(openSubtab);
    }

    var openSubtab = function openSubtab(result) {
        //Now that we have the primary tab ID, we can open a new subtab in it
        var primaryTabId = result.id;
        sforce.console.openSubtab(primaryTabId , 'http://www.salesforce.com', false, 
            'salesforce', null, openSuccess, 'salesforceSubtab');
    };

    var openSuccess = function openSuccess(result) {
        //Report whether we succeeded in opening the subtab
        if (result.success == true) {
            alert('subtab successfully opened');
        } else {
            alert('subtab cannot be opened');
        }
    };
</script>

Best Answer

The list of urls to be displayed has to be provided in whitelist domains. Moreover, they have to be ',' separated. Without it , it won't work.

Related Topic