gurolayanlar / angularjs-adblock

Adblock Detect for angular.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angularjs-adblock

Detects browsers that use AdBlock and displays a warning on the screen.

Usage

  1. install package via bower:

$ bower install angularjs-adblock

  1. include the supplied JS and CSS file.
<link rel='stylesheet' href='dist/detect-adblock.css' type='text/css'/>
<script type='text/javascript' src='dist/detect-adblock.js'></script>
  1. Include the loading bar as a dependency for your app.
angular.module('myApp', ['detectAdblock'])
  1. Start detect
angular.module('myApp', ['detectAdblock'])
.run(function (adblock) {
        adblock.detect();
 });
  1. Activate adblock and see alert.

Configuration

Customize the template:

    angular.module('myApp', ['detectAdblock'])
    .config(['adblockProvider', function(adblockProvider) {
        adblockProvider.imagePath = 'your_alert_image';
        adblockProvider.title = 'your_alert_title';
        adblockProvider.description = 'your_alert_description';
  }]);

License

Licensed under the MIT license

About

Adblock Detect for angular.js

License:MIT License


Languages

Language:JavaScript 78.5%Language:CSS 21.5%