文章目录
-
-
- [1. 查看bodystyle="overflow:hidden" 是在哪里加的](#1. 查看bodystyle="overflow:hidden“ 是在哪里加的)
-
1. 查看bodystyle="overflow:hidden" 是在哪里加的
在main.ts顶部添加如下代码
shell
// main.ts 最顶部
const observer = new MutationObserver((mutations) => {
mutations.forEach((m) => {
if (m.attributeName === 'style') {
console.log('body.style changed →', document.body.style.cssText);
console.trace(); // 打印调用栈
}
});
});
observer.observe(document.body, {
attributes: true,
attributeFilter: ['style'],
});
再次运行,即可在console中看到堆栈
