BarProp-target.html (674B)
1 <!DOCTYPE html> 2 <script> 3 const barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"]; 4 const barPropsObj = {}; 5 const channelName = location.search.substr(1); 6 const channel = new BroadcastChannel(channelName); 7 for (const prop of barProps) { 8 barPropsObj[prop] = window[prop].visible; 9 } 10 channel.postMessage(barPropsObj); 11 12 // Because messages are not delivered synchronously and because closing a 13 // browsing context prompts the eventual clearing of all task sources, this 14 // document should not be closed until the opener document has confirmed 15 // receipt. 16 channel.onmessage = () => { window.close() }; 17 </script>