abhijithvijayan / google-ima.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google-ima.js

πŸ™‹β€β™‚οΈ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


A drop in replacement for Google's Interactive Media Ads library for preventing websites crashing if Adblocker is enabled.

❀️ it? ⭐️ it on GitHub or Tweet about it.

Table of Contents

Usage

Inject the script into the page and you are done.

paste in console or use extensions that inject scripts

(() => {
  var sdk = "https://raw.githubusercontent.com/abhijithvijayan/google-ima.js/main/sdk.js";
  var scriptToInject = document.createElement("script");
  // use any proxy, eg: `https://corsproxy.io/?`
  var scriptSrcURL = 'https://api.codetabs.com/v1/proxy/?quest=' + encodeURIComponent(sdk);

  fetch(scriptSrcURL).then((res) => res.text()).then((code) => {
    scriptToInject.append(code);
    document.body.append(scriptToInject);
  })
})();

FAQs

1. What is the purpose of this dumb sdk mirror that does nothing?

I personally ran into issue with https://www.fancode.com crashing when SDK failed to load through my ad blocker dns resolver. I didn't want to solve it by whitelisting the domain which would've defeated the purpose of ad blocker. So this dumb SDK acted like a proxy for the website scripts which prevented it from crashing.

Issues

Looking to contribute? Look for the Good First Issue label.

πŸ› Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

See Bugs

License

MIT Β© Abhijith Vijayan

About

License:MIT License


Languages

Language:JavaScript 100.0%