Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-plugin-adsense

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-adsense - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

19

book/plugin.js
require(["gitbook"], function(gitbook) {
var config = config.adsense
, adInsertPoint = document.querySelector('.page-inner section')
, adsByGoogleScript
, ad
;
gitbook.events.bind("start", function(e, config) {
var config = config.adsense
, adsByGoogleScript
, ad
;
// Inject script to head.

@@ -22,6 +23,12 @@ adsByGoogleScript = document.createElement('script');

ad.setAttribute('data-ad-format', config.format);
document.querySelector('.page-inner section').appendChild(ad);
adInsertPoint.appendChild(ad);
(adsbygoogle = window.adsbygoogle || []).push({});
});
gitbook.events.bind("page.change", function() {
if (ad) {
adInsertPoint.appendChild(ad);
}
});
});

@@ -5,3 +5,3 @@ {

"main": "index.js",
"version": "0.0.3",
"version": "0.0.4",
"engines": {

@@ -8,0 +8,0 @@ "gitbook": ">=2.5.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc