找出并打印window非原生扩展属性 windowExtendAttr.js
2021-05-12 16:26
标签:length nbsp key ram element .com rem obj r.js supme 找出并打印window非原生扩展属性 windowExtendAttr.js http://owmivsi48.bkt.clouddn.com/windowExtendAttr.js 找出并打印window非原生扩展属性 windowExtendAttr.js 标签:length nbsp key ram element .com rem obj r.js 原文地址:http://www.cnblogs.com/supme/p/7574183.html
window扩展属性,扩展方法,扩展函数,非原生属性,非原生方法,非原生函数// windowExtendAttr.js
(function() {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
var originWindow = iframe.contentWindow,
currentWindow = window;
var origin = Object.keys(originWindow),
current = Object.keys(currentWindow),
extendAttr = {};
current.forEach((key) => {
if (originWindow[key] === undefined) {
extendAttr[key] = currentWindow[key]
};
})
console.log(`origin window:${origin.length},current window:${current.length},extentAttr:${Object.keys(extendAttr).length}`)
console.log(`extendAttr:`, extendAttr );
document.body.removeChild(iframe);
})();
上一篇:php 实现字符串最大子串长度
文章标题:找出并打印window非原生扩展属性 windowExtendAttr.js
文章链接:http://soscw.com/index.php/essay/84753.html