Firefox/Mycroft coding question

Discussion in 'OT Technology' started by riegulate, Nov 3, 2004.

  1. riegulate

    riegulate Guest

    I just made my own mycroft-search engine-plugin thing. I want to include it in my site (without submitting it to the mycroft devolpment page). How would one code this, html-wise? I looked at the mycroft site's code, but only found this:
    Code:
    		<!--
    		function errorMsg(name,ext,cat)
    		{
    		  // alert("Netscape 6 or Mozilla is needed to install a sherlock plugin");
    		  f=document.createElement("form");
    		  f.setAttribute("name","installform");
    		  f.setAttribute("method","post");
    		  f.setAttribute("action","http://mycroft.mozdev.org/error.html");
    		  fe=document.createElement("input");
    		  fe.setAttribute("type","hidden");
    		  fe.setAttribute("name","name");
    		  fe.setAttribute("value",name);
    		  f.appendChild(fe);
    		  fe=document.createElement("input");
    		  fe.setAttribute("type","hidden");
    		  fe.setAttribute("name","ext");
    		  fe.setAttribute("value",ext);
    		  f.appendChild(fe);
    		  fe=document.createElement("input");
    		  fe.setAttribute("type","hidden");
    		  fe.setAttribute("name","cat");
    		  fe.setAttribute("value",cat);
    		  f.appendChild(fe);
    		  document.getElementsByTagName("body")[0].appendChild(f);
    		  if (document.installform) { 
    		    document.installform.submit();
    		  } else {
    		    location.href="http://mycroft.mozdev.org/error.html"; //hack for DOM-incompatible browsers
    		  }
    		}
    		function addEngine(name,ext,cat)
    		{
    		  if ((typeof window.sidebar == "object") && (typeof
    		  window.sidebar.addSearchEngine == "function"))
    		  {
    		    //cat="Web";
    		    //cat=prompt("In what category should this engine be installed?","Web")
    		    window.sidebar.addSearchEngine(
    		      "http://www.DOMAINHERE.com/"+name+".src",
    		      "http://www.DOMAINHERE.com/"+name+"."+ext,
    		      name,
    		      cat );
    		  }
    		  else
    		  {
    		    errorMsg(name,ext,cat);
    		  }
    		}
    		//-->
    		</script>
    
    
    
    	</head>
    	
    		<body>
    <a href="javascript:addEngine('search.src','gif','Arts')">Plugin</a><br>
    
    
    Now, seems all pretty logical and correct right? well, it's not working. What am I missing?
    The dialog comes up with the "do you really want to add bla bla bla to your search bar?", but it doesn't add it when I say 'yes'.

    Any ideas?
     

Share This Page