OK so we have a standard page for an custom object. Users would like to have a button or link to another site to obtain information from another web site and application. The problem is that the external application only runs in IE.

What I'd like to do is show the button based on the browser the user is using at the time. Only show the button when they are using IE and hide it when they are using any other browser.

No I can't get the creators of the other site to change so they are browser neutral. They are a MS shop and have created their whole site based on IE specific features.

3 Answers 3


While you can't make a button visible or not on the standard page layout, you could make the button be a Javascript button that checks the user's browser and then either redirects them or displays an alert message that they must use IE.

  • That may work. I'll run that option by the users when this one comes up for work. Oct 28, 2013 at 16:28
  • That worked just fine and will probably be the solution. For others, in your javascript, do if( navigator.userAgent.indexOf( "MSIE" ) > -1 ) to check for IE then do normal javascript to either use window.alert() to pop up a message or window.open( url, title, options ) to go to the assigned link. Oct 29, 2013 at 13:45

This seems more a css issue. Give the button a class named btn_special_class Set in the header:

.btn_special_class {display:none;}

And then make it visible for ie

<!--[if IE]>
    .btn_special_class {display:inline;}
  • I beleiev he's asking about a standard page, not a VF page Oct 28, 2013 at 14:18
  • SF_Ninja, you are correct. I wasn't sure what to tag it with. Since you can have a button point to a VF page, I used the VF tag. I don't want to have to transition to multiple pages but at the same time, I don't want the button to be visible when the browser isn't IE. If it were a VF page, I'd be able to add the javascript but alas, such is not the case. Oct 28, 2013 at 14:37

You will likely need to use a homepage component to inject some Javascript into the standard page.

Setup -> Customize -> Home -> Home Page Components

Create a New Custom Component with the type as an HTML area. Use the show HTMl checkbox and now you can have any html/javascript to traverse the DOM of the page

Since you seem to only want it on this one particular page, you would maje it a wide component. If you wanted it to run on every page, you would make it a narrow component and change the UI settings to show the Sidebar on all pages.

This is my Safe Harbor Statement to using this method. This method works, but should be used at your own risk. You are in essence, injecting code into the standard SF page, so any changes to the SF standard pages, could effect or break your code. Just a forewarning. This method definitely works, but it is somewhat 'Hackish'


Actually looks like @RajatPaharia and @MetaDaddy did a pretty good explanation of this for another question. Take a look

How can I execute JavaScript on a SFDC Standard Detail Page?

  • That isn't quite what I want to do. I can't guarantee that the user is showing the side bar and they want a button right on the page. I might have to just make it a training issue that they have to use IE but since most of the sales people use the Apple products, this might end up being something of a non issue. Oct 28, 2013 at 14:45
  • If you can't control some of these outside variables, then yes, it does seem like more of a training issue for the end users. If they are mostly using macs, bonus for you as you only have to worry about the limited number of PC folks. Good luck Oct 28, 2013 at 14:53
  • The hard part is that most of the powers that be don't take, "It doesn't work that way." for an answer. I find this odd with IT managers that should know the difference between the way a web browser works as apposed to a desktop application that is hard wired to the OS and it's technology. Oct 28, 2013 at 15:47
  • I feel your pain. Been there as well. Very frustrating. Oct 28, 2013 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .