SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to set default homepage in mozilla using Java/JavaScript

    Hi,
    Can anyone help me how to set default website as homepage in mozilla using java/ javascript.

    Following javascripts code works in IE but not in Mozilla.

    <input type="button" value="Set Default"
    onClick="this.style.behavior='url(#default#homepage)';
    this.setHomePage('http://www.myDefaultWebsite.com')">


    Thanks !
    Anil

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,788
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    That code only works in IE because of a security hole. The most common use for the code is to hijack peoples home page to point it to an advertising site or porn site and so decent web browsers have completely removed support for it.

    If people want to change their home page then they can use their browser menu options to do so.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply !
    Is there any other way to achieve this objective using java technology ?

    Anil,

  4. #4
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    alert("Please set this site as your homepage! Pretty please?");


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •