[{"data":1,"prerenderedAt":96},["ShallowReactive",2],{"snippets-tag-window":3},[4],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"createdAt":11,"tags":12,"body":15,"_type":90,"_id":91,"_source":92,"_file":93,"_stem":94,"_extension":95},"/snippets/show-all-non-native-window-properties","snippets",false,"","Get all non native window variables",null,"05/03/2024",[13,14],"javascript","window",{"type":16,"children":17,"toc":86},"root",[18,63,70],{"type":19,"tag":20,"props":21,"children":24},"element","div",{"className":22},[23],"c-code-wrapper",[25,28,50],{"type":26,"value":27},"text","\n  ",{"type":19,"tag":20,"props":29,"children":32},{"className":30},[31],"c-code-wrapper__header",[33,35,41,42,49],{"type":26,"value":34},"\n    ",{"type":19,"tag":20,"props":36,"children":39},{"className":37},[38],"c-code-wrapper__title",[40],{"type":26,"value":9},{"type":26,"value":34},{"type":19,"tag":20,"props":43,"children":46},{"className":44},[45],"c-code-wrapper__copy",[47],{"type":26,"value":48},"Copy",{"type":26,"value":27},{"type":19,"tag":51,"props":52,"children":57},"pre",{"className":53,"code":55,"filename":56,"language":56,"meta":8},[54],"language-js","// Get all non native window variables\n\n(function showAllNonNativeWindowProperties() {\n  const iframe = document.createElement(\"iframe\");\n  iframe.style.display = \"none\";\n  document.body.appendChild(iframe);\n\n  const currentWindowProps = Object.getOwnPropertyNames(window);\n\n  const allNonNativeProps = currentWindowProps.filter(function (prop) {\n    return !iframe.contentWindow.hasOwnProperty(prop);\n  });\n\n  for (const prop of allNonNativeProps.sort()) {\n    console.log(`Saabbir ${prop}: `, window[`${prop}`]);\n  }\n\n  document.body.removeChild(iframe);\n})();\n","js",[58],{"type":19,"tag":59,"props":60,"children":61},"code",{"__ignoreMap":8},[62],{"type":26,"value":55},{"type":19,"tag":64,"props":65,"children":67},"h2",{"id":66},"further-reading",[68],{"type":26,"value":69},"Further reading",{"type":19,"tag":71,"props":72,"children":73},"ul",{},[74],{"type":19,"tag":75,"props":76,"children":77},"li",{},[78],{"type":19,"tag":79,"props":80,"children":84},"a",{"href":81,"rel":82},"https://stackoverflow.com/questions/17246309/get-all-user-defined-window-properties",[83],"nofollow",[85],{"type":26,"value":81},{"title":8,"searchDepth":87,"depth":87,"links":88},2,[89],{"id":66,"depth":87,"text":69},"markdown","content:snippets:show-all-non-native-window-properties.md","content","snippets/show-all-non-native-window-properties.md","snippets/show-all-non-native-window-properties","md",1788788972772]