function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
clouduserclouduser 

Open the visualforce tab in complete new window or tab

Any ideas to open the visualforce tab in a complete new window or tab? If I click on the tab, it should directly open it in a new window. please let me know your thoughts.
Best Answer chosen by clouduser
bob_buzzardbob_buzzard
To do this in a supported fashion (i.e. no javascript in the sidebar) you'll need to use a two-phased approach.  The user will click on the Visualforce tab and when that opens it executes some JavaScript to open a new window with the actual contents that you want to display.

The accepted answer of the following post shows how to open a window from JavaScript: 

http://stackoverflow.com/questions/14132122/open-url-in-new-window-with-javascript

All Answers

bob_buzzardbob_buzzard
To do this in a supported fashion (i.e. no javascript in the sidebar) you'll need to use a two-phased approach.  The user will click on the Visualforce tab and when that opens it executes some JavaScript to open a new window with the actual contents that you want to display.

The accepted answer of the following post shows how to open a window from JavaScript: 

http://stackoverflow.com/questions/14132122/open-url-in-new-window-with-javascript
This was selected as the best answer
clouduserclouduser
Thanks Bob for the suggestion!
clouduserclouduser
Please find the final version of the solution. Created a Custom VF tab for the below page. (1 VF Page, 1 Tab)
<apex:page >
    <apex:pageBlock>
        <h1> You are being redirected to another page</h1>
        <script>
            window.open('http://www.google.com','_blank');  // or any other VF page, etc.
        </script>
    </apex:pageBlock>
</apex:page>