{"action":"closed","issue":{"url":"https://api.github.com/repos/sahat/satellizer/issues/420","labels_url":"https://api.github.com/repos/sahat/satellizer/issues/420/labels{/name}","comments_url":"https://api.github.com/repos/sahat/satellizer/issues/420/comments","events_url":"https://api.github.com/repos/sahat/satellizer/issues/420/events","html_url":"https://github.com/sahat/satellizer/issues/420","id":78690844,"number":420,"title":"Code Improvemnt: documentOrigin and popupWindowOrigin are calculated wrong","user":{"login":"nzamani","id":884161,"avatar_url":"https://avatars.githubusercontent.com/u/884161?v=3","gravatar_id":"","url":"https://api.github.com/users/nzamani","html_url":"https://github.com/nzamani","followers_url":"https://api.github.com/users/nzamani/followers","following_url":"https://api.github.com/users/nzamani/following{/other_user}","gists_url":"https://api.github.com/users/nzamani/gists{/gist_id}","starred_url":"https://api.github.com/users/nzamani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzamani/subscriptions","organizations_url":"https://api.github.com/users/nzamani/orgs","repos_url":"https://api.github.com/users/nzamani/repos","events_url":"https://api.github.com/users/nzamani/events{/privacy}","received_events_url":"https://api.github.com/users/nzamani/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-20T20:45:43Z","updated_at":"2015-05-21T00:46:35Z","closed_at":"2015-05-21T00:46:35Z","body":"In line 680 you do the following (see source at https://github.com/sahat/satellizer/blob/master/satellizer.js#L680-L681 ):\r\n\r\n```javascript\r\nvar documentOrigin = document.location.host + ':' + document.location.port,\r\n                popupWindowOrigin = popup.popupWindow.location.host + ':' + popup.popupWindow.location.port;\r\n```\r\n\r\nIn JavaScript document.location.host already contains the port, so doing something like  \r\n\r\n```javascript\r\nvar documentOrigin = document.location.host + ':' + document.location.port;\r\n```\r\nwill have a weird result, i.e. \"localhost:8181:8181\". Instead you should use\r\n\r\n```javascript\r\nvar documentOrigin = document.location.host,\r\n    popupWindowOrigin = popup.popupWindow.location.host;\r\n```\r\n\r\nThis also makes sure that you don't have a tailing \":\" without a port...\r\n"}}