0

How to set following tag to be inactive in firefox browser?

<meta http-equiv="refresh" content="120"/>

The reason is described here

Community
  • 1
  • 1
gaffcz
  • 3,349
  • 14
  • 62
  • 105
  • For **IE** you can use conditional comments: ``, [reference](http://www.quirksmode.org/css/condcom.html). – Vucko Nov 07 '13 at 06:56
  • The title of the question does not match its body. Is this about Chrome only, or about Chrome and IE only? – Jukka K. Korpela Nov 07 '13 at 07:00
  • It's mainly for chrome.. sorry – gaffcz Nov 07 '13 at 07:02
  • 1
    After the edit, we don’t know whether the question is about Chrome or about Firefox. You should describe the original problem you are trying to solve, not an assumed way of solving an unspecified problem. – Jukka K. Korpela Nov 07 '13 at 07:27
  • Hmm, there is a link to original problem in my question.. I try to find out any usable solution – gaffcz Nov 07 '13 at 07:28

2 Answers2

1

If there is no conditional for chrome like for IE (like in comment above) than you can always check user agent on server side and add required meta tags if it is chrome.

Antoniossss
  • 24,977
  • 3
  • 43
  • 86
1

Detecting browsers is not a good idea. Though older version of jQuery support $.browser() it is not widely suggested.

Hence try to figure out the root cause of the problem and make it cross browser compatible.

Updates:

I have created a fiddle based using this answer,

var isOpera = !!window.opera || navigator.userAgent.indexOf('Opera') >= 0;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined';   // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome;                          // Chrome 1+
var isIE = /*@cc_on!@*/false;                            // At least IE6

document.write('isFirefox: ' + isFirefox + '<br>');
document.write('isChrome: ' + isChrome + '<br>');
document.write('isSafari: ' + isSafari + '<br>');
document.write('isOpera: ' + isOpera + '<br>');
document.write('isIE: ' + isIE + '<br>');

Using the above browser detection code, I have added this

if (isFirefox) {
  $('meta[http-equiv=Refresh]').remove();    
}

JSFiddle

Community
  • 1
  • 1
Praveen
  • 50,562
  • 29
  • 125
  • 152