Coder Social home page Coder Social logo

gooz's Introduction

Gooz

Send the old sh*tty browsers away from your website as simple as a Gooz

Installation

You can install it from NPM:

npm install --save gooz

Or grab build/bundle.js and load it in your page. The Gooz class is now loaded as Gooz in the global scope (window.Gooz).

<script src="bundle.js"></script>
<script>
// Gooz is ready here! xD
</script>

Usage

// 1
const gooz = new Gooz({redirect: true}); // if it's gooz, it will redirect to 'http://outdatedbrowser.com'

// 2
const gooz = new Gooz(); // or using var instead of const
gooz.isGooz(); // true or false

// 3
const options = {
  features: ['SVGElement', 'localStorage'], // passing window global object you want to check
  globalObject: window, // global object (window)
  redirect: true, // auto redirect on class instance creation
  timeout: 7000, // redirect timeout (ms)
  uri: 'http://outdatedbrowser.com' // redirect uri
}
const gooz = new Gooz(options); // auto redirect if gooz and nothing if not

// 4
const gooz = new Gooz();
gooz.goozate(); // redirect if it's gooz

// 5
const gooz = new Gooz();
gooz.redirect({
  timeout: 1500,
  uri: 'http://mozilla.org/firefox'
});

Ideas || Issues

Just fill an issue and describe it. I'll check it ASAP!

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️

Pleas run grunt before sending PRs to run grunt tasks, lint your code and build it.

gooz's People

Contributors

mamal72 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.