laugh-at-ie

1.0.7 • Public • Published

Laugh at IE

MIT npm version size Netlify Status

This script laugh at those who still access your website with Internet Explorer. 😂

Demo site (Open with IE, please 🙏)

Demo video (for non-Windows user)

  • Play laughing sound when page is loaded and when any error occurred with IE.
  • You can set an arbitrary function to callback when laughing sound is played.
  • Supports IE 9+

Installation & Usage

Install via npm

npm install laugh-at-ie

Import it to your project & initialize it.

import LaughAtIE from 'laugh-at-ie'  

const laugh = new LaughAtIE()
laugh.init()

or using <script> tag in the HTML:

<script src="https://unpkg.com/laugh-at-ie/dist/index.js"></script>
<script>
var laugh = new LaughAtIE();
laugh.init();
</script>

Customization

You can designate your original laughing sound and callback function. Default settings below.

var laugh = new LaughAtIE({
    onLoad: {
        sound: 'https://laugh-at-ie.netlify.com/sound/laugh.mp3',
        callback: function(){}
    },
    onError: {
        sound: 'https://laugh-at-ie.netlify.com/sound/laugh2.mp3',
        callback: function(e){
            //You can get error message 
            alert('Error!\n\n' + e)
        }
    }
});
laugh.init();

sample

Demo site

function error(e) {
    var confirm = window.confirm('Error message: ' + e + '\n\nAn error has occurred. Do you want to get Chrome?');
    if (confirm) {
        location.href('https://www.google.com/chrome/')
    }
}

function welcome() {
    alert('Are you still using Internet Explorer???');
}

var laugh = new LaughAtIE({
    onLoad: {
        callback: welcome
    },
    onError: {
        callback: error
    }
});
laugh.init();

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i laugh-at-ie

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

8.77 kB

Total Files

4

Last publish

Collaborators

  • the-fukui