Block old browsers

Asked

Viewed 307 times

5

Is there any way to block browsers ancient? To be more direct: do not leave these browsers, such as IE 6 access my website? I did some research on internet and found no source on this subject.

  • 2

    Already tested https://github.com/burocratik/outdated-browser ?

  • I’ll test it now, I didn’t know it existed;

  • Used and approved...

1 answer

7


You didn’t tag it , but there are interesting projects that can help you:

To use include css:

<link rel="stylesheet" href="your_path/outdatedbrowser/outdatedbrowser.min.css">

Include plugin’s script at the bottom of the HTML body:

The js:

<script src="your_path/outdatedbrowser/outdatedbrowser.min.js"></script>

Paste the required HTML at the end of your Document (see demo examples):

And create this element:

<div id="outdated"></div>

To call use:

//event listener: DOM ready
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
//call plugin function after DOM ready
addLoadEvent(function(){
    outdatedBrowser({
        bgColor: '#f25648',
        color: '#ffffff',
        lowerThan: 'transform',
        languagePath: 'your_path/outdatedbrowser/lang/br.html'
    })
});

Supported languages: https://github.com/burocratik/outdated-browser/tree/develop/outdatedbrowser/lang

Examples: https://github.com/burocratik/outdated-browser/tree/develop/demo

  • 1

    This saved me, thank you... I took the test for IE6 and it worked,

Browser other questions tagged

You are not signed in. Login or sign up in order to post.