Giter Club home page Giter Club logo

js-popunder's Introduction

Javascript Smart Popunder Maker

  • This class provides an easy way to make a popunder
  • Avoid blocked on Google Chrome
  • Note: For Google Chrome, to avoid blocked so each popunder will be fired by each click. You may increase chromeDelay option to pass Chrome Popup Blocker.

  • @author: Phan Thanh Cong [email protected]
  • @release: Jan 11, 2015
  • @version: 2.0
  • @license: MIT

Change logs

Version 2.1 - Jan 20, 2015
  • Improved, fixed pop on tab/window always be focused. (still issues on firefox, safari if use newtab)
  • New option blurByAlert (will show an alert message to focus the current tab - only for firefox, safari)
Version 2.0 - Jan 11, 2015
  • Rewrite all the class.
  • Add new SMART features to bypass Google Chrome Popup Blocker.
Version 1.2 - Jul 5, 2013
  • Fixed bugs on IE 6,7,8
  • Anti Google Chrome Blocker
Version 1.0 - 2011
  • First release

Usage

  • By defaults, popunder flags will work on each browser session that mean if you restart the browser, the popup will fire again. Of course, you may change the behavior by cookieExpires (number of minutes or instance of Date).

  • You have the general options with default values for popunder on new window:

    • width : window.screen.width
    • height : window.screen.height
    • left : 0
    • top : 0
    • location : 1
    • toolbar : 1
    • status : 1
    • menubar : 1
    • scrollbars : 1
    • resizable : 1
  • Options of Smart Popunder and default value:

    • cookieExpires : null // in minutes
    • cookiePath : '/' // path for cookie
    • newTab : true // Make pop on new tab or new windows ?
    • blur : true // Blur popunder if use new windows, but may not works on Mac Os
    • blurByAlert : false // For firefox, safari if open on newTab (will show an alert to force focus the current window)
    • chromeDelay : 500 // Increase the value if Chrome show popunder blocked message.
    • smart : false // for feature, if browsers block event click to window/body

Usage

<script type="text/javascript" src="popup.js"></script>
<script type="text/javascript">
// make pop on new tab
SmartPopunder.make('http://domain.com', {newTab: true});

// make pop on new window with size 100x100
SmartPopunder.make('http://domain.com', {width: 100, height: 100, newTab: false});

// use cookie expires on 12 hours
SmartPopunder.make('http://domain.com', {cookieExpires: 60 * 12});
</script>

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.