有没有办法在页面加载后但脚本执行前 运行 内容脚本?

Is there a way to run a content script after the page is loaded but before scripts are executed?

我正在编写一个浏览器扩展来拦截页面上加载时但在执行之前的所有脚本标记。需要明确的是,我并不是要完全阻止脚本;我只想在 运行.

之前拦截并 analyze/modify 它们

有办法吗?

我知道 Firefox 的 onbeforescriptexecute 及其 Chrome 的 polyfill,但我希望有更多“官方”和跨浏览器的东西...

CertainPerformance in the comments, you can use a MutationObserver to observe changes to the DOM as shown here:

所回答