I am trying to remove the standard new button in recent list page of my custom object. But based on my research, Salesforce is not allowing javascript in its home page components anymore. Then there comes the recommendation of using Visualforce area home page component as an alternative, wherein one must create a vf page containing the javascript, then calling this page when creating a visualforce area home page component.
I've done this workaround, but still, it's not working.
Here's the vf page:
<apex:page >
<html>
<script type="text/javascript" src="https://c.ap2.visual.force.com/resource/1472886375000/jquery"></script>
<script type="text/javascript">
$j = jQuery.noConflict();
$j(document).ready(function hideButton(){
var url = window.location.href;
var tabUrl = "https://ap2.salesforce.com/a03/o";
if(url.indexOf(tabUrl) !== -1){
var newBtn = $j('[name="new"]');
newBtn.css({"visibility":"hidden"});
}
});
</script>
</html>
</apex:page>