CSK - Content Security Killer

Have you ever wanted to experiment with JS on a website, and you can't because of CSP and TrustedHTML? Well now you can!

// ==UserScript==
// @name         CSK - Content Security Killer
// @namespace    http://tampermonkey.net/
// @version      2025-06-22
// @description  Have you ever wanted to experiment with JS on a website, and you can't because of CSP and TrustedHTML? Well now you can!
// @author       ZERO
// @include      http://*/*
// @include      https://*/*
// @include      http://localhost/*
// @include      http://10.*.*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.com
// @grant        none
// ==/UserScript==

(function() {
  const proto = Element.prototype
  const originalInnerHTMLDesc = Object.getOwnPropertyDescriptor(proto, 'innerHTML')

  Object.defineProperty(proto, 'innerHTML', {
    configurable: true,
    enumerable: originalInnerHTMLDesc.enumerable,
    get() {
      return originalInnerHTMLDesc.get.call(this)
    },
    set(value) {
      const origSet = originalInnerHTMLDesc.set.bind(this)
      try {
        origSet(value)
      } catch {
        origSet(value)
      }
    },
  })

  window.addEventListener('DOMContentLoaded', () => {
    const metas = document.querySelectorAll('meta[http-equiv="Expires"]')
    metas.forEach(meta => meta.remove())
  })
})();
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

一年攒够 12 元

云驰互联

云驰互联