logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git

google-integrity.js (1341B)


  1. // Copyright 2023 Haelwenn (lanodan) Monnier <contact+google-integrity@hacktivis.me>
  2. // Distributed under CC0-1.0
  3. // Spreading is highly encouraged
  4. if(navigator.getEnvironmentIntegrity!==undefined) {
  5. // Gets a nice 80em-width block on my site
  6. var warning = document.createElement("article");
  7. // It *is* a warning
  8. warning.classList = 'warn';
  9. warning.innerHTML = "<p><strong>Your browser</strong> seems to support Google DRM (Web Environment Integrity), designed to prevent ad-blocking from working, but this would also prevent anti-malware from working. But more importantly it would render alternative browsers either marginal, or illegal (circumventing DRM is illegal).</p><p>Consider:<ol><li>Donating to or Participating in campaigns for an anti-trust lawsuit against Google. Considering that introducing your own DRM into an otherwise open-platform is anti-competitive.</li><li>Installing a better browser, such as: <a href=\"https://hacktivis.me/projects/badwolf\">BadWolf</a> by yours truly, <a href=\"https://librewolf.net/\">LibreWolf</a> (Firefox but which trully respects your privacy). But please note that this is politically useless in the face of anti-competitiveness.</li></ol></p>";
  10. // Replace existing banner with warning
  11. var header = document.querySelector('header');
  12. document.body.replaceChild(warning, header);
  13. }