disconnect on unload and tab close
NOT WORKING; babysteps towards multiple window support
NOT WORKING; babysteps towards multiple window support