Get started with sopa CDN

MIT licensed

SOPA isnt a library, but a defunct 2011 US anti-piracy bill.

Tags:
  • sopa

Stable version

Copied!

How to start using sopa CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with sopa CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/sopa/1.0/stopcensorship.min.js"></script>
  <script>
    // Initialize SOPA with your custom configuration
    const config = {
      url: 'https://example.com', // Replace with your website URL
      allowList: ['example.com'], // Replace with allowed domains
      blockList: ['piratebay.org'] // Replace with blocked domains
    };

    const sopa = new window.STOP();

    // Initialize SOPA with the configuration
    sopa.setConfig(config);

    // Start monitoring the website for piracy links
    sopa.start();

    // Handle piracy links when detected
    sopa.on('piracyDetected', (url) => {
      console.log('Piracy detected:', url);
      // Add your custom logic here to handle piracy links
    });
  </script>
</head>
<body>
  <!-- Your website content goes here -->
</body>
</html>
Copied!
Copied!

All versions