SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclusive Firefox DOM property or method?

    Is there any exclusive Firefox DOM property or method? Such as window.opera of Opera and window.ActiveXObject of IE.

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by IanYang View Post
    Is there any exclusive Firefox DOM property or method? Such as window.opera of Opera and window.ActiveXObject of IE.
    I know of one property which looks likely to be and remain unique, but why do you think you need to detect this browser?
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Logic Ali View Post
    I know of one property which looks likely to be and remain unique, but why do you think you need to detect this browser?
    Because of performance issue. Using DOM property or method is faster than doing regular expression test in navigator.userAgent.

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by IanYang View Post
    Because of performance issue. Using DOM property or method is faster than doing regular expression test in navigator.userAgent.
    No - I meant why do you think you need to perform any form of detection for this browser?
    Tab-indentation is a crime against humanity.

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Logic Ali View Post
    No - I meant why do you think you need to perform any form of detection for this browser?
    It is a common situation. Sometimes you want to define some functions only for Firefox.

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by IanYang View Post
    It is a common situation. Sometimes you want to define some functions only for Firefox.
    Performing browser detection is the last thing you want to do, because you are guaranteeing that anything which is not Firefox but has the same problem, isn't going to be fixed.

    Also, if Firefox is updated to fix that problem, you may be trying to fix something that doesn't need to be fixed any more, which ends up making things worse for yourself.

    Instead, perform object detection where you check for the problem that needs to be fixed, and should that problem be there you can then do something about it.

    What is the problem that needs to be fixed? As it is a common situation, there will be a common solution that resolves the issue for you.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Performing browser detection is the last thing you want to do, because you are guaranteeing that anything which is not Firefox but has the same problem, isn't going to be fixed.

    Also, if Firefox is updated to fix that problem, you may be trying to fix something that doesn't need to be fixed any more, which ends up making things worse for yourself.

    Instead, perform object detection where you check for the problem that needs to be fixed, and should that problem be there you can then do something about it.

    What is the problem that needs to be fixed? As it is a common situation, there will be a common solution that resolves the issue for you.
    Okay, thank you.


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
  •