找出并打印window非原生扩展属性 windowExtendAttr.js

2021-05-12 16:26

阅读:436

标签:length   nbsp   key   ram   element   .com   rem   obj   r.js   

supme

找出并打印window非原生扩展属性 windowExtendAttr.js 
window扩展属性,扩展方法,扩展函数,非原生属性,非原生方法,非原生函数

http://owmivsi48.bkt.clouddn.com/windowExtendAttr.js 

// 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);
})();

 

找出并打印window非原生扩展属性 windowExtendAttr.js

标签:length   nbsp   key   ram   element   .com   rem   obj   r.js   

原文地址:http://www.cnblogs.com/supme/p/7574183.html


评论


亲,登录后才可以留言!