[{"data":1,"prerenderedAt":102},["ShallowReactive",2],{"snippet-show-all-non-native-window-properties":3,"snippets-surround-show-all-non-native-window-properties":95},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"createdAt":10,"tags":11,"body":14,"_type":89,"_id":90,"_source":91,"_file":92,"_stem":93,"_extension":94},"/snippets/show-all-non-native-window-properties","snippets",false,"","Get all non native window variables",null,"05/03/2024",[12,13],"javascript","window",{"type":15,"children":16,"toc":85},"root",[17,62,69],{"type":18,"tag":19,"props":20,"children":23},"element","div",{"className":21},[22],"c-code-wrapper",[24,27,49],{"type":25,"value":26},"text","\n  ",{"type":18,"tag":19,"props":28,"children":31},{"className":29},[30],"c-code-wrapper__header",[32,34,40,41,48],{"type":25,"value":33},"\n    ",{"type":18,"tag":19,"props":35,"children":38},{"className":36},[37],"c-code-wrapper__title",[39],{"type":25,"value":8},{"type":25,"value":33},{"type":18,"tag":19,"props":42,"children":45},{"className":43},[44],"c-code-wrapper__copy",[46],{"type":25,"value":47},"Copy",{"type":25,"value":26},{"type":18,"tag":50,"props":51,"children":56},"pre",{"className":52,"code":54,"filename":55,"language":55,"meta":7},[53],"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",[57],{"type":18,"tag":58,"props":59,"children":60},"code",{"__ignoreMap":7},[61],{"type":25,"value":54},{"type":18,"tag":63,"props":64,"children":66},"h2",{"id":65},"further-reading",[67],{"type":25,"value":68},"Further reading",{"type":18,"tag":70,"props":71,"children":72},"ul",{},[73],{"type":18,"tag":74,"props":75,"children":76},"li",{},[77],{"type":18,"tag":78,"props":79,"children":83},"a",{"href":80,"rel":81},"https://stackoverflow.com/questions/17246309/get-all-user-defined-window-properties",[82],"nofollow",[84],{"type":25,"value":80},{"title":7,"searchDepth":86,"depth":86,"links":87},2,[88],{"id":65,"depth":86,"text":68},"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",[96,99],{"_path":97,"title":98},"/snippets/safari-back-forward-cache-override","Safari back-forward-cache override",{"_path":100,"title":101},"/snippets/detect-horizontal-swipe","Detect Horizontal Swipe",1788788972379]