Adblock checker for use on AkashaCMS websites, detecting whether an advertisement has been blocked, displaying a message of your choice to the visitor.
This plugin requires wrapping your advertising code with a wrapper div. It runs some JavaScript to detect if the advertisement was blocked, and then inserting a message of your choice.
import { AdblockCheckerPlugin } from '@akashacms/plugins-adblock-checker';
config
.use(AdblockCheckerPlugin, {
selector: '\".advert\"',
codeOnBlocked: `
<div style="border: 1px solid red; max-width: 100%;">Browse available:
<ul class="list-group">
<li class="list-group-item list-group-item-info"><a type="button" class="btn btn-outline-primary btn-lg" href="proxy.php?url=https%3A%2F%2Fgithub.com.%2Fev-charging%2Frange-confidence%2Fchap8-tech%2Felectric-car-extension-cords.html">Electric vehicle charging cords.</a></li>
<li class="list-group-item list-group-item-info"><a type="button" class="btn btn-outline-primary btn-lg" href="proxy.php?url=https%3A%2F%2Fgithub.com.%2Fev-charging%2Frange-confidence%2Fchap-6a-evse-catalog.html">Electric vehicle charging stations</a></li>
</ul>
</div>`
});