Kiss Insights Goodbye

Remove KissInsights dialogs from all web sites.

  1. // ==UserScript==
  2. // @name Kiss Insights Goodbye
  3. // @namespace https://github.com/johan/
  4. // @description Remove KissInsights dialogs from all web sites.
  5. // @match https://*/*
  6. // @match http://*/*
  7. // @run-at document-start
  8. // @version 0.0.1.20140419225638
  9. // ==/UserScript==
  10.  
  11. var start = +new Date
  12. , kmode = localStorage.KissInsights
  13. , quiet = kmode === 'quiet'
  14. , is_ki = /^\/\/s3\.amazonaws\.com\/(ki\.js|r\.kissinsights\.com)\//
  15. , edits = { childList: true
  16. , subtree: true
  17. }
  18. ;
  19.  
  20. if (quiet || !kmode)
  21. (new WebKitMutationObserver(removeKissInsights)).observe(document, edits);
  22.  
  23. function removeKissInsights(mutations) {
  24. for (var i = 0, m; m = mutations[i]; i++)
  25. for (var j = 0, a = m.addedNodes, n; n = a[j]; j++)
  26. if (n.id === 'ki_container')
  27. nuke('Kiss Insights container removed: ', n);
  28. else if (n.src && /^script$/i.test(n.nodeName) &&
  29. is_ki.test(n.getAttribute('src')))
  30. nuke('Kiss Insights script removed: ', n);
  31. }
  32.  
  33. function nuke(msg, n) {
  34. n.parentNode.removeChild(n);
  35. if (quiet) return;
  36. var args = [].slice.call(arguments)
  37. , help = '\nTo enable for this site, set localStorage.KissInsights = true;'
  38. ;
  39. console.warn.apply(console, [+new Date - start +'ms:'].concat(args, help));
  40. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址