/angularjs-adblock

Adblock Detect for angular.js

Primary LanguageJavaScriptMIT LicenseMIT

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';
        adblockProvider.cancel = true; // Cancel button in alert
        adblockProvider.refresh = true; // I have Dısable Adblock button in alert 
    }]);

License

Licensed under the MIT license